|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IConnector
One endpoint of a physical connection of arbitrary nature between two communicating parties. A IConnector
encapsulates the process of establishing and closing such connections and has a ConnectorLocation of
CLIENT or SERVER with respect to this process. Once
a connection is established either party can use its connector to open multiple IChannels to asynchronously
exchange IBuffers.
This interface is not intended to be implemented by clients. Providers of connectors for new physical
connection types have to subclass Connector.


| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier |
|---|
INotifier.Introspection |
| Method Summary | |
|---|---|
boolean |
connect(long timeout)
Synchronous connect. |
void |
connectAsync()
Asynchronous connect. |
ConnectorException |
disconnect()
|
IChannel[] |
getChannels()
Returns an array of currently open channels. |
ConnectorLocation |
getLocation()
Indicates which role this connector has played during the establishment of the physical connection. |
IRegistry<IFactoryKey,IFactory> |
getProtocolFactoryRegistry()
Returns the factory registry used by this connector to lookup factories that can create IProtocols for
newly opened IChannels. |
java.util.List<IElementProcessor> |
getProtocolPostProcessors()
Returns the post processors used by this connector to modify protocols created for new channels. |
ConnectorState |
getState()
Returns the current state of this onnector. |
java.lang.String |
getURL()
|
java.lang.String |
getUserID()
Returns the userID of this connector. |
boolean |
isClient()
Same as . |
boolean |
isConnected()
Same as . |
boolean |
isServer()
Same as . |
IChannel |
openChannel()
Synchronous request to open a new IChannel with an undefined channel protocol. |
IChannel |
openChannel(IProtocol protocol)
Synchronous request to open a new IChannel with the given channel protocol . |
IChannel |
openChannel(java.lang.String protocolID,
java.lang.Object infraStructure)
Synchronous request to open a new IChannel with a channel protocol defined by a given protocol identifier. |
boolean |
waitForConnection(long timeout)
Blocks until or the given timeout expired. |
| Methods inherited from interface org.eclipse.net4j.util.container.IContainer |
|---|
getElements, isEmpty |
| Methods inherited from interface org.eclipse.net4j.util.event.INotifier |
|---|
addListener, removeListener |
| Method Detail |
|---|
java.lang.String getURL()
ConnectorLocation getLocation()
boolean isClient()
getLocation() == ConnectorLocation.CLIENT.
boolean isServer()
getLocation() == ConnectorLocation.SERVER.
java.lang.String getUserID()
IRegistry<IFactoryKey,IFactory> getProtocolFactoryRegistry()
IProtocols for
newly opened IChannels.
Automatic protocol creation only happens if isServer() returns true.
java.util.List<IElementProcessor> getProtocolPostProcessors()
ConnectorState getState()
boolean isConnected()
getState() == ConnectorState.CONNECTED.
void connectAsync()
throws ConnectorException
IConnector in a state where
isConnected() == false.
ConnectorException
boolean waitForConnection(long timeout)
throws ConnectorException
isConnected() == true or the given timeout expired.
ConnectorException
boolean connect(long timeout)
throws ConnectorException
isConnected() ==
true or the given timeout expired.
ConnectorExceptionConnectorException disconnect()
IChannel[] getChannels()
null
values. Generally the channelIndex of a channel can not be used as an index into this array.
IChannel openChannel()
throws ConnectorException
IChannel with an undefined channel protocol. Since the peer connector
can't lookup a protocol factory without a protocol identifier the IBufferHandler of the
peer IChannel can only be provided by externally provided channel lifecycle
listeners.
ConnectorExceptionopenChannel(String, Object),
openChannel(IProtocol)
IChannel openChannel(java.lang.String protocolID,
java.lang.Object infraStructure)
throws ConnectorException
IChannel with a channel protocol defined by a given protocol identifier.
The peer connector will lookup a protocol factory with the protocol identifier, create a
IBufferHandler and inject it into the peer IChannel.
ConnectorExceptionopenChannel(),
openChannel(IProtocol)
IChannel openChannel(IProtocol protocol)
throws ConnectorException
IChannel with the given channel protocol . The peer connector will lookup
a protocol factory with the protocol identifier, create a IBufferHandler and inject it
into the peer channel.
ConnectorExceptionopenChannel(),
openChannel(String, Object)
|
Copyright (c) 2004 - 2008 Eike Stepper, Germany. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||