org.mule.api.transport
Interface Connector

All Superinterfaces:
Connectable, Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, NameableObject, NamedObject, Startable, Stoppable
All Known Implementing Classes:
AbstractConnector, AbstractJndiConnector, AbstractMailConnector, AbstractRetrieveMailConnector, AbstractTlsRetrieveMailConnector, ActiveMQJmsConnector, ActiveMQXAJmsConnector, AjaxConnector, AjaxServletConnector, AxisConnector, AxisWsdlConnector, EjbConnector, FileConnector, FtpConnector, GmailSmtpConnector, HttpConnector, HttpPollingConnector, HttpsConnector, HttpsPollingConnector, ImapConnector, ImapsConnector, JdbcConnector, JettyHttpConnector, JettyHttpsConnector, JmsConnector, JnpConnector, MessageProcessorPollingConnector, MuleMQJmsConnector, MuleMQXAJmsConnector, MulticastConnector, NullConnector, PollingTcpConnector, Pop3Connector, Pop3sConnector, PromptStdioConnector, QuartzConnector, RmiConnector, ServletConnector, SftpConnector, SmtpConnector, SmtpsConnector, SslConnector, StdioConnector, TcpConnector, TlsConnector, UdpConnector, VMConnector, WeblogicJmsConnector, WebsphereJmsConnector, XmppConnector

public interface Connector
extends Lifecycle, NameableObject, Connectable, LifecycleStateEnabled

Connector is the mechanism used to connect to external systems and protocols in order to send and receive data.


Field Summary
static int INT_VALUE_NOT_SET
           
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Method Summary
 AbstractRedeliveryPolicy createDefaultRedeliveryPolicy(int maxRedelivery)
           
 MuleMessageFactory createMuleMessageFactory()
          Creates a new MuleMessageFactory using what's defined in the connector's transport service descriptor.
 MessageExchangePattern getDefaultExchangePattern()
           
 MessageDispatcherFactory getDispatcherFactory()
          The dispatcher factory is used to create a message dispatcher of the current request
 List<MessageExchangePattern> getInboundExchangePatterns()
           
 MuleContext getMuleContext()
           
 List<MessageExchangePattern> getOutboundExchangePatterns()
           
 OutputStream getOutputStream(OutboundEndpoint endpoint, MuleEvent event)
          Will get the output stream for this type of transport.
 String getProtocol()
           
 MessageRequesterFactory getRequesterFactory()
          The requester factory is used to create a message requester of the current request
 RetryPolicyTemplate getRetryPolicyTemplate()
           
 SessionHandler getSessionHandler()
           
 boolean isConnected()
          Determines if this object is connected or not
 boolean isDisposed()
           
 boolean isResponseEnabled()
           
 boolean isStarted()
           
 void registerListener(InboundEndpoint endpoint, MessageProcessor listener, FlowConstruct flowConstruct)
          Registers a MessageProcessor listener which will listen to new message received from a specific transport channel and then processed by the endpoint.
 MuleMessage request(InboundEndpoint endpoint, long timeout)
          Make a specific request to the underlying transport
 MuleMessage request(String uri, long timeout)
          Deprecated. Use request(ImmutableEndpoint endpoint, long timeout)
 void setDispatcherFactory(MessageDispatcherFactory factory)
          The dispatcher factory is used to create a message dispatcher of the current request
 void setRequesterFactory(MessageRequesterFactory factory)
          The requester factory is used to create a message requester of the current request
 boolean supportsProtocol(String protocol)
           
 void unregisterListener(InboundEndpoint endpoint, FlowConstruct flowConstruct)
          Unregisters the listener for the given endpoints.
 
Methods inherited from interface org.mule.api.NameableObject
setName
 
Methods inherited from interface org.mule.api.NamedObject
getName
 
Methods inherited from interface org.mule.api.transport.Connectable
connect, disconnect, getConnectionDescription, validateConnection
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.api.lifecycle.LifecycleStateEnabled
getLifecycleState
 

Field Detail

INT_VALUE_NOT_SET

static final int INT_VALUE_NOT_SET
See Also:
Constant Field Values
Method Detail

registerListener

void registerListener(InboundEndpoint endpoint,
                      MessageProcessor listener,
                      FlowConstruct flowConstruct)
                      throws Exception
Registers a MessageProcessor listener which will listen to new message received from a specific transport channel and then processed by the endpoint. Only a single listener can be registered for a given endpoints. Attempts to register a listener when one is already registered will fail.

Parameters:
endpoint - defines both the transport and channel/resource uri as well the processing (transformation/filtering) that should occur when the endpoint processes a new message from the transport receiver.
listener - the listener that will be invoked when messages are received on the endpoint.
flowConstruct - reference to the flow construct that the listener is part of for use as context for logging, notifications and error handling.
Throws:
Exception

