com.sun.sgs.impl.profile.util
Class NetworkReporter

java.lang.Object
  extended by com.sun.sgs.impl.profile.util.NetworkReporter

public final class NetworkReporter
extends Object

A very simple utility class used to report on a socket. This allows any number of clients to connect and listen for text encoded in the platform's default character set encoding. Note that this is intended only as a means for reporting in testing and development systems. In deployment, a more robust mechanism should be used.


Constructor Summary
NetworkReporter(int port)
          Creates an instance of NetworkReporter.
 
Method Summary
 void report(String message)
          Reports the provided message to all connected clients.
 void shutdown()
          Cleans up.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkReporter

public NetworkReporter(int port)
                throws IOException
Creates an instance of NetworkReporter.

Parameters:
port - the port on which to listen for client connections
Throws:
IOException - if the server socket cannot be created
Method Detail

report

public void report(String message)
Reports the provided message to all connected clients. If the message cannot be sent to a given client, then that client is dropped from the set of connected clients.

Parameters:
message - the message to send

shutdown

public void shutdown()
Cleans up.


RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved