org.eclipse.jetty.policy
类 PolicyMonitor

java.lang.Object
  继承者 org.eclipse.jetty.util.component.AbstractLifeCycle
      继承者 org.eclipse.jetty.policy.PolicyMonitor
所有已实现的接口:
LifeCycle

public abstract class PolicyMonitor
extends AbstractLifeCycle

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.


嵌套类摘要
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
构造方法摘要
PolicyMonitor()
          empty constructor
PolicyMonitor(String directory)
          construtor with a predetermined directory to monitor
 
方法摘要
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
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

PolicyMonitor

public PolicyMonitor()
empty constructor


PolicyMonitor

public PolicyMonitor(String directory)
construtor with a predetermined directory to monitor

参数:
directory -
方法详细信息

setPolicyDirectory

public void setPolicyDirectory(String directory)
set the policy directory to scan on a non-running monitor

参数:
directory -

getScanInterval

public int getScanInterval()
gets the scanner interval

返回:
the scan interval

setScanInterval

public void setScanInterval(int scanInterval)
sets the scanner interval on a non-running instance of the monitor

参数:
scanInterval - in seconds
另请参见:
Scanner.setScanInterval(int)

isInitialized

public 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

返回:
true if initialized

getScanCount

public int getScanCount()
gets the number of times the scan has been run

返回:
scan count

waitForScan

public void waitForScan()
                 throws Exception
initiates a scan and blocks until it has been completed

抛出:
Exception

isReloadEnabled

public boolean isReloadEnabled()
true of reload is enabled, false otherwise

返回:
true if reload is enabled

setReload

public 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

参数:
reload -

doStart

protected void doStart()
                throws Exception
called by the abstract lifecycle to start the monitor

覆盖:
AbstractLifeCycle 中的 doStart
抛出:
Exception

doStop

protected void doStop()
               throws Exception
called by the abstract life cycle to turn off the monitor

覆盖:
AbstractLifeCycle 中的 doStop
抛出:
Exception

onPolicyChange

public 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.

参数:
grant -


Copyright © 2013. All Rights Reserved.