unregisterListener

void unregisterListener(InboundEndpoint endpoint,
                        FlowConstruct flowConstruct)
                        throws Exception
Unregisters the listener for the given endpoints. This will mean that the listener that was registered for this endpoint will no longer receive any messages.

Throws:
Exception

isStarted

boolean isStarted()
Returns:
true if the endpoint is started

isConnected

boolean isConnected()
Description copied from interface: Connectable
Determines if this object is connected or not

Specified by:
isConnected in interface Connectable

isDisposed

boolean isDisposed()
Returns:
false if the connector is alive and well or true if the connector is being destroyed

createMuleMessageFactory

MuleMessageFactory createMuleMessageFactory()
                                            throws CreateException
Creates a new MuleMessageFactory using what's defined in the connector's transport service descriptor.

Throws:
CreateException

getProtocol

String getProtocol()
Returns:
the primary protocol name for endpoints of this connector

supportsProtocol

boolean supportsProtocol(String protocol)
Returns:
true if the protocol is supported by this connector.

setDispatcherFactory

void setDispatcherFactory(MessageDispatcherFactory factory)
The dispatcher factory is used to create a message dispatcher of the current request

Parameters:
factory - the factory to use when a dispatcher request is madr

getDispatcherFactory

MessageDispatcherFactory getDispatcherFactory()
The dispatcher factory is used to create a message dispatcher of the current request

Returns:
the factory to use when a dispatcher request is madr

setRequesterFactory

void setRequesterFactory(MessageRequesterFactory factory)
The requester factory is used to create a message requester of the current request

Parameters:
factory - the factory to use when a request is made

getRequesterFactory

MessageRequesterFactory getRequesterFactory()
The requester factory is used to create a message requester of the current request

Returns:
the factory to use when a request is made

isResponseEnabled

boolean isResponseEnabled()

request

@Deprecated
MuleMessage request(String uri,
                               long timeout)
                    throws Exception
Deprecated. Use request(ImmutableEndpoint endpoint, long timeout)

Make a specific request to the underlying transport

Parameters:
uri - the endpoint uri to use when connecting to the resource
timeout - the maximum time the operation should block before returning. The call should return immediately if there is data available. If no data becomes available before the timeout elapses, null will be returned
Returns:
the result of the request wrapped in a MuleMessage object. Null will be returned if no data was avaialable
Throws:
Exception - if the call to the underlying protocal cuases an exception

request

MuleMessage request(InboundEndpoint endpoint,
                    long timeout)
                    throws Exception
Make a specific request to the underlying transport

Parameters:
endpoint - the endpoint to use when connecting to the resource
timeout - the maximum time the operation should block before returning. The call should return immediately if there is data available. If no data becomes available before the timeout elapses, null will be returned
Returns:
the result of the request wrapped in a MuleMessage object. Null will be returned if no data was avaialable
Throws:
Exception - if the call to the underlying protocal cuases an exception

getOutputStream

OutputStream getOutputStream(OutboundEndpoint endpoint,
                             MuleEvent event)
                             throws MuleException
Will get the output stream for this type of transport. Typically this will be called only when Streaming is being used on an outbound endpoint. If Streaming is not supported by this transport an UnsupportedOperationException is thrown. Note that the stream MUST release resources on close. For help doing so, see CallbackOutputStream.

Parameters:
endpoint - the endpoint that releates to this Dispatcher
event - the current event being processed
Returns:
the output stream to use for this request
Throws:
MuleException

getMuleContext

MuleContext getMuleContext()

getRetryPolicyTemplate

RetryPolicyTemplate getRetryPolicyTemplate()

getDefaultExchangePattern

MessageExchangePattern getDefaultExchangePattern()
Returns:
the default MessageExchangePattern as configured in the transport's service descriptor.

getInboundExchangePatterns

List<MessageExchangePattern> getInboundExchangePatterns()
Returns:
List of exchange patterns that this connector supports for inbound endpoints.

getOutboundExchangePatterns

List<MessageExchangePattern> getOutboundExchangePatterns()
Returns:
List of exchange patterns that this connector supports for outbound endpoints.

getSessionHandler

SessionHandler getSessionHandler()
Returns:
The strategy used for reading and writing session information to and from the transport.

createDefaultRedeliveryPolicy

AbstractRedeliveryPolicy createDefaultRedeliveryPolicy(int maxRedelivery)
Parameters:
maxRedelivery - times to try message redelivery
Returns:
AbstractRedeliveryPolicy to use for message redelivery, null if it shouldn't be used


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.