org.fusesource.fabric.dosgi.tcp
Class TransportPool
java.lang.Object
org.fusesource.fabric.dosgi.tcp.TransportPool
- All Implemented Interfaces:
- Service
- Direct Known Subclasses:
- ClientInvokerImpl.InvokerTransportPool
public abstract class TransportPool
- extends java.lang.Object
- implements Service
|
Constructor Summary |
TransportPool(java.lang.String uri,
org.fusesource.hawtdispatch.DispatchQueue queue)
|
TransportPool(java.lang.String uri,
org.fusesource.hawtdispatch.DispatchQueue queue,
int poolSize,
long evictionDelay)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
protected static final org.slf4j.Logger LOGGER
DEFAULT_POOL_SIZE
public static final int DEFAULT_POOL_SIZE
- See Also:
- Constant Field Values
DEFAULT_EVICTION_DELAY
public static final long DEFAULT_EVICTION_DELAY
uri
protected final java.lang.String uri
queue
protected final org.fusesource.hawtdispatch.DispatchQueue queue
pending
protected final java.util.LinkedList<TransportPool.Pair> pending
transports
protected final java.util.Map<Transport,TransportPool.TransportState> transports
running
protected java.util.concurrent.atomic.AtomicBoolean running
poolSize
protected int poolSize
evictionDelay
protected long evictionDelay
TransportPool
public TransportPool(java.lang.String uri,
org.fusesource.hawtdispatch.DispatchQueue queue)
TransportPool
public TransportPool(java.lang.String uri,
org.fusesource.hawtdispatch.DispatchQueue queue,
int poolSize,
long evictionDelay)
createTransport
protected abstract Transport createTransport(java.lang.String uri)
throws java.lang.Exception
- Throws:
java.lang.Exception
createCodec
protected abstract ProtocolCodec createCodec()
onCommand
protected abstract void onCommand(java.lang.Object command)
onFailure
protected abstract void onFailure(java.lang.Object id,
java.lang.Throwable throwable)
onDone
protected void onDone(java.lang.Object id)
offer
public void offer(java.lang.Object data,
java.lang.Object id)
doOffer
protected boolean doOffer(Transport transport,
java.lang.Object command,
java.lang.Object id)
getIdleTransport
protected Transport getIdleTransport()
start
public void start()
throws java.lang.Exception
- Description copied from interface:
Service
- Starts the service. No guarantee is given that the service has fully started
by the time this method returns.
- Specified by:
start in interface Service
- Throws:
java.lang.Exception
start
public void start(java.lang.Runnable onComplete)
throws java.lang.Exception
- Description copied from interface:
Service
- Starts the service. Executes the onComplete runnable once the service has fully started up.
- Specified by:
start in interface Service
- Parameters:
onComplete - my be set to null if not interested in a callback.
- Throws:
java.lang.Exception
stop
public void stop()
- Description copied from interface:
Service
- Stops the service. No guarantee is given that the service has fully stopped
by the time this method returns.
- Specified by:
stop in interface Service
stop
public void stop(java.lang.Runnable onComplete)
- Description copied from interface:
Service
- Stops the service. Executes the onComplete runnable once the service has fully stopped.
- Specified by:
stop in interface Service
- Parameters:
onComplete - my be set to null if not interested in a callback.
startNewTransport
protected void startNewTransport()
throws java.lang.Exception
- Throws:
java.lang.Exception
Copyright © 2013 Red Hat. All Rights Reserved.