Class AppIntercom<T>
java.lang.Object
de.iip_ecosphere.platform.transport.AppIntercom<T>
- Type Parameters:
T- the type of data to be exchanged
Simple app intercom facility. Declare the intercom as attribute and call
#start() in
service start and #stop() in service stop.- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate ReceptionCallback<T> private TransportConnector -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
channel
-
conn
-
commandCallback
-
-
Constructor Details
-
AppIntercom
Creates an intercom class.- Parameters:
channel- the transport channel to useconsumer- the consumer when data is receivedcls- the class of data
-
AppIntercom
Creates an intercom class with default channel name.- Parameters:
consumer- the consumer when data is receivedcls- the class of data
-
-
Method Details
-
start
Start the intercom.- Throws:
ExecutionException- if starting fails
-
stop
public void stop()Stops the intercom. -
asyncSend
Sends data asynchronously.- Parameters:
data- the data- Throws:
IOException- if data cannot be sent
-
syncSend
Sends data synchronously.- Parameters:
data- the data- Throws:
IOException- if data cannot be sent
-