|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.util.component.AbstractLifeCycle org.eclipse.jetty.policy.PolicyMonitor
public abstract class PolicyMonitor
PolicyMonitor watches a directory for files ending in the *.policy extension, loads them and detects when they change. PolicyGrants are peeped out the onPolicyChange method to whoever is using this monitor.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
AbstractLifeCycle.AbstractLifeCycleListener |
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
LifeCycle.Listener |
Field Summary |
---|
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
Constructor Summary | |
---|---|
PolicyMonitor()
empty constructor |
|
PolicyMonitor(String directory)
construtor with a predetermined directory to monitor |
Method Summary | |
---|---|
protected void |
doStart()
called by the abstract lifecycle to start the monitor |
protected void |
doStop()
called by the abstract life cycle to turn off the monitor |
int |
getScanCount()
gets the number of times the scan has been run |
int |
getScanInterval()
gets the scanner interval |
boolean |
isInitialized()
true of the monitor is initialized, meaning that at least one scan cycle has completed and any policy grants found have been chirped |
boolean |
isReloadEnabled()
true of reload is enabled, false otherwise |
abstract void |
onPolicyChange(PolicyBlock grant)
implemented by the user of the policy monitor to handle custom logic related to the usage of the policy grant instance/s. |
void |
setPolicyDirectory(String directory)
set the policy directory to scan on a non-running monitor |
void |
setReload(boolean reload)
sets the monitor to reload or not, but only if the monitor isn't already running TODO this doesn't really _have_ to be on a non-running monitor |
void |
setScanInterval(int scanInterval)
sets the scanner interval on a non-running instance of the monitor |
void |
waitForScan()
initiates a scan and blocks until it has been completed |
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PolicyMonitor()
public PolicyMonitor(String directory)
directory
- Method Detail |
---|
public void setPolicyDirectory(String directory)
directory
- public int getScanInterval()
public void setScanInterval(int scanInterval)
scanInterval
- in secondsScanner.setScanInterval(int)
public boolean isInitialized()
public int getScanCount()
public void waitForScan() throws Exception
Exception
public boolean isReloadEnabled()
public void setReload(boolean reload)
reload
- protected void doStart() throws Exception
doStart
in class AbstractLifeCycle
Exception
protected void doStop() throws Exception
doStop
in class AbstractLifeCycle
Exception
public abstract void onPolicyChange(PolicyBlock grant)
grant
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |