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>
CONNECTION_DEPENDENCY
public static final String CONNECTION_DEPENDENCY
- See Also:
- Constant Field Values
CONNECTION_ADDRESS_DEPENDENCY
public static final 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 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 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 String toString()
- Overrides:
toString
in class AbstractConnection<ISocketConnectionAddress>
Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.