public abstract class GenericFileProcessStrategySupport<T> extends org.apache.camel.support.service.ServiceSupport implements GenericFileProcessStrategy<T>, org.apache.camel.CamelContextAware
GenericFileProcessStrategy
.Modifier and Type | Field and Description |
---|---|
protected org.apache.camel.CamelContext |
camelContext |
protected GenericFileExclusiveReadLockStrategy<T> |
exclusiveReadLockStrategy |
Constructor and Description |
---|
GenericFileProcessStrategySupport() |
Modifier and Type | Method and Description |
---|---|
void |
abort(GenericFileOperations<T> operations,
GenericFileEndpoint<T> endpoint,
org.apache.camel.Exchange exchange,
GenericFile<T> file)
Called when a begin is aborted, for example to release any resources which may have been acquired during the
GenericFileProcessStrategy.begin(GenericFileOperations, GenericFileEndpoint, org.apache.camel.Exchange, GenericFile) operation. |
boolean |
begin(GenericFileOperations<T> operations,
GenericFileEndpoint<T> endpoint,
org.apache.camel.Exchange exchange,
GenericFile<T> file)
Called when work is about to begin on this file.
|
void |
commit(GenericFileOperations<T> operations,
GenericFileEndpoint<T> endpoint,
org.apache.camel.Exchange exchange,
GenericFile<T> file)
Releases any file locks and possibly deletes or moves the file after successful processing
|
protected void |
deleteLocalWorkFile(org.apache.camel.Exchange exchange) |
protected void |
doShutdown() |
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
GenericFileExclusiveReadLockStrategy<T> |
getExclusiveReadLockStrategy() |
void |
prepareOnStartup(GenericFileOperations<T> operations,
GenericFileEndpoint<T> endpoint)
Allows custom logic to be run on first poll preparing the strategy, such as removing old lock files etc.
|
protected GenericFile<T> |
renameFile(GenericFileOperations<T> operations,
GenericFile<T> from,
GenericFile<T> to) |
void |
rollback(GenericFileOperations<T> operations,
GenericFileEndpoint<T> endpoint,
org.apache.camel.Exchange exchange,
GenericFile<T> file)
Releases any file locks and possibly deletes or moves the file after unsuccessful processing
|
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setExclusiveReadLockStrategy(GenericFileExclusiveReadLockStrategy<T> exclusiveReadLockStrategy) |
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected GenericFileExclusiveReadLockStrategy<T> exclusiveReadLockStrategy
protected org.apache.camel.CamelContext camelContext
public org.apache.camel.CamelContext getCamelContext()
getCamelContext
in interface org.apache.camel.CamelContextAware
public void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext
in interface org.apache.camel.CamelContextAware
public void prepareOnStartup(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint) throws Exception
GenericFileProcessStrategy
prepareOnStartup
in interface GenericFileProcessStrategy<T>
operations
- file operationsendpoint
- the endpointException
- can be thrown in case of errors which causes poll to failpublic boolean begin(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) throws Exception
GenericFileProcessStrategy
begin
in interface GenericFileProcessStrategy<T>
operations
- file operationsendpoint
- the endpointexchange
- the exchangefile
- the fileException
- can be thrown in case of errorspublic void abort(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) throws Exception
GenericFileProcessStrategy
GenericFileProcessStrategy.begin(GenericFileOperations, GenericFileEndpoint, org.apache.camel.Exchange, GenericFile)
operation.abort
in interface GenericFileProcessStrategy<T>
operations
- file operationsendpoint
- the endpointexchange
- the exchangefile
- the fileException
- can be thrown in case of errorspublic void commit(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) throws Exception
GenericFileProcessStrategy
commit
in interface GenericFileProcessStrategy<T>
operations
- file operationsendpoint
- the endpointexchange
- the exchangefile
- the fileException
- can be thrown in case of errorspublic void rollback(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) throws Exception
GenericFileProcessStrategy
rollback
in interface GenericFileProcessStrategy<T>
operations
- file operationsendpoint
- the endpointexchange
- the exchangefile
- the fileException
- can be thrown in case of errorspublic GenericFileExclusiveReadLockStrategy<T> getExclusiveReadLockStrategy()
public void setExclusiveReadLockStrategy(GenericFileExclusiveReadLockStrategy<T> exclusiveReadLockStrategy)
protected GenericFile<T> renameFile(GenericFileOperations<T> operations, GenericFile<T> from, GenericFile<T> to)
protected void deleteLocalWorkFile(org.apache.camel.Exchange exchange)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.service.BaseService
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.support.service.BaseService
Exception
Apache Camel