deployment service: implementation of long timeout

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23018 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2010-10-11 14:26:41 +00:00
parent 0fe90a6d1a
commit 43549e98e8

View File

@@ -1880,7 +1880,6 @@ public class DeploymentServiceImpl implements DeploymentService
{ {
active = false; active = false;
} }
} }
/** /**
@@ -1891,13 +1890,21 @@ public class DeploymentServiceImpl implements DeploymentService
@Override @Override
public boolean isActive() public boolean isActive()
{ {
Date now = new Date();
synchronized(this)
{
if(now.getTime() > lastActive.getTime() + targetLockTimeToLive)
{
active = false;
}
// may need to sync active flag // may need to sync active flag
if(fgLogger.isDebugEnabled()) if(fgLogger.isDebugEnabled())
{ {
fgLogger.debug("deployment service callback active: " + active); fgLogger.debug("deployment service callback active: " + active);
} }
synchronized(this)
{
return active; return active;
} }
} }