mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixes to subsystems for clean shutdown
- FTPConfigSection / CIFSConfigSection now aware of whether they constructed the authenticator themselves - AbstractTriggerBean doesn't try to unschedule a trigger if the scheduler is already shut down - RuntimeExecBootstrapBean can cope with running in a subsystem and shutting down without the VM shutting down - DefaultManagedApplicationContextFactory will start up the application context it is proxying to if it has not already been started git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13846 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -54,6 +54,7 @@ import org.alfresco.service.cmr.security.PersonService;
|
|||||||
import org.alfresco.service.transaction.TransactionService;
|
import org.alfresco.service.transaction.TransactionService;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.springframework.beans.factory.DisposableBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CIFS Authenticator Base Class
|
* CIFS Authenticator Base Class
|
||||||
@@ -63,7 +64,7 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
*
|
*
|
||||||
* @author gkspencer
|
* @author gkspencer
|
||||||
*/
|
*/
|
||||||
public abstract class CifsAuthenticatorBase extends CifsAuthenticator
|
public abstract class CifsAuthenticatorBase extends CifsAuthenticator implements DisposableBean
|
||||||
{
|
{
|
||||||
// Logging
|
// Logging
|
||||||
|
|
||||||
@@ -521,4 +522,12 @@ public abstract class CifsAuthenticatorBase extends CifsAuthenticator
|
|||||||
|
|
||||||
return txService.getUserTransaction( txService.isReadOnly() ? true : false);
|
return txService.getUserTransaction( txService.isReadOnly() ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle tidy up on container shutdown
|
||||||
|
*/
|
||||||
|
public void destroy() throws Exception
|
||||||
|
{
|
||||||
|
closeAuthenticator();
|
||||||
|
}
|
||||||
}
|
}
|
@@ -41,12 +41,13 @@ import org.alfresco.service.cmr.security.AuthorityService;
|
|||||||
import org.alfresco.service.transaction.TransactionService;
|
import org.alfresco.service.transaction.TransactionService;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.springframework.beans.factory.DisposableBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author gkspencer
|
* @author gkspencer
|
||||||
*/
|
*/
|
||||||
public abstract class FTPAuthenticatorBase implements FTPAuthenticator {
|
public abstract class FTPAuthenticatorBase implements FTPAuthenticator, DisposableBean {
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
|
|
||||||
@@ -249,4 +250,14 @@ public abstract class FTPAuthenticatorBase implements FTPAuthenticator {
|
|||||||
|
|
||||||
return txService.getUserTransaction( txService.isReadOnly() ? true : false);
|
return txService.getUserTransaction( txService.isReadOnly() ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle tidy up on container shutdown
|
||||||
|
*/
|
||||||
|
public void destroy()
|
||||||
|
{
|
||||||
|
closeAuthenticator();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -169,8 +169,12 @@ public class DefaultManagedApplicationContextFactory extends AbstractLifecycleBe
|
|||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.alfresco.repo.management.ManagedApplicationContextFactory#getApplicationContext()
|
* @see org.alfresco.repo.management.ManagedApplicationContextFactory#getApplicationContext()
|
||||||
*/
|
*/
|
||||||
public ApplicationContext getApplicationContext()
|
public synchronized ApplicationContext getApplicationContext()
|
||||||
{
|
{
|
||||||
|
if (this.applicationContext == null)
|
||||||
|
{
|
||||||
|
onStart();
|
||||||
|
}
|
||||||
return this.applicationContext;
|
return this.applicationContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +185,7 @@ public class DefaultManagedApplicationContextFactory extends AbstractLifecycleBe
|
|||||||
@Override
|
@Override
|
||||||
protected void onBootstrap(ApplicationEvent event)
|
protected void onBootstrap(ApplicationEvent event)
|
||||||
{
|
{
|
||||||
if (this.autoStart)
|
if (this.autoStart && this.applicationContext == null)
|
||||||
{
|
{
|
||||||
onStart();
|
onStart();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user