Package org.eclipse.spi.net4j
Class Connector
- java.lang.Object
- 
- org.eclipse.net4j.util.event.Notifier
- 
- org.eclipse.net4j.util.lifecycle.Lifecycle
- 
- org.eclipse.net4j.util.lifecycle.ShareableLifecycle
- 
- org.eclipse.net4j.util.container.Container<IChannel>
- 
- org.eclipse.spi.net4j.ChannelMultiplexer
- 
- org.eclipse.spi.net4j.Connector
 
 
 
 
 
 
- 
- All Implemented Interfaces:
- IBufferProvider,- IChannelMultiplexer,- IConnector,- ILocationAware,- ITransportConfigAware,- org.eclipse.net4j.util.collection.Closeable,- org.eclipse.net4j.util.concurrent.IExecutorServiceProvider,- org.eclipse.net4j.util.container.IContainer<IChannel>,- org.eclipse.net4j.util.event.INotifier,- org.eclipse.net4j.util.event.INotifier.INotifier2,- org.eclipse.net4j.util.lifecycle.IDeactivateable,- org.eclipse.net4j.util.lifecycle.ILifecycle,- org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation,- org.eclipse.net4j.util.properties.IPropertiesContainer,- org.eclipse.net4j.util.security.INegotiatorAware,- org.eclipse.net4j.util.security.IUserAware,- InternalChannelMultiplexer,- InternalConnector,- InverseCloseable
 
 public abstract class Connector extends ChannelMultiplexer implements InternalConnector If the meaning of this type isn't clear, there really should be more of a description here...- Since:
- 2.0
- Author:
- Eike Stepper
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.eclipse.net4j.buffer.IBufferProviderIBufferProvider.Introspection, IBufferProvider.Notification
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainerorg.eclipse.net4j.util.container.IContainer.Modifiable<E extends java.lang.Object>, org.eclipse.net4j.util.container.IContainer.Persistable<E extends java.lang.Object>, org.eclipse.net4j.util.container.IContainer.Persistence<E extends java.lang.Object>
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycleorg.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.ILocationAwareILocationAware.Location
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifierorg.eclipse.net4j.util.event.INotifier.INotifier2
 - 
Nested classes/interfaces inherited from interface org.eclipse.spi.net4j.InternalChannelMultiplexerInternalChannelMultiplexer.BufferMultiplexer
 
- 
 - 
Field Summary- 
Fields inherited from interface org.eclipse.net4j.channel.IChannelMultiplexerDEFAULT_OPEN_CHANNEL_TIMEOUT, NO_CHANNEL_TIMEOUT
 - 
Fields inherited from interface org.eclipse.net4j.connector.IConnectorNO_TIMEOUT
 - 
Fields inherited from interface org.eclipse.spi.net4j.InternalChannelMultiplexerCONTEXT_MULTIPLEXER, RESERVED_CHANNEL
 
- 
 - 
Constructor SummaryConstructors Constructor Description Connector()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()voidconnect()Synchronous connect with infinite timeout value.voidconnect(long timeout)Synchronous connect.voidconnectAsync()Asynchronous connect.protected abstract org.eclipse.net4j.util.security.INegotiationContextcreateNegotiationContext()protected voidderegisterChannelFromPeer(InternalChannel channel)protected voiddoActivate()protected voiddoBeforeActivate()protected voiddoBeforeOpenChannel(IProtocol<?> protocol)protected voiddoDeactivate()shortgetBufferCapacity()Returns the capacity of the buffers provided byIBufferProvider.provideBuffer().ILocationAware.LocationgetLocation()org.eclipse.net4j.util.security.INegotiationContextgetNegotiationContext()protected org.eclipse.net4j.util.security.NegotiationExceptiongetNegotiationException()org.eclipse.net4j.util.security.INegotiatorgetNegotiator()ConnectorStategetState()Returns the current state of this connector.java.lang.StringgetURL()java.lang.StringgetUserID()protected voidinitChannel(InternalChannel channel, IProtocol<?> protocol)booleanisClient()booleanisClosed()booleanisConnected()Same asIConnector.getState()==ConnectorState.CONNECTEDbooleanisConnecting()booleanisDeferredActivation()booleanisDisconnected()booleanisNegotiating()booleanisServer()protected voidleaveConnecting()IBufferprovideBuffer()Provides a buffer from thisBufferProvider.voidretainBuffer(IBuffer buffer)Retains a buffer to thisBufferProvider.protected voidsetNegotiationException(org.eclipse.net4j.util.security.NegotiationException negotiationException)voidsetNegotiator(org.eclipse.net4j.util.security.INegotiator negotiator)voidsetState(ConnectorState newState)voidsetUserID(java.lang.String userID)voidwaitForConnection(long timeout)Blocks untilIConnector.isConnected()== true- 
Methods inherited from class org.eclipse.spi.net4j.ChannelMultiplexercloseChannel, createChannel, createProtocol, createProtocolFactoryKey, getChannel, getChannels, getConfig, getElements, getExecutorService, getOpenChannelTimeout, inverseClose, inverseCloseChannel, inverseOpenChannel, inverseOpenChannel, isEmpty, openChannel, openChannel, openChannel, properties, registerChannelWithPeer, setConfig, setOpenChannelTimeout
 - 
