Fix AR-431, AR-432.

Modified the Repository bootstrap mechanism so it's performed after all other initialisation and the order of bootstrap is explicit.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2414 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2006-02-16 15:11:53 +00:00
parent 6fac677245
commit 6cb16abef4
14 changed files with 388 additions and 189 deletions

View File

@@ -27,6 +27,9 @@ import org.alfresco.filesys.server.config.ServerConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
@@ -36,7 +39,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
*
* @author GKSpencer
*/
public class FTPServer
public class FTPServer implements ApplicationListener
{
private static final Log logger = LogFactory.getLog("org.alfresco.ftp.server");
@@ -76,6 +79,29 @@ public class FTPServer
return (filesysConfig != null && filesysConfig.isFTPServerEnabled());
}
/*
* (non-Javadoc)
* @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
*/
public void onApplicationEvent(ApplicationEvent event)
{
if (event instanceof ContextRefreshedEvent)
{
try
{
startServer();
}
catch (SocketException e)
{
throw new AlfrescoRuntimeException("Failed to start FTP server", e);
}
catch (IOException e)
{
throw new AlfrescoRuntimeException("Failed to start FTP server", e);
}
}
}
/**
* Start the FTP server components
*