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

107012: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud)
      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@107051 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-06-25 08:28:27 +00:00
parent 1eda74e709
commit 594145b66b
8 changed files with 2190 additions and 1880 deletions

View File

@@ -83,7 +83,11 @@ import org.alfresco.jlan.util.Platform;
import org.alfresco.jlan.util.StringList;
import org.alfresco.jlan.util.X64;
import org.alfresco.repo.management.subsystems.ActivateableBean;
import org.alfresco.repo.management.subsystems.LoggableErrorEvent;
import org.alfresco.util.PortUtil;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.extensions.config.element.GenericConfigElement;
@@ -99,8 +103,10 @@ import org.springframework.extensions.config.element.GenericConfigElement;
* @author dward
* @author mrogers
*/
public class ServerConfigurationBean extends AbstractServerConfigurationBean implements DisposableBean
public class ServerConfigurationBean extends AbstractServerConfigurationBean implements DisposableBean, ApplicationEventPublisherAware
{
private static final String FTP_PORT_OCCUPIED_MESSAGE = "system.ftp.err.port_in_use";
private CIFSConfigBean cifsConfigBean;
private FTPConfigBean ftpConfigBean;
private NFSConfigBean nfsConfigBean;
@@ -110,7 +116,8 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp
private ThreadRequestPool threadPool;
protected ClusterConfigBean clusterConfigBean;
private ApplicationEventPublisher applicationEventPublisher;
/**
* Default constructor
*/
@@ -1220,6 +1227,13 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp
ftpConfig.setFTPPort(port);
if (ftpConfig.getFTPPort() <= 0 || ftpConfig.getFTPPort() >= 65535)
throw new AlfrescoRuntimeException("FTP server port out of valid range");
// Check if port is occupied.
if (!PortUtil.isPortFree(port))
{
applicationEventPublisher.publishEvent(new LoggableErrorEvent(this,
new AlfrescoRuntimeException(FTP_PORT_OCCUPIED_MESSAGE, new String[] { "" + port })));
}
}
else
{
@@ -2367,4 +2381,10 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp
}
}
@Override
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
{
this.applicationEventPublisher = applicationEventPublisher;
}
}