org.mule.transport
Class AbstractConnectable

java.lang.Object
  extended by org.mule.transport.AbstractConnectable
All Implemented Interfaces:
ExceptionListener, Connectable
Direct Known Subclasses:
AbstractMessageDispatcher, AbstractMessageRequester

public abstract class AbstractConnectable
extends Object
implements Connectable, ExceptionListener

Provide a default dispatch (client) support for handling threads lifecycle and validation.


Field Summary
protected  boolean connected
           
protected  boolean connecting
           
protected  ConnectionStrategy connectionStrategy
           
protected  AbstractConnector connector
           
protected  boolean disposed
           
protected  ImmutableEndpoint endpoint
           
protected  Log logger
          logger used by this class
 
Constructor Summary
AbstractConnectable(ImmutableEndpoint endpoint)
           
 
Method Summary
 void activate()
           
 void connect()
          Make the connection to the underlying transport.
 void disconnect()
          Disconnect the from the underlying transport
 void dispose()
          Template method to destroy any resources held by the Message Dispatcher
protected  void disposeAndLogException()
           
protected abstract  void doConnect()
           
protected abstract  void doDisconnect()
           
protected abstract  void doDispose()
           
 void exceptionThrown(Exception e)
           
protected  String getConnectEventId(ImmutableEndpoint endpoint)
           
 String getConnectionDescription()
          Returns a string identifying the underlying resource
 Connector getConnector()
           
 ImmutableEndpoint getEndpoint()
           
 boolean isConnected()
          Determines if this object is connected or not
protected  boolean isDoThreading()
           
 void passivate()
           
 void reconnect()
           
 String toString()
           
 boolean validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected transient Log logger
logger used by this class


endpoint

protected final ImmutableEndpoint endpoint

connector

protected final AbstractConnector connector

disposed

protected boolean disposed

connectionStrategy

protected ConnectionStrategy connectionStrategy

connecting

protected volatile boolean connecting

connected

protected volatile boolean connected
Constructor Detail

AbstractConnectable

public AbstractConnectable(ImmutableEndpoint endpoint)
Method Detail

disposeAndLogException

protected void disposeAndLogException()

exceptionThrown

public void exceptionThrown(Exception e)
Specified by:
exceptionThrown in interface ExceptionListener

validate

public boolean validate()

activate

public void activate()

passivate

public void passivate()

dispose

public final void dispose()
Template method to destroy any resources held by the Message Dispatcher


getConnector

public Connector getConnector()

getEndpoint

public ImmutableEndpoint getEndpoint()

connect

public void connect()
             throws Exception
Description copied from interface: Connectable
Make the connection to the underlying transport. The fact that this object is connected or not should have no influence on the lifecycle, especially the start / stop state if applicable.

Specified by:
connect in interface Connectable
Throws:
Exception

disconnect

public void disconnect()
                throws Exception
Description copied from interface: Connectable
Disconnect the from the underlying transport

Specified by:
disconnect in interface Connectable
Throws:
Exception

getConnectEventId

protected String getConnectEventId(ImmutableEndpoint endpoint)

isConnected

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

Specified by:
isConnected in interface Connectable
Returns:

isDoThreading

protected boolean isDoThreading()

getConnectionDescription

public String getConnectionDescription()
Returns a string identifying the underlying resource

Specified by:
getConnectionDescription in interface Connectable
Returns:

reconnect

public void reconnect()
               throws Exception
Throws:
Exception

doDispose

protected abstract void doDispose()

doConnect

protected abstract void doConnect()
                           throws Exception
Throws:
Exception

doDisconnect

protected abstract void doDisconnect()
                              throws Exception
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.