|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.contrib.GlobalInfo org.xmlBlaster.contrib.filewatcher.FileWatcherPlugin
public class FileWatcherPlugin
FileWatcherPlugin polls on a directory in the file system for new files. If one new file is found which meets the required specifications, its content is read and published.
Field Summary | |
---|---|
private ContextNode |
contextNode
|
private boolean |
isShutdown
|
private static java.util.logging.Logger |
log
|
private java.lang.Object |
mbeanHandle
My JMX registration |
private java.lang.String |
ME
|
private Publisher |
publisherClient
|
Fields inherited from class org.xmlBlaster.contrib.GlobalInfo |
---|
global, LOWER_CASE, ORIGINAL_ENGINE_GLOBAL, pluginInfo, UNTOUCHED, UPPER_CASE |
Fields inherited from interface org.xmlBlaster.contrib.I_Info |
---|
ID, JMX_PREFIX |
Constructor Summary | |
---|---|
|
FileWatcherPlugin()
|
private |
FileWatcherPlugin(java.lang.String fakeString)
This constructor shall be invoked if using this class standalone |
Method Summary | |
---|---|
void |
activate()
Activate this service |
void |
deActivate()
Deactivate the service to standby. |
void |
doInit(Global global_,
PluginInfo pluginInfo_)
|
long |
getDelaySinceLastFileChange()
|
java.lang.String |
getDirectoryName()
|
java.lang.String |
getDiscarded()
|
java.lang.String |
getFileFilter()
|
java.lang.String |
getFilterType()
|
java.lang.String |
getLockExtention()
|
long |
getMaximumFileSize()
|
long |
getPollInterval()
|
java.lang.String |
getSent()
|
java.lang.String |
getUsageUrl()
|
boolean |
isActive()
Access the current state |
boolean |
isCopyOnMove()
|
boolean |
isRecursive()
|
boolean |
isShutdown()
Check status |
static void |
main(java.lang.String[] args)
|
void |
setCopyOnMove(boolean copyOnMove)
|
void |
setDelaySinceLastFileChange(long delaySinceLastFileChange)
|
void |
setDirectoryName(java.lang.String directoryName)
|
void |
setDiscarded(java.lang.String discarded)
|
void |
setFileFilter(java.lang.String fileFilter)
|
void |
setFilterType(java.lang.String filterType)
|
void |
setLockExtention(java.lang.String lockExtention)
|
void |
setMaximumFileSize(long maximumFileSize)
|
void |
setPollInterval(long pollInterval)
|
void |
setRecursive(boolean rec)
|
void |
setSent(java.lang.String sent)
|
void |
setUsageUrl(java.lang.String url)
|
void |
shutdown()
Cleans up the resource. |
java.lang.String |
triggerScan()
Triggers a filewatcher scan. |
java.lang.String |
usage()
|
Methods inherited from class org.xmlBlaster.contrib.GlobalInfo |
---|
dump, get, getBoolean, getGlobal, getInt, getKeys, getLong, getObject, getObjectKeys, getOriginalGlobal, getRaw, getStrippedString, getType, getVersion, init, loadPlugin, put, putObject, putRaw, replaceAllEntries, setStrippedHostname |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xmlBlaster.util.admin.I_AdminPlugin |
---|
getType, getVersion |
Field Detail |
---|
private static java.util.logging.Logger log
private java.lang.String ME
private Publisher publisherClient
private java.lang.Object mbeanHandle
private ContextNode contextNode
private boolean isShutdown
Constructor Detail |
---|
private FileWatcherPlugin(java.lang.String fakeString)
fakeString
- public FileWatcherPlugin()
Method Detail |
---|
public void doInit(Global global_, PluginInfo pluginInfo_) throws XmlBlasterException
doInit
in class GlobalInfo
global_
- The global passed by the RunLevelManager, this is not the object owned by the plugin. It is the original global.
XmlBlasterException
I_Plugin.init(org.xmlBlaster.util.Global, org.xmlBlaster.util.plugin.PluginInfo)
public void shutdown() throws XmlBlasterException
I_Plugin
shutdown
in interface I_AdminPlugin
shutdown
in interface I_Plugin
shutdown
in class GlobalInfo
XmlBlasterException
- if an exception occurs. The exception is
handled by the RunLevelManager depending on how the plugin has been
configured with the action:
<action do='STOP' onShutdownRunlevel='2' sequence='5'
onFail='resource.configuration.pluginFailed'>
If onFail is defined to something, the RunLevelManager will stop.I_Plugin.shutdown()
public java.lang.String triggerScan()
FileWatcherPluginMBean
triggerScan
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.triggerScan()
public java.lang.String getDirectoryName()
getDirectoryName
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.getDirectoryName()
public void setDirectoryName(java.lang.String directoryName)
setDirectoryName
in interface FileWatcherPluginMBean
directoryName
- The directoryName to set.FileWatcherPluginMBean.setDirectoryName(java.lang.String)
public java.lang.String getFileFilter()
getFileFilter
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.getFileFilter()
public void setFileFilter(java.lang.String fileFilter)
setFileFilter
in interface FileWatcherPluginMBean
fileFilter
- The fileFilter to set.FileWatcherPluginMBean.setFileFilter(java.lang.String)
public java.lang.String getFilterType()
getFilterType
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.getFilterType()
public void setFilterType(java.lang.String filterType)
setFilterType
in interface FileWatcherPluginMBean
filterType
- The filterType to set.FileWatcherPluginMBean.setFilterType(java.lang.String)
public long getMaximumFileSize()
getMaximumFileSize
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.getMaximumFileSize()
public void setMaximumFileSize(long maximumFileSize)
setMaximumFileSize
in interface FileWatcherPluginMBean
maximumFileSize
- The maximumFileSize to set.FileWatcherPluginMBean.setMaximumFileSize(long)
public long getPollInterval()
getPollInterval
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.getPollInterval()
public void setPollInterval(long pollInterval)
setPollInterval
in interface FileWatcherPluginMBean
pollInterval
- The pollInterval to set.FileWatcherPluginMBean.setPollInterval(long)
public void activate() throws java.lang.Exception
I_AdminService
activate
in interface I_AdminService
java.lang.Exception
I_AdminService.activate()
public void deActivate()
I_AdminService
deActivate
in interface I_AdminService
I_AdminService.deActivate()
public boolean isActive()
I_AdminService
isActive
in interface I_AdminService
I_AdminService.isActive()
public boolean isCopyOnMove()
isCopyOnMove
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.isCopyOnMove()
public void setCopyOnMove(boolean copyOnMove)
setCopyOnMove
in interface FileWatcherPluginMBean
copyOnMove
- The copyOnMove to set.FileWatcherPluginMBean.setCopyOnMove(boolean)
public long getDelaySinceLastFileChange()
getDelaySinceLastFileChange
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.getDelaySinceLastFileChange()
public void setDelaySinceLastFileChange(long delaySinceLastFileChange)
setDelaySinceLastFileChange
in interface FileWatcherPluginMBean
delaySinceLastFileChange
- The delaySinceLastFileChange to set.FileWatcherPluginMBean.setDelaySinceLastFileChange(long)
public java.lang.String getDiscarded()
getDiscarded
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.getDiscarded()
public void setDiscarded(java.lang.String discarded)
setDiscarded
in interface FileWatcherPluginMBean
discarded
- The discarded to set.FileWatcherPluginMBean.setDiscarded(java.lang.String)
public java.lang.String getLockExtention()
getLockExtention
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.getLockExtention()
public void setLockExtention(java.lang.String lockExtention)
setLockExtention
in interface FileWatcherPluginMBean
lockExtention
- The lockExtention to set.FileWatcherPluginMBean.setLockExtention(java.lang.String)
public java.lang.String getSent()
getSent
in interface FileWatcherPluginMBean
FileWatcherPluginMBean.getSent()
public void setSent(java.lang.String sent)
setSent
in interface FileWatcherPluginMBean
sent
- The sent to set.FileWatcherPluginMBean.setSent(java.lang.String)
public boolean isShutdown()
I_AdminPlugin
isShutdown
in interface I_AdminPlugin
I_AdminPlugin.isShutdown()
public java.lang.String usage()
usage
in interface I_AdminUsage
I_AdminUsage.usage()
public java.lang.String getUsageUrl()
getUsageUrl
in interface I_AdminUsage
I_AdminUsage.getUsageUrl()
public void setUsageUrl(java.lang.String url)
setUsageUrl
in interface I_AdminUsage
I_AdminUsage.setUsageUrl(java.lang.String)
public void setRecursive(boolean rec)
setRecursive
in interface FileWatcherPluginMBean
public boolean isRecursive()
isRecursive
in interface FileWatcherPluginMBean
public static void main(java.lang.String[] args)
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |