public abstract class Connector extends ChannelMultiplexer implements InternalConnector
InternalChannelMultiplexer.BufferMultiplexerILocationAware.LocationIContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>IBufferProvider.Introspection, IBufferProvider.NotificationILifecycle.DeferrableActivationNO_TIMEOUTCONTEXT_MULTIPLEXER, RESERVED_CHANNELDEFAULT_OPEN_CHANNEL_TIMEOUT, NO_CHANNEL_TIMEOUT| Constructor and Description |
|---|
Connector() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
connect()
Synchronous connect with infinite timeout value.
|
void |
connect(long timeout)
Synchronous connect.
|
void |
connectAsync()
Asynchronous connect.
|
protected abstract INegotiationContext |
createNegotiationContext() |
protected void |
deregisterChannelFromPeer(InternalChannel channel) |
protected void |
doActivate() |
protected void |
doBeforeActivate() |
protected void |
doBeforeOpenChannel(IProtocol<?> protocol) |
protected void |
doDeactivate() |
short |
getBufferCapacity()
Returns the capacity of the buffers provided by
IBufferProvider.provideBuffer() . |
ILocationAware.Location |
getLocation()
|
INegotiationContext |
getNegotiationContext() |
protected NegotiationException |
getNegotiationException() |
INegotiator |
getNegotiator() |
ConnectorState |
getState()
Returns the current state of this connector.
|
java.lang.String |
getURL() |
java.lang.String |
getUserID() |
protected void |
initChannel(InternalChannel channel,
IProtocol<?> protocol) |
boolean |
isClient()
|
boolean |
isClosed() |
boolean |
isConnected()
Same as
. |
boolean |
isConnecting() |
boolean |
isDeferredActivation() |
boolean |
isDisconnected() |
boolean |
isNegotiating() |
boolean |
isServer()
|
protected void |
leaveConnecting() |
IBuffer |
provideBuffer()
Provides a buffer from this
BufferProvider. |
void |
retainBuffer(IBuffer buffer)
Retains a buffer to this
BufferProvider. |
protected void |
setNegotiationException(NegotiationException negotiationException) |
void |
setNegotiator(INegotiator negotiator) |
void |
setState(ConnectorState newState) |
void |
setUserID(java.lang.String userID) |
void |
waitForConnection(long timeout)
Blocks until
or the given timeout expired. |
closeChannel, createChannel, createProtocol, createProtocolFactoryKey, getChannel, getChannels, getConfig, getElements, getExecutorService, getOpenChannelTimeout, inverseClose, inverseCloseChannel, inverseOpenChannel, inverseOpenChannel, isEmpty, openChannel, openChannel, openChannel, registerChannelWithPeer, setConfig, setOpenChannelTimeoutfireContainerEvent, fireContainerEvent, fireContainerEvent, fireElementAddedEvent, fireElementRemovedEvent, fireElementsAddedEvent, fireElementsRemovedEvent, fireEvent, newContainerEvent, newContainerEventactivate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, toStringaddListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcloseChannel, multiplexChannelgetChannels, getOpenChannelTimeout, openChannel, openChannel, openChannel, setOpenChannelTimeoutgetElements, isEmptyaddListener, getListeners, hasListeners, removeListenergetConfig, setConfigpublic INegotiator getNegotiator()
getNegotiator in interface INegotiatorAwarepublic void setNegotiator(INegotiator negotiator)
setNegotiator in interface INegotiatorAwarepublic INegotiationContext getNegotiationContext()
public boolean isClient()
ILocationAwareisClient in interface ILocationAwarepublic boolean isServer()
ILocationAwareisServer in interface ILocationAwarepublic java.lang.String getUserID()
getUserID in interface IUserAwarepublic void setUserID(java.lang.String userID)
public ConnectorState getState()
IConnectorgetState in interface IConnectorpublic void setState(ConnectorState newState) throws ConnectorException
ConnectorExceptionpublic boolean isDisconnected()
public boolean isConnecting()
public boolean isNegotiating()
public boolean isConnected()
IConnectorIConnector.getState() == ConnectorState.CONNECTED.isConnected in interface IConnectorpublic void connectAsync()
throws ConnectorException
IConnectorIConnector in a state where IConnector.isConnected() == false
.connectAsync in interface IConnectorConnectorExceptionIConnector.waitForConnection(long),
IConnector.connect(long)public void waitForConnection(long timeout)
throws ConnectorException
IConnectorIConnector.isConnected() == true or the given timeout expired.waitForConnection in interface IConnectortimeout - The maximum number of milli seconds to block or IConnector.NO_TIMEOUT to block indefinetely in case no
connection occurs.ConnectorExceptionpublic void connect(long timeout)
throws ConnectorException
IConnectorIConnector.isConnected() == true or the given timeout expired.connect in interface IConnectortimeout - The maximum number of milli seconds to block or IConnector.NO_TIMEOUT to block indefinetely in case no
connection occurs.ConnectorExceptionpublic void connect()
throws ConnectorException
IConnectorconnect(NO_TIMEOUT).connect in interface IConnectorConnectorExceptionpublic short getBufferCapacity()
IBufferProviderIBufferProvider.provideBuffer() .getBufferCapacity in interface IBufferProviderpublic IBuffer provideBuffer()
IBufferProviderBufferProvider.provideBuffer in interface IBufferProviderpublic void retainBuffer(IBuffer buffer)
IBufferProviderBufferProvider.retainBuffer in interface IBufferProviderprotected void leaveConnecting()
protected abstract INegotiationContext createNegotiationContext()
createNegotiationContext in class ChannelMultiplexerprotected NegotiationException getNegotiationException()
protected void setNegotiationException(NegotiationException negotiationException)
protected void initChannel(InternalChannel channel, IProtocol<?> protocol)
initChannel in class ChannelMultiplexerprotected void deregisterChannelFromPeer(InternalChannel channel) throws ChannelException
deregisterChannelFromPeer in class ChannelMultiplexerChannelExceptionpublic ILocationAware.Location getLocation()
ILocationAwaregetLocation in interface ILocationAwarepublic java.lang.String getURL()
getURL in interface IConnectorpublic boolean isDeferredActivation()
isDeferredActivation in interface ILifecycle.DeferrableActivationisDeferredActivation in class Lifecycleprotected void doBeforeOpenChannel(IProtocol<?> protocol)
doBeforeOpenChannel in class ChannelMultiplexerprotected void doBeforeActivate()
throws java.lang.Exception
doBeforeActivate in class Lifecyclejava.lang.Exceptionprotected void doActivate()
throws java.lang.Exception
doActivate in class Lifecyclejava.lang.Exceptionprotected void doDeactivate()
throws java.lang.Exception
doDeactivate in class ChannelMultiplexerjava.lang.ExceptionCopyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html