cz.cuni.amis.pogamut.base.communication.connection.impl.socket
Class SocketConnection
java.lang.Object
cz.cuni.amis.pogamut.base.communication.connection.impl.AbstractConnection<ISocketConnectionAddress>
cz.cuni.amis.pogamut.base.communication.connection.impl.socket.SocketConnection
- All Implemented Interfaces:
- IWorldConnection<ISocketConnectionAddress>, IWorldReaderProvider, IWorldWriterProvider, IComponent
public class SocketConnection
- extends AbstractConnection<ISocketConnectionAddress>
Method Summary |
protected java.io.Reader |
getConnectionReader()
This should return plain reader for the current connection. |
protected java.io.Writer |
getConnectionWriter()
This should return plain writer for the current connection. |
java.lang.String |
toString()
|
protected void |
unsyncClose()
Inner unsynchronized implementation of the close(), should close the connection
to the remote side without throwing any exception. |
protected void |
unsyncConnect(ISocketConnectionAddress address)
Inner implementation of connect, unsynchronized, this is called from
connect(IConnectionDescriptor). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CONNECTION_DEPENDENCY
public static final java.lang.String CONNECTION_DEPENDENCY
- See Also:
- Constant Field Values
CONNECTION_ADDRESS_DEPENDENCY
public static final java.lang.String CONNECTION_ADDRESS_DEPENDENCY
- See Also:
- Constant Field Values
SocketConnection
@Inject
public SocketConnection(ISocketConnectionAddress address,
ComponentDependencies dependencies,
IComponentBus bus,
IAgentLogger logger)
SocketConnection
public SocketConnection(ComponentDependencies dependencies,
IComponentBus bus,
IAgentLogger logger)
getConnectionReader
protected java.io.Reader getConnectionReader()
throws ConnectionException
- Description copied from class:
AbstractConnection
- This should return plain reader for the current connection. If connection is down,
this should throw WorldConnectionException. We will wrap this reader with our own
implementation that is capable of sniffing messages as they come (if required).
- Specified by:
getConnectionReader
in class AbstractConnection<ISocketConnectionAddress>
- Returns:
-
- Throws:
ConnectionException
getConnectionWriter
protected java.io.Writer getConnectionWriter()
throws ConnectionException
- Description copied from class:
AbstractConnection
- This should return plain writer for the current connection. If connection is down,
this should throw WorldConnectionException. We will wrap this writer with our own
implementation that is capable of sniffing messages as they go (if required).
- Specified by:
getConnectionWriter
in class AbstractConnection<ISocketConnectionAddress>
- Returns:
-
- Throws:
ConnectionException
unsyncClose
protected void unsyncClose()
- Description copied from class:
AbstractConnection
- Inner unsynchronized implementation of the close(), should close the connection
to the remote side without throwing any exception. You may be sure that the connection
is up (according to the flag) when this method is called.
- Specified by:
unsyncClose
in class AbstractConnection<ISocketConnectionAddress>
unsyncConnect
protected void unsyncConnect(ISocketConnectionAddress address)
throws ConnectionException
- Description copied from class:
AbstractConnection
- Inner implementation of connect, unsynchronized, this is called from
connect(IConnectionDescriptor). This is called only iff the connection is down
and the address is a new address.
- Specified by:
unsyncConnect
in class AbstractConnection<ISocketConnectionAddress>
- Throws:
ConnectionException
toString
public java.lang.String toString()
- Overrides:
toString
in class AbstractConnection<ISocketConnectionAddress>