|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.objectweb.easybeans.server.ContainersMonitor
org.objectweb.easybeans.server.DirectoryDeployerMonitor
public class DirectoryDeployerMonitor
This class monitors scan the directory and deploy archive if any. Also, archives are monitored. If there is a change, the archive is reloaded or undeployed and then deployed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private boolean |
bootInProgress
Initializing period ?. |
private java.util.Map<java.io.File,EZBDeployable> |
deployed
List of deployed files (by this monitor). |
private EZBDeployer |
deployer
Deployer. |
private java.util.List<java.io.File> |
failed
List of File that have a failed deployment (by this monitor). |
private JLog |
logger
Logger. |
private java.util.Map<java.io.File,java.lang.Long> |
modifiedFiles
Map between an File (monitored) and the last updated file. |
private static int |
SLEEP_TIME
Sleep time for the thread of the cleaner (5s). |
private boolean |
stopped
Stop order received ? |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
DirectoryDeployerMonitor(Embedded embedded)
Builds a new monitor by initializing lists. |
Method Summary | |
---|---|
protected void |
checkContainer(EZBContainer container)
Check a container (and its archive) and see if there is a need to reload the container. |
protected void |
checkModifiedDeployables()
Check if the current deployables that are deployed have been updated. |
private void |
detectNewArchives()
Scan all files present in the deploy directory and deploy them. |
protected boolean |
hasBeenUpdated(java.io.File file)
Check if the given file has been updated since the last check. |
void |
init()
Init containers (call at startup). |
void |
run()
Start the thread of this class It will clean all the work entries. |
void |
stopOrder()
Receives a stop order. |
Methods inherited from class org.objectweb.easybeans.server.ContainersMonitor |
---|
getEmbedded, getLastModified |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final int SLEEP_TIME
private JLog logger
private java.util.Map<java.io.File,java.lang.Long> modifiedFiles
private java.util.Map<java.io.File,EZBDeployable> deployed
private java.util.List<java.io.File> failed
private boolean bootInProgress
private boolean stopped
private EZBDeployer deployer
Constructor Detail |
---|
public DirectoryDeployerMonitor(Embedded embedded) throws EmbeddedException
embedded
- the embedded server which is monitored.
EmbeddedException
- if there is an exception for this monitor.Method Detail |
---|
public void init()
init
in class ContainersMonitor
public void run()
run
in interface java.lang.Runnable
run
in class ContainersMonitor
private void detectNewArchives() throws EmbeddedException
EmbeddedException
- if there is a problem during the scanprotected boolean hasBeenUpdated(java.io.File file)
file
- the file to test
protected void checkModifiedDeployables() throws EmbeddedException
EmbeddedException
- if the redeployment failsprotected void checkContainer(EZBContainer container)
checkContainer
in class ContainersMonitor
container
- the container to monitor.public void stopOrder()
stopOrder
in class ContainersMonitor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |