|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.transport.AbstractConnector
org.mule.transport.file.FileConnector
public class FileConnector
FileConnector is used for setting up listeners on a directory and
for writing files to a directory. The connecotry provides support for defining
file output patterns and filters for receiving files.
| Field Summary | |
|---|---|
static long |
DEFAULT_POLLING_FREQUENCY
|
static String |
FILE
|
FilenameParser |
filenameParser
|
static String |
PROPERTY_DIRECTORY
|
static String |
PROPERTY_FILE_AGE
|
static String |
PROPERTY_FILE_SIZE
|
static String |
PROPERTY_FILE_TIMESTAMP
|
static String |
PROPERTY_FILENAME
|
static String |
PROPERTY_MOVE_TO_DIRECTORY
|
static String |
PROPERTY_MOVE_TO_PATTERN
|
static String |
PROPERTY_ORIGINAL_FILENAME
|
static String |
PROPERTY_OUTPUT_PATTERN
|
static String |
PROPERTY_POLLING_FREQUENCY
|
static String |
PROPERTY_READ_FROM_DIRECTORY
|
static String |
PROPERTY_WRITE_TO_DIRECTORY
|
| Fields inherited from class org.mule.transport.AbstractConnector |
|---|
connected, createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatchers, disposed, exceptionListener, initialised, initialStateStopped, muleContext, name, numberOfConcurrentTransactedReceivers, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, started, startOnConnect |
| Fields inherited from interface org.mule.api.transport.Connector |
|---|
INT_VALUE_NOT_SET |
| Fields inherited from interface org.mule.api.lifecycle.Initialisable |
|---|
PHASE_NAME |
| Fields inherited from interface org.mule.api.lifecycle.Startable |
|---|
PHASE_NAME |
| Fields inherited from interface org.mule.api.lifecycle.Stoppable |
|---|
PHASE_NAME |
| Fields inherited from interface org.mule.api.lifecycle.Disposable |
|---|
PHASE_NAME |
| Constructor Summary | |
|---|---|
FileConnector()
|
|
| Method Summary | |
|---|---|
protected void |
configureDispatcherPool()
|
MessageReceiver |
createReceiver(Service service,
InboundEndpoint endpoint)
Registers a listener for a particular directory The following properties can be overriden in the endpoint declaration moveToDirectory filterPatterns filterClass pollingFrequency |
protected void |
doConnect()
Template method where any connections should be made for the connector |
protected void |
doDisconnect()
Template method where any connected resources used by the connector should be disconnected |
protected void |
doDispose()
Template method to perform any work when destroying the connectoe |
protected void |
doInitialise()
|
protected void |
doStart()
Template method to perform any work when starting the connectoe |
protected void |
doStop()
Template method to perform any work when stopping the connectoe |
boolean |
getCheckFileAge()
|
long |
getFileAge()
|
FilenameParser |
getFilenameParser()
|
MessageAdapter |
getMessageAdapter(Object message)
Gets a MessageAdapter for the endpoint for the given message
(data) |
String |
getMoveToDirectory()
|
String |
getMoveToPattern()
|
String |
getOutputPattern()
|
FileOutputStream |
getOutputStream()
|
OutputStream |
getOutputStream(ImmutableEndpoint endpoint,
MuleMessage message)
Well get the output stream (if any) for this type of transport. |
long |
getPollingFrequency()
|
String |
getProtocol()
|
String |
getReadFromDirectory()
|
protected Object |
getReceiverKey(Service service,
InboundEndpoint endpoint)
The method determines the key used to store the receiver against. |
String |
getWorkDirectory()
|
String |
getWorkFileNamePattern()
|
String |
getWriteToDirectory()
|
boolean |
isAutoDelete()
|
boolean |
isOutputAppend()
|
boolean |
isSerialiseObjects()
|
boolean |
isStreaming()
|
void |
setAutoDelete(boolean autoDelete)
|
void |
setFileAge(long fileAge)
|
void |
setFilenameParser(FilenameParser filenameParser)
|
void |
setMaxDispatchersActive(int value)
Configures the maximum number of dispatchers that can be concurrently active per endpoint |
void |
setMoveToDirectory(String dir)
|
void |
setMoveToPattern(String moveToPattern)
|
void |
setMuleContext(MuleContext context)
|
void |
setOutputAppend(boolean outputAppend)
|
void |
setOutputPattern(String outputPattern)
|
void |
setOutputStream(FileOutputStream outputStream)
|
void |
setPollingFrequency(long pollingFrequency)
|
void |
setReadFromDirectory(String dir)
|
void |
setSerialiseObjects(boolean serialiseObjects)
|
void |
setStreaming(boolean streaming)
|
void |
setWorkDirectory(String workDirectoryName)
|
void |
setWorkFileNamePattern(String workFileNamePattern)
|
void |
setWriteToDirectory(String dir)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String FILE
public static final String PROPERTY_POLLING_FREQUENCY
public static final String PROPERTY_FILE_AGE
public static final String PROPERTY_MOVE_TO_PATTERN
public static final String PROPERTY_MOVE_TO_DIRECTORY
public static final String PROPERTY_READ_FROM_DIRECTORY
public static final String PROPERTY_OUTPUT_PATTERN
public static final String PROPERTY_FILENAME
public static final String PROPERTY_ORIGINAL_FILENAME
public static final String PROPERTY_DIRECTORY
public static final String PROPERTY_WRITE_TO_DIRECTORY
public static final String PROPERTY_FILE_SIZE
public static final String PROPERTY_FILE_TIMESTAMP
public static final long DEFAULT_POLLING_FREQUENCY
public FilenameParser filenameParser
| Constructor Detail |
|---|
public FileConnector()
| Method Detail |
|---|
protected void configureDispatcherPool()
configureDispatcherPool in class AbstractConnectorpublic void setMaxDispatchersActive(int value)
AbstractConnector
setMaxDispatchersActive in class AbstractConnectorvalue - max. number of active dispatchers
protected Object getReceiverKey(Service service,
InboundEndpoint endpoint)
AbstractConnector
getReceiverKey in class AbstractConnectorservice - the service for which the endpoint is being registeredendpoint - the endpoint being registered for the service
public MessageReceiver createReceiver(Service service,
InboundEndpoint endpoint)
throws Exception
createReceiver in class AbstractConnectorservice - the service that will receive events from this receiver,
the listenerendpoint - the endpoint that defies this inbound communication
TransportServiceDescriptor
initialised using the service and endpoint.
Exception - if there is a problem creating the receiver. This exception
really depends on the underlying transport, thus any exception
could be thrownpublic String getProtocol()
public FilenameParser getFilenameParser()
public void setFilenameParser(FilenameParser filenameParser)
protected void doDispose()
AbstractConnector
doDispose in class AbstractConnector
protected void doInitialise()
throws InitialisationException
doInitialise in class AbstractConnectorInitialisationException
protected void doConnect()
throws Exception
AbstractConnector
doConnect in class AbstractConnectorException
protected void doDisconnect()
throws Exception
AbstractConnector
doDisconnect in class AbstractConnectorException
protected void doStart()
throws MuleException
AbstractConnector
doStart in class AbstractConnectorMuleException - if the method fails
protected void doStop()
throws MuleException
AbstractConnector
doStop in class AbstractConnectorMuleException - if the method failspublic String getMoveToDirectory()
public void setMoveToDirectory(String dir)
public void setWorkDirectory(String workDirectoryName)
throws IOException
IOExceptionpublic String getWorkDirectory()
public void setWorkFileNamePattern(String workFileNamePattern)
public String getWorkFileNamePattern()
public boolean isOutputAppend()
public void setOutputAppend(boolean outputAppend)
public String getOutputPattern()
public void setOutputPattern(String outputPattern)
public FileOutputStream getOutputStream()
public void setOutputStream(FileOutputStream outputStream)
public long getPollingFrequency()
public void setPollingFrequency(long pollingFrequency)
public long getFileAge()
public boolean getCheckFileAge()
public void setFileAge(long fileAge)
public String getWriteToDirectory()
public void setWriteToDirectory(String dir)
throws IOException
IOExceptionpublic String getReadFromDirectory()
public void setReadFromDirectory(String dir)
throws IOException
IOExceptionpublic boolean isSerialiseObjects()
public void setSerialiseObjects(boolean serialiseObjects)
public boolean isAutoDelete()
public void setAutoDelete(boolean autoDelete)
public String getMoveToPattern()
public void setMoveToPattern(String moveToPattern)
public OutputStream getOutputStream(ImmutableEndpoint endpoint,
MuleMessage message)
throws MuleException
endpoint - the endpoint that releates to this Dispatchermessage - the current message being processed
MuleExceptionpublic boolean isStreaming()
public void setStreaming(boolean streaming)
public MessageAdapter getMessageAdapter(Object message)
throws MuleException
AbstractConnectorMessageAdapter for the endpoint for the given message
(data)
getMessageAdapter in interface ConnectorgetMessageAdapter in class AbstractConnectormessage - the data with which to initialise the
MessageAdapter
MessageAdapter for the endpoint
MessageTypeNotSupportedException - if the message parameter is not supported
MuleException - if there is a problem creating the AdapterMessageAdapterpublic void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwaresetMuleContext in class AbstractConnector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||