org.apache.camel.component.file.remote
Class RemoteFileProducer<T>

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultProducer
          extended by org.apache.camel.component.file.GenericFileProducer<T>
              extended by org.apache.camel.component.file.remote.RemoteFileProducer<T>
All Implemented Interfaces:
IsSingleton, Processor, Producer, Service, ServicePoolAware

public class RemoteFileProducer<T>
extends GenericFileProducer<T>
implements ServicePoolAware

Remote file producer. Handles connecting and disconnecting if we are not. Generic type F is the remote system implementation of a file.


Field Summary
 
Fields inherited from class org.apache.camel.component.file.GenericFileProducer
endpoint, log, operations
 
Constructor Summary
protected RemoteFileProducer(RemoteFileEndpoint<T> endpoint, RemoteFileOperations<T> operations)
           
 
Method Summary
protected  void connectIfNecessary()
           
 void disconnect()
           
protected  void doStart()
           
protected  void doStop()
           
protected  String getFileSeparator()
           
protected  void handleFailedWrite(GenericFileExchange<T> exchange, Exception exception)
          The file could not be written.
 boolean isSingleton()
           
protected  String normalizePath(String name)
           
protected  void preWriteCheck()
           
 void process(Exchange exchange)
           
 
Methods inherited from class org.apache.camel.component.file.GenericFileProducer
createFileName, createTempFileName, processExchange, writeFile
 
Methods inherited from class org.apache.camel.impl.DefaultProducer
createExchange, createExchange, createExchange, getEndpoint, toString
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

RemoteFileProducer

protected RemoteFileProducer(RemoteFileEndpoint<T> endpoint,
                             RemoteFileOperations<T> operations)
Method Detail

getFileSeparator

protected String getFileSeparator()
Overrides:
getFileSeparator in class GenericFileProducer<T>

normalizePath

protected String normalizePath(String name)
Overrides:
normalizePath in class GenericFileProducer<T>

process

public void process(Exchange exchange)
             throws Exception
Specified by:
process in interface Processor
Overrides:
process in class GenericFileProducer<T>
Throws:
Exception

handleFailedWrite

protected void handleFailedWrite(GenericFileExchange<T> exchange,
                                 Exception exception)
                          throws Exception
The file could not be written. We need to disconnect from the remote server.

Overrides:
handleFailedWrite in class GenericFileProducer<T>
Throws:
Exception

disconnect

public void disconnect()
                throws IOException
Throws:
IOException

preWriteCheck

protected void preWriteCheck()
                      throws Exception
Overrides:
preWriteCheck in class GenericFileProducer<T>
Throws:
Exception

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class DefaultProducer
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class DefaultProducer
Throws:
Exception

connectIfNecessary

protected void connectIfNecessary()
                           throws IOException
Throws:
IOException

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface IsSingleton
Overrides:
isSingleton in class DefaultProducer


Copyright © 2009 Apache Software Foundation. All Rights Reserved.