Methods inherited from class org.eclipse.net4j.util.container.ContainerfireContainerEvent, fireContainerEvent, fireContainerEvent, fireElementAddedEvent, fireElementRemovedEvent, fireElementsAddedEvent, fireElementsRemovedEvent, fireEvent, newContainerEvent, newContainerEvent
 - 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycleactivate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, toString
 - 
Methods inherited from class org.eclipse.net4j.util.event.NotifieraddListener, addUniqueListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.eclipse.net4j.channel.IChannelMultiplexergetChannels, getOpenChannelTimeout, openChannel, openChannel, openChannel, setOpenChannelTimeout
 - 
Methods inherited from interface org.eclipse.net4j.util.event.INotifieraddListener, getListeners, hasListeners, removeListener
 - 
Methods inherited from interface org.eclipse.spi.net4j.InternalChannelMultiplexercloseChannel, multiplexChannel
 - 
Methods inherited from interface org.eclipse.net4j.ITransportConfigAwaregetConfig, setConfig
 
- 
 
- 
- 
- 
Method Detail- 
getNegotiatorpublic org.eclipse.net4j.util.security.INegotiator getNegotiator() - Specified by:
- getNegotiatorin interface- org.eclipse.net4j.util.security.INegotiatorAware
 
 - 
setNegotiatorpublic void setNegotiator(org.eclipse.net4j.util.security.INegotiator negotiator) - Specified by:
- setNegotiatorin interface- org.eclipse.net4j.util.security.INegotiatorAware
 
 - 
getNegotiationContextpublic org.eclipse.net4j.util.security.INegotiationContext getNegotiationContext() 
 - 
isClientpublic boolean isClient() Description copied from interface:ILocationAware- Specified by:
- isClientin interface- ILocationAware
 
 - 
isServerpublic boolean isServer() Description copied from interface:ILocationAware- Specified by:
- isServerin interface- ILocationAware
 
 - 
getUserIDpublic java.lang.String getUserID() - Specified by:
- getUserIDin interface- org.eclipse.net4j.util.security.IUserAware
 
 - 
setUserIDpublic void setUserID(java.lang.String userID) 
 - 
getStatepublic ConnectorState getState() Description copied from interface:IConnectorReturns the current state of this connector.- Specified by:
- getStatein interface- IConnector
 
 - 
setStatepublic void setState(ConnectorState newState) throws ConnectorException - Throws:
- ConnectorException
 
 - 
isDisconnectedpublic boolean isDisconnected() 
 - 
isConnectingpublic boolean isConnecting() 
 - 
isNegotiatingpublic boolean isNegotiating() 
 - 
isConnectedpublic boolean isConnected() Description copied from interface:IConnectorSame asIConnector.getState()==ConnectorState.CONNECTED- Specified by:
- isConnectedin interface- IConnector
 
 - 
connectAsyncpublic void connectAsync() throws ConnectorExceptionDescription copied from interface:IConnectorAsynchronous connect. May leave thisIConnectorin a state whereIConnector.isConnected()== false- Specified by:
- connectAsyncin interface- IConnector
- Throws:
- ConnectorException
- See Also:
- IConnector.waitForConnection(long),- IConnector.connect(long)
 
 - 
