org.apache.servicemix.truezip
Class TrueZipPollerEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.endpoints.AbstractEndpoint
      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:
Endpoint, TrueZipEndpointType

public class TrueZipPollerEndpoint
extends 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: 69300 $

Field Summary
 
Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
definition, description, endpoint, interfaceName, logger, service, serviceUnit
 
Constructor Summary
TrueZipPollerEndpoint()
           
TrueZipPollerEndpoint(DefaultComponent component, javax.jbi.servicedesc.ServiceEndpoint endpoint)
           
TrueZipPollerEndpoint(ServiceUnit serviceUnit, QName service, String endpoint)
           
 
Method Summary
protected  LockManager createLockManager()
           
 File getFile()
           
 FileFilter getFilter()
           
 String getLocationURI()
           
 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(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, isConcurrentPolling, setConcurrentPolling, setDelay, setFirstTime, setPeriod, setScheduler, start, stop
 
Methods inherited from class org.apache.servicemix.common.endpoints.ConsumerEndpoint
activate, configureExchangeTarget, deactivate, getRole, getTargetEndpoint, getTargetInterface, getTargetOperation, getTargetService, getTargetUri, setTargetEndpoint, setTargetInterface, setTargetOperation, setTargetService, setTargetUri
 
Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
done, fail, getChannel, getContext, getExchangeFactory, send, sendSync
 
Methods inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
getDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, 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(ServiceUnit serviceUnit,
                             QName service,
                             String endpoint)

TrueZipPollerEndpoint

public TrueZipPollerEndpoint(DefaultComponent component,
                             javax.jbi.servicedesc.ServiceEndpoint endpoint)
Method Detail

poll

public void poll()
          throws Exception
Specified by:
poll in class PollingEndpoint
Throws:
Exception

validate

public void validate()
              throws javax.jbi.management.DeploymentException
Specified by:
validate in interface Endpoint
Overrides:
validate in class ConsumerEndpoint
Throws:
javax.jbi.management.DeploymentException

createLockManager

protected 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 LockManager getLockManager()
Returns:
the lockManager

setLockManager

public void setLockManager(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()
Overrides:
getLocationURI in class ConsumerEndpoint

process

public void process(javax.jbi.messaging.MessageExchange exchange)
             throws Exception
Specified by:
process in interface Endpoint
Specified by:
process in class AbstractEndpoint
Throws:
Exception


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.