- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.io.ClientConnector
-
- All Implemented Interfaces:
Container,Destroyable,Dumpable,LifeCycle
public class ClientConnector extends ContainerLifeCycle
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classClientConnector.ClientSelectorManager-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCLIENT_CONNECTION_FACTORY_CONTEXT_KEYstatic java.lang.StringCLIENT_CONNECTOR_CONTEXT_KEYstatic java.lang.StringCONNECTION_PROMISE_CONTEXT_KEYstatic java.lang.StringREMOTE_SOCKET_ADDRESS_CONTEXT_KEY
-
Constructor Summary
Constructors Constructor Description ClientConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(java.nio.channels.SocketChannel channel, java.util.Map<java.lang.String,java.lang.Object> context)protected voidconfigure(java.nio.channels.SocketChannel channel)voidconnect(java.net.SocketAddress address, java.util.Map<java.lang.String,java.lang.Object> context)protected voidconnectFailed(java.lang.Throwable failure, java.util.Map<java.lang.String,java.lang.Object> context)protected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.java.net.SocketAddressgetBindAddress()ByteBufferPoolgetByteBufferPool()java.time.DurationgetConnectTimeout()java.util.concurrent.ExecutorgetExecutor()java.time.DurationgetIdleTimeout()SchedulergetScheduler()intgetSelectors()SslContextFactory.ClientgetSslContextFactory()booleanisConnectBlocking()protected SelectorManagernewSelectorManager()protected SslContextFactory.ClientnewSslContextFactory()protected voidsafeClose(java.io.Closeable closeable)voidsetBindAddress(java.net.SocketAddress bindAddress)voidsetByteBufferPool(ByteBufferPool byteBufferPool)voidsetConnectBlocking(boolean connectBlocking)voidsetConnectTimeout(java.time.Duration connectTimeout)voidsetExecutor(java.util.concurrent.Executor executor)voidsetIdleTimeout(java.time.Duration idleTimeout)voidsetScheduler(Scheduler scheduler)voidsetSelectors(int selectors)voidsetSslContextFactory(SslContextFactory.Client sslContextFactory)-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
-
-
-
-
Field Detail
-
CLIENT_CONNECTOR_CONTEXT_KEY
public static final java.lang.String CLIENT_CONNECTOR_CONTEXT_KEY
- See Also:
- Constant Field Values
-
REMOTE_SOCKET_ADDRESS_CONTEXT_KEY
public static final java.lang.String REMOTE_SOCKET_ADDRESS_CONTEXT_KEY
- See Also:
- Constant Field Values
-
CLIENT_CONNECTION_FACTORY_CONTEXT_KEY
public static final java.lang.String CLIENT_CONNECTION_FACTORY_CONTEXT_KEY
- See Also:
- Constant Field Values
-
CONNECTION_PROMISE_CONTEXT_KEY
public static final java.lang.String CONNECTION_PROMISE_CONTEXT_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getExecutor
public java.util.concurrent.Executor getExecutor()
-
setExecutor
public void setExecutor(java.util.concurrent.Executor executor)
-
getScheduler
public Scheduler getScheduler()
-
setScheduler
public void setScheduler(Scheduler scheduler)
-
getByteBufferPool
public ByteBufferPool getByteBufferPool()
-
setByteBufferPool
public void setByteBufferPool(ByteBufferPool byteBufferPool)
-
getSslContextFactory
public SslContextFactory.Client getSslContextFactory()
-
setSslContextFactory
public void setSslContextFactory(SslContextFactory.Client sslContextFactory)
-
getSelectors
public int getSelectors()
-
setSelectors
public void setSelectors(int selectors)
-
isConnectBlocking
public boolean isConnectBlocking()
-
setConnectBlocking
public void setConnectBlocking(boolean connectBlocking)
-
getConnectTimeout
public java.time.Duration getConnectTimeout()
-
setConnectTimeout
public void setConnectTimeout(java.time.Duration connectTimeout)
-
getIdleTimeout
public java.time.Duration getIdleTimeout()
-
setIdleTimeout
public void setIdleTimeout(java.time.Duration idleTimeout)
-
getBindAddress
public java.net.SocketAddress getBindAddress()
-
setBindAddress
public void setBindAddress(java.net.SocketAddress bindAddress)
-
doStart
protected void doStart() throws java.lang.ExceptionDescription copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classContainerLifeCycle- Throws:
AbstractLifeCycle.StopException- If thrown, the lifecycle will immediately be stopped.java.lang.Exception- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
protected void doStop() throws java.lang.ExceptionDescription copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStopin classContainerLifeCycle- Throws:
java.lang.Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
newSslContextFactory
protected SslContextFactory.Client newSslContextFactory()
-
newSelectorManager
protected SelectorManager newSelectorManager()
-
connect
public void connect(java.net.SocketAddress address, java.util.Map<java.lang.String,java.lang.Object> context)
-
accept
public void accept(java.nio.channels.SocketChannel channel, java.util.Map<java.lang.String,java.lang.Object> context)
-
safeClose
protected void safeClose(java.io.Closeable closeable)
-
configure
protected void configure(java.nio.channels.SocketChannel channel) throws java.io.IOException- Throws:
java.io.IOException
-
connectFailed
protected void connectFailed(java.lang.Throwable failure, java.util.Map<java.lang.String,java.lang.Object> context)
-
-