Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

108205: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud)
      108186:       Reverse merged 5.0.N (5.0.3)
               << Better solution found >>
               106968: Merged DEV to 5.0.N (5.0.3)
                  106962: MNT-13706 : Admin console unusable after we set any  busy port in Port Number Value for subsystem
                     - Implemented fix for Transformations (JodConverter), FTP, SMTP and IMAP.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@108221 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-07-14 07:03:15 +00:00
parent 576d2a0afd
commit f13dc0a415
8 changed files with 1533 additions and 1843 deletions

View File

@@ -37,27 +37,12 @@ import com.icegreen.greenmail.util.ServerSetup;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLServerSocket;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.management.subsystems.LoggableErrorEvent;
import org.alfresco.util.PortUtil;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
/**
* @author Mike Shavnev
*/
public class AlfrescoImapServer extends AbstractLifecycleBean implements ApplicationEventPublisherAware
public class AlfrescoImapServer extends AbstractLifecycleBean
{
private static final String IMAP_PORT_OCCUPIED_MESSAGE = "system.imap.err.port_in_use";
private ApplicationEventPublisher applicationEventPublisher;
@Override
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
{
this.applicationEventPublisher = applicationEventPublisher;
}
private class SecureImapServer extends ImapServer
{
@@ -265,13 +250,6 @@ public class AlfrescoImapServer extends AbstractLifecycleBean implements Applica
if(isImapEnabled())
{
// Check if port is occupied.
if (!PortUtil.isPortFree(port))
{
applicationEventPublisher.publishEvent(new LoggableErrorEvent(this,
new AlfrescoRuntimeException(IMAP_PORT_OCCUPIED_MESSAGE, new String[] { "" + port })));
}
AtomicReference<Exception> serverOpeningExceptionRef = new AtomicReference<Exception>();
serverImpl = new DefaultImapServer(new ServerSetup(port, host, ServerSetup.PROTOCOL_IMAP), imapManagers, serverOpeningExceptionRef);
serverImpl.startService(null);