public interface IConnector extends IChannelMultiplexer, IUserAware, Closeable
IConnector
encapsulates the process of establishing and closing such connections and has a
location 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 implement org.eclipse.internal.net4j.connector.InternalConnector.
ILocationAware.LocationIContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>| Modifier and Type | Field and Description |
|---|---|
static long |
NO_TIMEOUT |
DEFAULT_OPEN_CHANNEL_TIMEOUT, NO_CHANNEL_TIMEOUT| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Synchronous connect with infinite timeout value.
|
void |
connect(long timeout)
Synchronous connect.
|
void |
connectAsync()
Asynchronous connect.
|
ConnectorState |
getState()
Returns the current state of this connector.
|
java.lang.String |
getURL() |
boolean |
isConnected()
Same as
. |
void |
waitForConnection(long timeout)
Blocks until
or the given timeout expired. |
getChannels, getOpenChannelTimeout, openChannel, openChannel, openChannel, setOpenChannelTimeoutgetLocation, isClient, isServergetElements, isEmptyaddListener, getListeners, hasListeners, removeListenergetUserIDstatic final long NO_TIMEOUT
java.lang.String getURL()
ConnectorState getState()
boolean isConnected()
getState() == ConnectorState.CONNECTED.void connect()
throws ConnectorException
connect(NO_TIMEOUT).ConnectorExceptionvoid connect(long timeout)
throws ConnectorException
isConnected() == true or the given timeout expired.timeout - The maximum number of milli seconds to block or NO_TIMEOUT to block indefinetely in case no
connection occurs.ConnectorExceptionvoid connectAsync()
throws ConnectorException
IConnector in a state where isConnected() == false
.ConnectorExceptionwaitForConnection(long),
connect(long)void waitForConnection(long timeout)
throws ConnectorException
isConnected() == true or the given timeout expired.timeout - The maximum number of milli seconds to block or NO_TIMEOUT to block indefinetely in case no
connection occurs.ConnectorExceptionCopyright (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