Class Overview
AMQP Protocol Analyzer program. Listens on a port (in-port) and when a
connection arrives, makes an outbound connection to a host and
port (out-port). Relays frames from the in-port to the out-port.
Commands are decoded and printed to a supplied Tracer.Logger
.
The stand-alone program (#main()) prints to
System.out
,
using a private
Tracer.AsyncLogger
instance. When the connection closes
the program listens for a subsequent connection and traces that to the same
Tracer.Logger
.
This continues until the program is interrupted.
Options for controlling, for example, whether command bodies are decoded,
are obtained from
System.properties
, and are reported to the console
before starting the trace.
A
Tracer
object may be instantiated, using one of the constructors
Tracer(int listenPort, String id, String host, int port, Logger logger, Properties props)
Tracer(String id)
Tracer(String id, Properties props)
where the missing parameters default as follows:
listenPort
defaults to 5673
host
defaults to localhost
port
defaults to 5672
logger
defaults to new AsyncLogger(System.out)
and
props
defaults to System.getProperties()
These constructors block waiting for a connection to arrive on the listenPort.
Tracing does not begin until the tracer is
start()
ed which
start()
s
the supplied logger and creates and starts a Thread for relaying and deconstructing the frames.
The properties specified in
props
are used at
start()
time and may be modified
before this call.
Summary
Nested Classes |
class |
Tracer.AsyncLogger |
A Tracer.Logger designed to print Strings to a designated OutputStream
on a private thread. |
interface |
Tracer.Logger |
Logging strings to an outputStream. |
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
java.lang.Runnable
|
Public Constructors
Public Methods
public
void
log
(String message)