|
xmlBlaster 2.2.0 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 GlobalInfoglobal_ - The global passed by the RunLevelManager, this is not the object owned by the plugin. It is the original global.
XmlBlasterExceptionI_Plugin.init(org.xmlBlaster.util.Global, org.xmlBlaster.util.plugin.PluginInfo)
public void shutdown()
throws XmlBlasterException
I_Plugin
shutdown in interface I_AdminPluginshutdown in interface I_Pluginshutdown in class GlobalInfoXmlBlasterException - 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 FileWatcherPluginMBeanFileWatcherPluginMBean.triggerScan()public java.lang.String getDirectoryName()
getDirectoryName in interface FileWatcherPluginMBeanFileWatcherPluginMBean.getDirectoryName()public void setDirectoryName(java.lang.String directoryName)
setDirectoryName in interface FileWatcherPluginMBeandirectoryName - The directoryName to set.FileWatcherPluginMBean.setDirectoryName(java.lang.String)public java.lang.String getFileFilter()
getFileFilter in interface FileWatcherPluginMBeanFileWatcherPluginMBean.getFileFilter()public void setFileFilter(java.lang.String fileFilter)
setFileFilter in interface FileWatcherPluginMBeanfileFilter - The fileFilter to set.FileWatcherPluginMBean.setFileFilter(java.lang.String)public java.lang.String getFilterType()
getFilterType in interface FileWatcherPluginMBeanFileWatcherPluginMBean.getFilterType()public void setFilterType(java.lang.String filterType)
setFilterType in interface FileWatcherPluginMBeanfilterType - The filterType to set.FileWatcherPluginMBean.setFilterType(java.lang.String)public long getMaximumFileSize()
getMaximumFileSize in interface FileWatcherPluginMBeanFileWatcherPluginMBean.getMaximumFileSize()public void setMaximumFileSize(long maximumFileSize)
setMaximumFileSize in interface FileWatcherPluginMBeanmaximumFileSize - The maximumFileSize to set.FileWatcherPluginMBean.setMaximumFileSize(long)public long getPollInterval()
getPollInterval in interface FileWatcherPluginMBeanFileWatcherPluginMBean.getPollInterval()public void setPollInterval(long pollInterval)
setPollInterval in interface FileWatcherPluginMBeanpollInterval - The pollInterval to set.FileWatcherPluginMBean.setPollInterval(long)
public void activate()
throws java.lang.Exception
I_AdminService
activate in interface I_AdminServicejava.lang.ExceptionI_AdminService.activate()public void deActivate()
I_AdminService
deActivate in interface I_AdminServiceI_AdminService.deActivate()public boolean isActive()
I_AdminService
isActive in interface I_AdminServiceI_AdminService.isActive()public boolean isCopyOnMove()
isCopyOnMove in interface FileWatcherPluginMBeanFileWatcherPluginMBean.isCopyOnMove()public void setCopyOnMove(boolean copyOnMove)
setCopyOnMove in interface FileWatcherPluginMBeancopyOnMove - The copyOnMove to set.FileWatcherPluginMBean.setCopyOnMove(boolean)public long getDelaySinceLastFileChange()
getDelaySinceLastFileChange in interface FileWatcherPluginMBeanFileWatcherPluginMBean.getDelaySinceLastFileChange()public void setDelaySinceLastFileChange(long delaySinceLastFileChange)
setDelaySinceLastFileChange in interface FileWatcherPluginMBeandelaySinceLastFileChange - The delaySinceLastFileChange to set.FileWatcherPluginMBean.setDelaySinceLastFileChange(long)public java.lang.String getDiscarded()
getDiscarded in interface FileWatcherPluginMBeanFileWatcherPluginMBean.getDiscarded()public void setDiscarded(java.lang.String discarded)
setDiscarded in interface FileWatcherPluginMBeandiscarded - The discarded to set.FileWatcherPluginMBean.setDiscarded(java.lang.String)public java.lang.String getLockExtention()
getLockExtention in interface FileWatcherPluginMBeanFileWatcherPluginMBean.getLockExtention()public void setLockExtention(java.lang.String lockExtention)
setLockExtention in interface FileWatcherPluginMBeanlockExtention - The lockExtention to set.FileWatcherPluginMBean.setLockExtention(java.lang.String)public java.lang.String getSent()
getSent in interface FileWatcherPluginMBeanFileWatcherPluginMBean.getSent()public void setSent(java.lang.String sent)
setSent in interface FileWatcherPluginMBeansent - The sent to set.FileWatcherPluginMBean.setSent(java.lang.String)public boolean isShutdown()
I_AdminPlugin
isShutdown in interface I_AdminPluginI_AdminPlugin.isShutdown()public java.lang.String usage()
usage in interface I_AdminUsageI_AdminUsage.usage()public java.lang.String getUsageUrl()
getUsageUrl in interface I_AdminUsageI_AdminUsage.getUsageUrl()public void setUsageUrl(java.lang.String url)
setUsageUrl in interface I_AdminUsageI_AdminUsage.setUsageUrl(java.lang.String)public void setRecursive(boolean rec)
setRecursive in interface FileWatcherPluginMBeanpublic boolean isRecursive()
isRecursive in interface FileWatcherPluginMBeanpublic 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 | |||||||||