Class DirPollAdaptor
java.lang.Object
org.jpos.q2.QBeanSupport
org.jpos.q2.iso.DirPollAdaptor
- All Implemented Interfaces:
Configurable, DirPollAdaptorMBean, QBean, QBeanSupportMBean, QPersist
DirPoll Adaptor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DirPollThe managed DirPoll instance.protected ExecutorServiceThe executor service driving the DirPoll.Fields inherited from class QBeanSupport
cfg, log, scheduledThreadPoolExecutorModifier and TypeFieldDescriptionprotected ConfigurationConfiguration applied to this bean by the container.protected LogLogger associated with this bean.protected ScheduledThreadPoolExecutorLazily-allocated scheduler shared with subclasses; seeQBeanSupport.getScheduledThreadPoolExecutor().Fields inherited from interface QBean
DESTROYED, FAILED, STARTED, STARTING, stateString, STOPPED, STOPPINGModifier and TypeFieldDescriptionstatic final intQBean has been destroyed.static final intQBean has failed.static final intQBean is running.static final intQBean is in the process of starting.static final String[]Human-readable names for each QBean state, indexed by state constant.static final intQBean is stopped.static final intQBean is in the process of stopping. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DirPollCreates and returns theDirPollinstance managed by this adaptor.getPath()Returns the base directory path.longReturns the polling interval.intReturns the thread pool size.Returns the file extension priorities.Returns the processor class name.protected voidCalled during the init lifecycle phase; subclasses may override.voidSets the base directory path.voidsetPollInterval(long pollInterval) Sets the polling interval.voidsetPoolSize(int size) Sets the thread pool size.voidsetPriorities(String priorities) Sets the file extension priorities.voidsetProcessor(String processor) Sets the processor class name.protected voidCalled during the start lifecycle phase; subclasses may override.protected voidCalled during the stop lifecycle phase; subclasses may override.Methods inherited from class QBeanSupport
addAttr, close, createElement, defaultRealm, destroy, destroyService, getAttrs, getAttrs, getConfiguration, getDump, getFactory, getLoader, getLoaderURLS, getLog, getLogger, getName, getPersist, getProperties, getProperty, getRealm, getScheduledThreadPoolExecutor, getServer, getState, getStateAsString, init, isModified, running, setAttr, setConfiguration, setLogger, setModified, setName, setPersist, setProperty, setRealm, setServer, setState, start, stopModifier and TypeMethodDescriptionprotected voidAppends an<attr>child element with name/type/value toe.protected voidCloses a sequence ofCloseableresources, logging any failures as a warning.protected org.jdom2.ElementcreateElement(String name, Class mbeanClass) Builds a JDOMElementreflecting the bean's persistent attributes, driven by the JavaBean introspection ofmbeanClass.protected StringReturns the default realm for this bean; subclasses may override.voiddestroy()destroy the serviceprotected voidCalled during the destroy lifecycle phase; subclasses may override.protected IteratorgetAttrs()Iterates over top-level<attr>children of the persisted element.protected IteratorIterates over<attr>children nested under the given parent element name.Returns the configuration applied to this bean.getDump()Returns a textual dump of this bean's state.Returns theQFactoryassociated with the hosting Q2 server.Returns the QClassLoader for this bean.URL[]Returns the URLs registered with the class loader.getLog()Returns theLogused by this bean.Returns the logger name.getName()Returns the bean name.org.jdom2.ElementReturns the persistent configuration element for this QBean.protected IteratorgetProperties(String parent) Iterates over<property>children nested under the given parent element name.protected StringgetProperty(Iterator props, String name) Returns the value of the named property from an iterator of<property>elements.getRealm()Returns the logging realm.protected ScheduledThreadPoolExecutorLazily creates and returns aScheduledThreadPoolExecutorfor use by subclasses.Returns the Q2 server instance.intgetState()Returns the current state of this QBean.Returns the current state as a human-readable string.voidinit()init the servicebooleanReturnstrueif this QBean's configuration has been modified since last save.booleanrunning()Indicates whether this bean is currently starting or running.protected voidUpdates the value of the named attribute within an iterator of<attr>elements.voidConfigures this object with the suppliedConfiguration.voidSets the logger by name.voidsetModified(boolean modified) Marks this bean's persistent state as modified or in sync.voidSets the bean name.voidsetPersist(org.jdom2.Element persist) Sets the persistent configuration element.protected voidsetProperty(Iterator props, String name, String value) Updates the value attribute of the named property within an iterator of<property>elements.voidSets the logging realm.voidSets the Q2 server instance for this QBean.voidsetState(int state) Sets the lifecycle state of this bean.voidstart()start the servicevoidstop()stop the service
-
Field Details
-
dirPoll
-
dirPollExecutor
The executor service driving the DirPoll.
-
-
Constructor Details
-
DirPollAdaptor
public DirPollAdaptor()Default constructor.
-
-
Method Details
-
initService
Description copied from class:QBeanSupportCalled during the init lifecycle phase; subclasses may override.- Overrides:
initServicein classQBeanSupport- Throws:
Exception- on error
-
createDirPoll
Creates and returns theDirPollinstance managed by this adaptor. Subclasses may override to supply a custom DirPoll.- Returns:
- a new DirPoll instance
-
startService
Description copied from class:QBeanSupportCalled during the start lifecycle phase; subclasses may override.- Overrides:
startServicein classQBeanSupport- Throws:
Exception- on error
-
stopService
Description copied from class:QBeanSupportCalled during the stop lifecycle phase; subclasses may override.- Overrides:
stopServicein classQBeanSupport- Throws:
Exception- on error
-
setPath
Description copied from interface:DirPollAdaptorMBeanSets the base directory path.- Specified by:
setPathin interfaceDirPollAdaptorMBean- Parameters:
path- the directory path
-
setPoolSize
Description copied from interface:DirPollAdaptorMBeanSets the thread pool size.- Specified by:
setPoolSizein interfaceDirPollAdaptorMBean- Parameters:
size- the number of threads
-
getPoolSize
Description copied from interface:DirPollAdaptorMBeanReturns the thread pool size.- Specified by:
getPoolSizein interfaceDirPollAdaptorMBean- Returns:
- pool size
-
getPath
Description copied from interface:DirPollAdaptorMBeanReturns the base directory path.- Specified by:
getPathin interfaceDirPollAdaptorMBean- Returns:
- directory path
-
setPollInterval
Description copied from interface:DirPollAdaptorMBeanSets the polling interval.- Specified by:
setPollIntervalin interfaceDirPollAdaptorMBean- Parameters:
pollInterval- interval in milliseconds
-
getPollInterval
Description copied from interface:DirPollAdaptorMBeanReturns the polling interval.- Specified by:
getPollIntervalin interfaceDirPollAdaptorMBean- Returns:
- interval in milliseconds
-
setPriorities
Description copied from interface:DirPollAdaptorMBeanSets the file extension priorities.- Specified by:
setPrioritiesin interfaceDirPollAdaptorMBean- Parameters:
priorities- blank-separated list of extensions
-
getPriorities
Description copied from interface:DirPollAdaptorMBeanReturns the file extension priorities.- Specified by:
getPrioritiesin interfaceDirPollAdaptorMBean- Returns:
- blank-separated priority list
-
setProcessor
Description copied from interface:DirPollAdaptorMBeanSets the processor class name.- Specified by:
setProcessorin interfaceDirPollAdaptorMBean- Parameters:
processor- fully qualified class name
-
getProcessor
Description copied from interface:DirPollAdaptorMBeanReturns the processor class name.- Specified by:
getProcessorin interfaceDirPollAdaptorMBean- Returns:
- fully qualified class name
-