|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.demac.transport.TransportService
public abstract class TransportService
This class represents the transport layer of the DEMAC framework. It provides
an asynchronous message delivering service and abstracts from the used
delivering mechanism like TCP/IP, Bluetooth etc. The addressing schema basis
on handles for devices and messages. The transport service selects one of the
available lower transport services which are associated with the receiving device.
Sent and received messages are implementations of the TransportMessage
interface. To be notified of incomming messages the interested object must implement
the org.demac.transport.TransportListener interface and register itself at the transport service.
The transport service also provides methods to inquire DEMAC devices in the neighbourhood.
Constructor Summary | |
---|---|
TransportService()
|
Method Summary | |
---|---|
abstract void |
addDevice(Device device)
Method to add a device manually to the transport service. |
abstract void |
addTransportListener(TransportListener listener)
Method to register an object which implements the org.demac.transport.TransportListener interface at the service. |
abstract void |
detectDevices()
Method to start the inquiary for devices in the neigbourhood. |
abstract TransportMessage |
extractMessage(MessageHandle handle)
Method to get a message from the transport service which has arrived from foreign devices and remove it immediately. |
abstract java.util.Enumeration |
getAllDevices()
Method to get all devices which are known by the transport service. |
abstract DeviceHandle |
getLocalDeviceHandle()
Method to get the org.demac.transport.DeviceHandle of the local device. |
abstract java.lang.String |
getLocalName()
Method to get a user-friendly name of the local device. |
static TransportService |
getTransportService()
Method to get an instance of the DEMAC transport service. |
abstract TransportMessage |
receiveMessage(MessageHandle handle)
Method to get a message from the the transport service which has arrived from foreign devices. |
abstract void |
removeDevice(Device device)
Method to remove a device manually from the transport service. |
abstract void |
removeMessage(MessageHandle handle)
Method to remove a message from the transport service. |
abstract void |
removeTransportListener(TransportListener listener)
Method to remove a registered listener from the transport service. |
abstract void |
sendMessage(TransportMessage msg)
Method to send a message to a device. |
abstract void |
sendMessage(TransportMessage msg,
Constraint[] constraints)
Method to send a message to a device under a set of constraints. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.demac.Service |
---|
isStarted, start, stop |
Constructor Detail |
---|
public TransportService()
Method Detail |
---|
public static TransportService getTransportService()
public abstract java.util.Enumeration getAllDevices() throws TransportException
TransportException
- if the service has not been started before invoking this methodpublic abstract void detectDevices() throws TransportException
TransportException
- if the inquiary can not be startedpublic abstract void sendMessage(TransportMessage msg) throws TransportException
msg
- the message which is to be sent
TransportException
- if the message can not be sent of if the service has not been started.public abstract void sendMessage(TransportMessage msg, Constraint[] constraints) throws TransportException
msg
- the message which is to be sentconstraints
- the set of constraints to fulfill
TransportException
- if the message can not be sentpublic abstract void addTransportListener(TransportListener listener)
listener
- the listener which is to be registerdpublic abstract void removeTransportListener(TransportListener listener)
listener
- the listener which is to be removedpublic abstract TransportMessage receiveMessage(MessageHandle handle) throws MessageNotAvailableException
handle
- the reference of the message
MessageNotAvailableException
- if the message is not available (any more)public abstract void removeMessage(MessageHandle handle) throws MessageNotAvailableException
handle
- the org.demac.transport.MessageHandleassociated to the message
MessageNotAvailableException
- if the message is not available (any more)public abstract TransportMessage extractMessage(MessageHandle handle) throws MessageNotAvailableException
handle
- the reference of the message
MessageNotAvailableException
- if the message is not available (any more)public abstract DeviceHandle getLocalDeviceHandle() throws TransportException
TransportException
- if the service has not been started before invoking this methodpublic abstract java.lang.String getLocalName() throws TransportException
TransportException
- if the service has not been started before invoking this methodpublic abstract void addDevice(Device device) throws TransportException
device
- the device which is to be registered
TransportException
- if the service has not been started before invoking this methodpublic abstract void removeDevice(Device device) throws TransportException
device
- the device which is to be removed
TransportException
- if the service has not been started before invoking this method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |