au.com.loftinspace.tcpreflector
Class TcpReflectorExecutor
java.lang.Object
au.com.loftinspace.tcpreflector.TcpReflectorExecutor
- public class TcpReflectorExecutor
- extends java.lang.Object
The TcpReflectorExecutor is a convenience class for the starting and stopping
of TcpReflector instances. If you do not require thread level control of the TcpReflector
then this is the object for you.
Typical unit test usage would be:
TcpReflectorExecutor executor = new TcpReflectorExecutor(tcpReflector);
executor.start(); // blocks until tcpReflector has initialised.
// perform socket communications
executor.stop(); // block until tcpReflector has terminated.
try {
// perform socket communciations
fail("Expected SomeExpectedIOBasedException);
} catch(SomeExpectedIOBasedException e) {
}
executor.start(); // blocks until tcpReflector has initialised again.
// perform socket communications and ensure reconnection is OK.
Author: Jem Mawson
Date: 22/07/2004
Time: 22:10:35
|
Constructor Summary |
TcpReflectorExecutor(int listeningPort,
java.net.InetSocketAddress destination)
|
TcpReflectorExecutor(int listeningPort,
java.net.InetSocketAddress destination,
java.util.List packetListeners)
Constructs a new instance of an executor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TcpReflectorExecutor
public TcpReflectorExecutor(int listeningPort,
java.net.InetSocketAddress destination,
java.util.List packetListeners)
- Constructs a new instance of an executor.
- Parameters:
listeningPort - The local port number to connect to the TcpReflector.destination - The destination internet address for connections.packetListeners - A list of PacketListeners to be added to the TcpReflector.
TcpReflectorExecutor
public TcpReflectorExecutor(int listeningPort,
java.net.InetSocketAddress destination)
allowConnections
public void allowConnections(boolean allow)
throws java.io.IOException
- Throws:
java.io.IOException
allowResponsePassage
public void allowResponsePassage(boolean comms)
- Whether the reflector should allow
- Parameters:
comms -
Copyright © 2004 Loft in Space. All Rights Reserved.