waitForConnectionpublic void waitForConnection(long timeout) throws ConnectorExceptionDescription copied from interface:IConnectorBlocks untilIConnector.isConnected()== true- Specified by:
- waitForConnectionin interface- IConnector
- Parameters:
- timeout- The maximum number of milli seconds to block or- IConnector.NO_TIMEOUTto block indefinetely in case no connection occurs.
- Throws:
- ConnectorException
- Since:
- 4.0
 
 - 
connectpublic void connect(long timeout) throws ConnectorExceptionDescription copied from interface:IConnectorSynchronous connect. Blocks untilIConnector.isConnected()== true- Specified by:
- connectin interface- IConnector
- Parameters:
- timeout- The maximum number of milli seconds to block or- IConnector.NO_TIMEOUTto block indefinetely in case no connection occurs.
- Throws:
- ConnectorException
- Since:
- 4.0
 
 - 
connectpublic void connect() throws ConnectorExceptionDescription copied from interface:IConnectorSynchronous connect with infinite timeout value. Same asconnect(NO_TIMEOUT).- Specified by:
- connectin interface- IConnector
- Throws:
- ConnectorException
- Since:
- 4.0
 
 - 
closepublic void close() - Specified by:
- closein interface- org.eclipse.net4j.util.collection.Closeable
 
 - 
isClosedpublic boolean isClosed() - Specified by:
- isClosedin interface- org.eclipse.net4j.util.collection.Closeable
 
 - 
getBufferCapacitypublic short getBufferCapacity() Description copied from interface:IBufferProviderReturns the capacity of the buffers provided byIBufferProvider.provideBuffer().- Specified by:
- getBufferCapacityin interface- IBufferProvider
 
 - 
provideBufferpublic IBuffer provideBuffer() Description copied from interface:IBufferProviderProvides a buffer from thisBufferProvider.- Specified by:
- provideBufferin interface- IBufferProvider
 
 - 
retainBufferpublic void retainBuffer(IBuffer buffer) Description copied from interface:IBufferProviderRetains a buffer to thisBufferProvider.- Specified by:
- retainBufferin interface- IBufferProvider
 
 - 
leaveConnectingprotected void leaveConnecting() 
 - 
createNegotiationContextprotected abstract org.eclipse.net4j.util.security.INegotiationContext createNegotiationContext() - Specified by:
- createNegotiationContextin class- ChannelMultiplexer
 
 - 
getNegotiationExceptionprotected org.eclipse.net4j.util.security.NegotiationException getNegotiationException() 
 - 
setNegotiationExceptionprotected void setNegotiationException(org.eclipse.net4j.util.security.NegotiationException negotiationException) 
 - 
initChannelprotected void initChannel(InternalChannel channel, IProtocol<?> protocol) - Overrides:
- initChannelin class- ChannelMultiplexer
 
 - 
deregisterChannelFromPeerprotected void deregisterChannelFromPeer(InternalChannel channel) throws ChannelException - Specified by:
- deregisterChannelFromPeerin class- ChannelMultiplexer
- Throws:
- ChannelException
 
 - 
getLocationpublic ILocationAware.Location getLocation() Description copied from interface:ILocationAware- Specified by:
- getLocationin interface- ILocationAware
 
 - 
getURLpublic java.lang.String getURL() - Specified by:
- getURLin interface- IConnector
 
 - 
isDeferredActivationpublic boolean isDeferredActivation() - Specified by:
- isDeferredActivationin interface- org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation
- Overrides:
- isDeferredActivationin class- org.eclipse.net4j.util.lifecycle.Lifecycle
- Since:
- 4.1
 
 - 
doBeforeOpenChannelprotected void doBeforeOpenChannel(IProtocol<?> protocol) - Overrides:
- doBeforeOpenChannelin class- ChannelMultiplexer
 
 - 
doBeforeActivateprotected void doBeforeActivate() throws java.lang.Exception- Overrides:
- doBeforeActivatein class- org.eclipse.net4j.util.lifecycle.Lifecycle
- Throws:
- java.lang.Exception
 
 - 
doActivateprotected void doActivate() throws java.lang.Exception- Overrides:
- doActivatein class- org.eclipse.net4j.util.lifecycle.Lifecycle
- Throws:
- java.lang.Exception
 
 - 
doDeactivateprotected void doDeactivate() throws java.lang.Exception- Overrides:
- doDeactivatein class- ChannelMultiplexer
- Throws:
- java.lang.Exception
 
 
- 
 
-