|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.transport.AbstractConnectable
public abstract class AbstractConnectable
Provide a default dispatch (client) support for handling threads lifecycle and validation.
| Field Summary | |
|---|---|
protected WaitableBoolean |
connected
|
protected AbstractConnector |
connector
|
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
disposed
|
protected ImmutableEndpoint |
endpoint
|
protected Log |
logger
|
protected RetryPolicyTemplate |
retryTemplate
|
protected WaitableBoolean |
started
|
protected boolean |
startOnConnect
Indicates whether the receiver/dispatcher/requester should start upon connecting. |
| Fields inherited from interface org.mule.api.lifecycle.Initialisable |
|---|
PHASE_NAME |
| Fields inherited from interface org.mule.api.lifecycle.Disposable |
|---|
PHASE_NAME |
| Fields inherited from interface org.mule.api.lifecycle.Startable |
|---|
PHASE_NAME |
| Fields inherited from interface org.mule.api.lifecycle.Stoppable |
|---|
PHASE_NAME |
| 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 void |
doConnect()
|
protected void |
doDisconnect()
|
protected void |
doDispose()
|
protected void |
doInitialise()
|
protected void |
doStart()
|
protected void |
doStop()
|
void |
exceptionThrown(Exception e)
|
protected String |
getConnectEventId(ImmutableEndpoint endpoint)
|
String |
getConnectionDescription()
Returns a string identifying the underlying resource |
Connector |
getConnector()
|
ImmutableEndpoint |
getEndpoint()
|
protected abstract WorkManager |
getWorkManager()
|
void |
handleException(Exception exception)
|
void |
initialise()
Method used to perform any initialisation work. |
boolean |
isConnected()
Determines if this object is connected or not |
protected boolean |
isDoThreading()
|
boolean |
isStarted()
|
void |
passivate()
|
void |
setEndpoint(ImmutableEndpoint endpoint)
|
void |
start()
|
void |
stop()
|
String |
toString()
|
boolean |
validate()
|
RetryContext |
validateConnection(RetryContext retryContext)
Test whether the connector is able to connect to its resource(s). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient Log logger
protected ImmutableEndpoint endpoint
protected final AbstractConnector connector
protected RetryPolicyTemplate retryTemplate
protected final WaitableBoolean connected
protected final WaitableBoolean started
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean disposed
protected boolean startOnConnect
| Constructor Detail |
|---|
public AbstractConnectable(ImmutableEndpoint endpoint)
| Method Detail |
|---|
protected void disposeAndLogException()
public void exceptionThrown(Exception e)
exceptionThrown in interface ExceptionListenerpublic void handleException(Exception exception)
public boolean validate()
public void activate()
public void passivate()
public void initialise()
throws InitialisationException
InitialisableInitialisationException should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.
initialise in interface InitialisableInitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered frompublic void dispose()
dispose in interface Disposablepublic Connector getConnector()
public ImmutableEndpoint getEndpoint()
public final void connect()
throws Exception
Connectable
connect in interface ConnectableExceptionpublic RetryContext validateConnection(RetryContext retryContext)
ConnectableRetryContext.setOk() when no problems found (or no validation required).
RetryContext.setFailed(Throwable) with a root cause for a connection failure.
RetryContext.isOk(). The failure, if any, will be
provided via the RetryContext.getLastFailure().
validateConnection in interface Connectable
public final void disconnect()
throws Exception
Connectable
disconnect in interface ConnectableExceptionprotected String getConnectEventId(ImmutableEndpoint endpoint)
public final boolean isConnected()
Connectable
isConnected in interface Connectableprotected boolean isDoThreading()
public String getConnectionDescription()
getConnectionDescription in interface Connectable
public final void start()
throws MuleException
start in interface StartableMuleExceptionpublic final void stop()
stop in interface Stoppable
protected void doInitialise()
throws InitialisationException
InitialisationExceptionprotected void doDispose()
protected void doConnect()
throws Exception
Exception
protected void doDisconnect()
throws Exception
Exception
protected void doStart()
throws MuleException
MuleException
protected void doStop()
throws MuleException
MuleExceptionpublic String toString()
toString in class Objectpublic void setEndpoint(ImmutableEndpoint endpoint)
protected abstract WorkManager getWorkManager()
public boolean isStarted()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||