Package com.adaptris.interlok.nats
Class NatsConnection
- java.lang.Object
-
- com.adaptris.core.AdaptrisConnectionImp
-
- com.adaptris.core.AllowsRetriesConnection
-
- com.adaptris.interlok.nats.NatsConnection
-
- All Implemented Interfaces:
AdaptrisComponent,AdaptrisConnection,ComponentLifecycle,ComponentLifecycleExtension,StateManagedComponent
- Direct Known Subclasses:
BasicNatsConnection,NatsConnectionFromProperties
public abstract class NatsConnection extends AllowsRetriesConnection
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log
-
-
Constructor Summary
Constructors Constructor Description NatsConnection()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description io.nats.client.ConnectionclientConnection()voidclose(io.nats.client.Dispatcher dispatcher)protected voidcloseConnection()protected abstract io.nats.client.Connectionconnect()protected abstract java.lang.StringconnectionName()io.nats.client.DispatchercreateDispatcher(io.nats.client.MessageHandler handler)protected <T extends java.lang.Exception>
voidexceedsMaxAttempts(int attemptCount, T e)protected voidinitConnection()protected voidprepareConnection()protected voidstartConnection()protected voidstopConnection()<T extends NatsConnection>
TwithConnectionRetries(int i, TimeInterval t)-
Methods inherited from class com.adaptris.core.AllowsRetriesConnection
connectionAttempts, connectionRetryInterval, createLoggingStatement, getConnectionAttempts, getConnectionRetryInterval, logWarning, setConnectionAttempts, setConnectionRetryInterval
-
Methods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
-
-
-
Method Detail
-
prepareConnection
protected void prepareConnection() throws CoreException- Specified by:
prepareConnectionin classAdaptrisConnectionImp- Throws:
CoreException
-
initConnection
protected void initConnection() throws CoreException- Specified by:
initConnectionin classAdaptrisConnectionImp- Throws:
CoreException
-
startConnection
protected void startConnection() throws CoreException- Specified by:
startConnectionin classAdaptrisConnectionImp- Throws:
CoreException
-
stopConnection
protected void stopConnection()
- Specified by:
stopConnectionin classAdaptrisConnectionImp
-
closeConnection
protected void closeConnection()
- Specified by:
closeConnectionin classAdaptrisConnectionImp
-
clientConnection
public io.nats.client.Connection clientConnection() throws java.lang.Exception- Throws:
java.lang.Exception
-
createDispatcher
public io.nats.client.Dispatcher createDispatcher(io.nats.client.MessageHandler handler) throws java.lang.Exception- Throws:
java.lang.Exception
-
close
public void close(io.nats.client.Dispatcher dispatcher)
-
connect
protected abstract io.nats.client.Connection connect() throws java.lang.Exception- Throws:
java.lang.Exception
-
connectionName
protected abstract java.lang.String connectionName()
-
exceedsMaxAttempts
protected <T extends java.lang.Exception> void exceedsMaxAttempts(int attemptCount, T e) throws T extends java.lang.Exception- Throws:
T extends java.lang.Exception
-
withConnectionRetries
public <T extends NatsConnection> T withConnectionRetries(int i, TimeInterval t)
-
-