org.ws4d.java.communication.monitor
Interface StreamMonitor


public interface StreamMonitor

This interfaces allows to assign the message and the given stream.


Method Summary
 void assign(MonitoringContext context, Message message)
          This method will be invoked by the framework if a message is finally built up and should be assigned to the OutputStream created with the getOutputStream method.
 void discard(MonitoringContext context, int discardReason)
           
 void fault(MonitoringContext context, java.lang.Exception e)
          This is a fault method which will be invoked if the framework could not build a correct message object.
 MonitoringContext getMonitoringContext()
           
 java.io.OutputStream getOutputStream()
          A new and shiny OutputStream to write new bytes from incoming or outgoing connections etc.
 void request(MonitoringContext context, URI location)
           
 void resource(MonitoringContext context, Resource resource)
           
 void setMonitoringContext(MonitoringContext context)
           
 

Method Detail

getOutputStream

java.io.OutputStream getOutputStream()
A new and shiny OutputStream to write new bytes from incoming or outgoing connections etc.

Remember: This method should always return the same OutputStream for an individual StreamMonitor because it is used in different parts of the framework.

Returns:
the OutputStream.

setMonitoringContext

void setMonitoringContext(MonitoringContext context)

getMonitoringContext

MonitoringContext getMonitoringContext()

assign

void assign(MonitoringContext context,
            Message message)
This method will be invoked by the framework if a message is finally built up and should be assigned to the OutputStream created with the getOutputStream method.

Parameters:
message - the message which should be assigned to the OutputStream

fault

void fault(MonitoringContext context,
           java.lang.Exception e)
This is a fault method which will be invoked if the framework could not build a correct message object. It is like the assign method, but points to a fault while the message is created.


discard

void discard(MonitoringContext context,
             int discardReason)

resource

void resource(MonitoringContext context,
              Resource resource)

request

void request(MonitoringContext context,
             URI location)