public class DetectorConnectionFactory extends AbstractConnectionFactory implements ConnectionFactory.Detecting
ConnectionFactory combining multiple Detecting instances that will upgrade to
the first one recognizing the bytes in the buffer.AbstractLifeCycle.AbstractLifeCycleListenerConnectionFactory.Detecting.DetectionConnectionFactory.Detecting, ConnectionFactory.UpgradingContainer.InheritedListener, Container.ListenerDumpable.DumpableContainerLifeCycle.Listener| Constructor and Description |
|---|
DetectorConnectionFactory(ConnectionFactory.Detecting... detectingConnectionFactories)
When the first bytes are not recognized by the
detectingConnectionFactories, the default behavior is to
upgrade to the protocol returned by AbstractConnectionFactory.findNextProtocol(Connector). |
| Modifier and Type | Method and Description |
|---|---|
ConnectionFactory.Detecting.Detection |
detect(java.nio.ByteBuffer buffer)
Performs a detection using multiple
ConnectionFactory.Detecting instances and returns the aggregated outcome. |
Connection |
newConnection(Connector connector,
EndPoint endPoint)
Creates a new
Connection with the given parameters |
protected void |
nextProtocol(Connector connector,
EndPoint endPoint,
java.nio.ByteBuffer buffer)
Callback method called when detection was unsuccessful.
|
protected static void |
upgradeToConnectionFactory(ConnectionFactory connectionFactory,
Connector connector,
EndPoint endPoint)
Utility method that performs an upgrade to the specified connection factory, disposing of the given resources when needed.
|
configure, findNextProtocol, findNextProtocol, getFactories, getInputBufferSize, getProtocol, getProtocols, setInputBufferSize, toStringaddBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetProtocol, getProtocolsisDumpabledumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, namedpublic DetectorConnectionFactory(ConnectionFactory.Detecting... detectingConnectionFactories)
When the first bytes are not recognized by the detectingConnectionFactories, the default behavior is to
upgrade to the protocol returned by AbstractConnectionFactory.findNextProtocol(Connector).
detectingConnectionFactories - the Detecting instances.public ConnectionFactory.Detecting.Detection detect(java.nio.ByteBuffer buffer)
ConnectionFactory.Detecting instances and returns the aggregated outcome.detect in interface ConnectionFactory.Detectingbuffer - the buffer to perform a detection against.Detecting.Detection value with the detection outcome of the detectingConnectionFactories.protected static void upgradeToConnectionFactory(ConnectionFactory connectionFactory, Connector connector, EndPoint endPoint) throws java.lang.IllegalStateException
connectionFactory - the connection factory to upgrade to.connector - the connector.endPoint - the endpoint.java.lang.IllegalStateExceptionprotected void nextProtocol(Connector connector, EndPoint endPoint, java.nio.ByteBuffer buffer) throws java.lang.IllegalStateException
Callback method called when detection was unsuccessful.
This implementation upgrades to the protocol returned by AbstractConnectionFactory.findNextProtocol(Connector).
connector - the connector.endPoint - the endpoint.buffer - the buffer.java.lang.IllegalStateExceptionpublic Connection newConnection(Connector connector, EndPoint endPoint)
ConnectionFactoryCreates a new Connection with the given parameters
newConnection in interface ConnectionFactoryconnector - The Connector creating this connectionendPoint - the EndPoint associated with the connectionConnectionCopyright © 1995–2021 Webtide. All rights reserved.