public abstract class AbstractTransport extends Object implements TransportLayer
TransportLayer which looks after the
addition of common metadata to each inbound Transportable.| Constructor and Description |
|---|
AbstractTransport() |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Sets isConnected() to false, then calls doConnect(), then sets isConnected() to
true.
|
void |
disconnect()
Drops any existing connection to the remote server.
|
abstract void |
doConnect()
Performs connection as described in TransportLayer.connect().
|
abstract void |
doDisconnect()
Performs disconnection as described in TransportLayer.disconnect().
|
abstract Transportable |
doReceive()
Called by receive(), which then adds common metadata.
|
abstract void |
doSend(Transportable theMessage)
The method send() delegates to this method after checking whether we are
connected.
|
Map<String,Object> |
getCommonMetadata() |
boolean |
isConnected() |
Transportable |
receive()
Delegates to
doReceive() and adds common metadata
to the resulting Transportable before it is returned. |
void |
send(Transportable theMessage)
Delegates to
doSend() after checking that we are connected. |
public AbstractTransport()
public Map<String,Object> getCommonMetadata()
getCommonMetadata in interface TransportLayerTransportLayer.getCommonMetadata()public Transportable receive() throws TransportException
doReceive() and adds common metadata
to the resulting Transportable before it is returned.receive in interface TransportLayerTransportExceptionpublic abstract Transportable doReceive() throws TransportException
TransportExceptionpublic void send(Transportable theMessage) throws TransportException
doSend() after checking that we are connected.send in interface TransportLayertheMessage - the message to sendTransportExceptionTransportLayer.send(Transportable)public abstract void doSend(Transportable theMessage) throws TransportException
theMessage - TransportExceptionpublic void connect() throws TransportException
connect in interface TransportLayerTransportExceptionTransportLayer.connect()public abstract void doConnect() throws TransportException
TransportExceptionpublic boolean isConnected()
isConnected in interface TransportLayerTransportLayer.isConnected()public void disconnect() throws TransportException
TransportLayerdisconnect in interface TransportLayerTransportExceptionTransportLayer.disconnect()public abstract void doDisconnect() throws TransportException
TransportExceptionCopyright © 2001–2017 University Health Network. All rights reserved.