public class DummyTransportTrx extends AbstractDaemon implements Transport
Constructor and Description |
---|
DummyTransportTrx(String section)
Constructor to set up a dummy endpoint with named id and blender.
|
DummyTransportTrx(String id,
TransportReceiver blender)
Constructor to set up a dummy endpoint with named id and blender.
|
DummyTransportTrx(TransportReceiver blender)
Constructor to create an endpoint with a random id.
|
Modifier and Type | Method and Description |
---|---|
static void |
clearDummyEndpoints()
Remove all Dummy endpoints from the main listing.
|
void |
sendMessage(String address,
InputStream is)
send a message to another dummy endpoint.
|
static void |
setClusterName(String newName)
Sets the name of the cluster instance.
|
static boolean |
setLocalMode(boolean lm)
Set local only mode for dummy transport.
|
void |
shutdownDaemon()
Shuts this class down.
|
startDaemon, stopDaemon
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
startDaemon, stopDaemon
public DummyTransportTrx(String section) throws IOException
Constructor to set up a dummy endpoint with named id and blender.
section
- section containing data to set up endpointIOException
- if endpoint id is already definedpublic DummyTransportTrx(String id, TransportReceiver blender) throws IOException
Constructor to set up a dummy endpoint with named id and blender.
id
- ID of the endpointblender
- blender to be used for received messagesIOException
- if endpoint id is already definedpublic DummyTransportTrx(TransportReceiver blender) throws IOException
blender
- reference to the respective blender layerIOException
- if thread problems occurpublic static void setClusterName(String newName) throws IOException
Sets the name of the cluster instance.
newName
- the new Name of the instance to connect to.IOException
- if the cluster is already initializedpublic static boolean setLocalMode(boolean lm) throws IOException
Set local only mode for dummy transport.
lm
- true if local mode should be setIOException
- if cluster is already initializedpublic void shutdownDaemon()
RunningDaemon
Shuts this class down.
This frees all resources and ends all threads for an application or layer shutdown. It is not possible to call start() after running shutdown().
shutdownDaemon
in interface RunningDaemon
shutdownDaemon
in class AbstractDaemon
public void sendMessage(String address, InputStream is) throws IOException
send a message to another dummy endpoint.
FIXME: This only works for local messages
sendMessage
in interface TransportSender
address
- the string representation of the target address on the transport layeris
- the input stream to be sentIOException
- if requested endpoint id is unknownpublic static void clearDummyEndpoints()
Remove all Dummy endpoints from the main listing.
Copyright © 2023. All rights reserved.