org.apache.servicemix.truezip
Class TrueZipPollerEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.Endpoint
      extended by org.apache.servicemix.common.endpoints.SimpleEndpoint
          extended by org.apache.servicemix.common.endpoints.ConsumerEndpoint
              extended by org.apache.servicemix.common.endpoints.PollingEndpoint
                  extended by org.apache.servicemix.truezip.TrueZipPollerEndpoint
All Implemented Interfaces:
org.apache.servicemix.common.ExchangeProcessor, TrueZipEndpointType

public class TrueZipPollerEndpoint
extends org.apache.servicemix.common.endpoints.PollingEndpoint
implements TrueZipEndpointType

A polling endpoint which looks for a file or files in a directory and sends the files into the JBI bus as messages, deleting the files by default when they are processed.

Version:
$Revision: 10252 $

Field Summary
 
Fields inherited from class org.apache.servicemix.common.Endpoint
definition, description, endpoint, interfaceName, logger, service, serviceUnit
 
Constructor Summary
TrueZipPollerEndpoint()
           
TrueZipPollerEndpoint(org.apache.servicemix.common.DefaultComponent component, javax.jbi.servicedesc.ServiceEndpoint endpoint)
           
TrueZipPollerEndpoint(org.apache.servicemix.common.ServiceUnit serviceUnit, QName service, String endpoint)
           
 
Method Summary
protected  org.apache.servicemix.locks.LockManager createLockManager()
           
 File getFile()
           
 FileFilter getFilter()
           
 String getLocationURI()
           
 org.apache.servicemix.locks.LockManager getLockManager()
           
 org.apache.servicemix.components.util.FileMarshaler getMarshaler()
           
 boolean isAutoCreateDirectory()
           
 boolean isDeleteFile()
          Returns whether or not we should delete the file when its processed
 boolean isRecursive()
           
 void poll()
           
protected  void pollFile(de.schlichtherle.io.File aFile)
           
protected  void pollFileOrDirectory(de.schlichtherle.io.File fileOrDirectory)
           
protected  void pollFileOrDirectory(de.schlichtherle.io.File fileOrDirectory, boolean processDir)
           
 void process(javax.jbi.messaging.MessageExchange exchange)
           
protected  void processFile(de.schlichtherle.io.File aFile)
           
protected  void processFileAndDelete(de.schlichtherle.io.File aFile)
           
 void setAutoCreateDirectory(boolean autoCreateDirectory)
           
 void setDeleteFile(boolean deleteFile)
           
 void setFile(File file)
          Sets the file to poll, which can be a directory or a file.
 void setFilter(FileFilter filter)
          Sets the optional filter to choose which files to process
 void setLockManager(org.apache.servicemix.locks.LockManager lockManager)
           
 void setMarshaler(org.apache.servicemix.components.util.FileMarshaler marshaler)
           
 void setRecursive(boolean recursive)
           
 void validate()
           
 
Methods inherited from class org.apache.servicemix.common.endpoints.PollingEndpoint
getDelay, getExecutor, getFirstTime, getPeriod, getScheduler, handlePollException, setDelay, setFirstTime, setPeriod, setScheduler, start, stop
 
Methods inherited from class org.apache.servicemix.common.endpoints.ConsumerEndpoint
configureExchangeTarget, getRole, getTargetEndpoint, getTargetInterface, getTargetService, getTargetUri, setTargetEndpoint, setTargetInterface, setTargetService, setTargetUri
 
Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
activate, deactivate, done, fail, getChannel, getContext, getExchangeFactory, getProcessor, send, sendSync
 
Methods inherited from class org.apache.servicemix.common.Endpoint
getDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrueZipPollerEndpoint

public TrueZipPollerEndpoint()

TrueZipPollerEndpoint

public TrueZipPollerEndpoint(org.apache.servicemix.common.ServiceUnit serviceUnit,
                             QName service,
                             String endpoint)

TrueZipPollerEndpoint

public TrueZipPollerEndpoint(org.apache.servicemix.common.DefaultComponent component,
                             javax.jbi.servicedesc.ServiceEndpoint endpoint)
Method Detail

poll

public void poll()
          throws Exception
Specified by:
poll in class org.apache.servicemix.common.endpoints.PollingEndpoint
Throws:
Exception

validate

public void validate()
              throws javax.jbi.management.DeploymentException
Overrides:
validate in class org.apache.servicemix.common.endpoints.ConsumerEndpoint
Throws:
javax.jbi.management.DeploymentException

createLockManager

protected org.apache.servicemix.locks.LockManager createLockManager()

getFile

public File getFile()

setFile

public void setFile(File file)
Sets the file to poll, which can be a directory or a file.

Parameters:
file -

getLockManager

public org.apache.servicemix.locks.LockManager getLockManager()
Returns:
the lockManager

setLockManager

public void setLockManager(org.apache.servicemix.locks.LockManager lockManager)
Parameters:
lockManager - the lockManager to set

getFilter

public FileFilter getFilter()

setFilter

public void setFilter(FileFilter filter)
Sets the optional filter to choose which files to process


isDeleteFile

public boolean isDeleteFile()
Returns whether or not we should delete the file when its processed


setDeleteFile

public void setDeleteFile(boolean deleteFile)

isRecursive

public boolean isRecursive()

setRecursive

public void setRecursive(boolean recursive)

isAutoCreateDirectory

public boolean isAutoCreateDirectory()

setAutoCreateDirectory

public void setAutoCreateDirectory(boolean autoCreateDirectory)

getMarshaler

public org.apache.servicemix.components.util.FileMarshaler getMarshaler()

setMarshaler

public void setMarshaler(org.apache.servicemix.components.util.FileMarshaler marshaler)

pollFileOrDirectory

protected void pollFileOrDirectory(de.schlichtherle.io.File fileOrDirectory)

pollFileOrDirectory

protected void pollFileOrDirectory(de.schlichtherle.io.File fileOrDirectory,
                                   boolean processDir)

pollFile

protected void pollFile(de.schlichtherle.io.File aFile)

processFileAndDelete

protected void processFileAndDelete(de.schlichtherle.io.File aFile)

processFile

protected void processFile(de.schlichtherle.io.File aFile)
                    throws Exception
Throws:
Exception

getLocationURI

public String getLocationURI()
Specified by:
getLocationURI in class org.apache.servicemix.common.endpoints.ConsumerEndpoint

process

public void process(javax.jbi.messaging.MessageExchange exchange)
             throws Exception
Specified by:
process in interface org.apache.servicemix.common.ExchangeProcessor
Throws:
Exception


Copyright © 2005-2007. All Rights Reserved.