Version: 1.1.1

org.biomoby.client
Class MobyRequestEvent

java.lang.Object
  extended by org.biomoby.client.MobyRequestEvent

public class MobyRequestEvent
extends Object

This is the event passed to a MobyRequestEventHandler, representing either data for a request for service, or the data from a service response depending on whether the listener registered itself in a client or server.


Constructor Summary
MobyRequestEvent(MobyContentInstance mci, MobyRequest requestSource, MobyService serv, MobyContentInstance serviceInput, Throwable e, int id)
           
 
Method Summary
 void consume()
          Especially useful in that case that there is more than one listener to MobyRequest, denotes that the request has been processed by a listener, and therefore other listeners should probably ignore.
 MobyContentInstance getContent()
           
 String getContentsXML()
           
 Throwable getException()
          If an invocation failed, the exception that caused the failure will be in here.
 int getID()
           
 MobyService getService()
           
 MobyRequest getSource()
           
 MobyContentInstance getSourceInput()
          This method should be used instead of getSource().getInput() because the MobyRequest object may have multiple concurrent threads using it, meaning that the inputXML is not necessarily what it was when the service was invoked.
 boolean isConsumed()
           
 void setContent(MobyContentInstance mci)
          If you are a service provider who got this event through a callback (client connection), this is where you would write the output, which also denotes that you are finished with client communication (anything done after calling this method will be ignore).
 void setContentsXML(String xml)
           
 void setException(Throwable e)
          If you are a service provider and cannot execute the service properly, setting an exception here will inform the client of the failure with a proper MOBY message, and terminate the communication.
 void setSourceInput(MobyContentInstance inputPayload)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MobyRequestEvent

public MobyRequestEvent(MobyContentInstance mci,
                        MobyRequest requestSource,
                        MobyService serv,
                        MobyContentInstance serviceInput,
                        Throwable e,
                        int id)
Method Detail

getService

public MobyService getService()
Returns:
the name of the remote service generating the event

getSourceInput

public MobyContentInstance getSourceInput()
This method should be used instead of getSource().getInput() because the MobyRequest object may have multiple concurrent threads using it, meaning that the inputXML is not necessarily what it was when the service was invoked.

Returns:
if a Moby client waiting for a service response, this data is the payload given as input to the service

setSourceInput

public void setSourceInput(MobyContentInstance inputPayload)
Parameters:
inputPayload - the Moby message envelope sent to the service this event is refering to.

getContent

public MobyContentInstance getContent()
Returns:
the contents of the MOBY request or response (depending on whether MobyRequest is acting as a client or server)

setContent

public void setContent(MobyContentInstance mci)
If you are a service provider who got this event through a callback (client connection), this is where you would write the output, which also denotes that you are finished with client communication (anything done after calling this method will be ignore).


getID

public int getID()
Returns:
an autogenerated ID unique to this event instance within the JVM

getException

public Throwable getException()
If an invocation failed, the exception that caused the failure will be in here. A sucessful invocation will return null here.


setException

public void setException(Throwable e)
If you are a service provider and cannot execute the service properly, setting an exception here will inform the client of the failure with a proper MOBY message, and terminate the communication. Anything done after this method is called will be ignored.


getSource

public MobyRequest getSource()

getContentsXML

public String getContentsXML()

setContentsXML

public void setContentsXML(String xml)

consume

public void consume()
Especially useful in that case that there is more than one listener to MobyRequest, denotes that the request has been processed by a listener, and therefore other listeners should probably ignore.


isConsumed

public boolean isConsumed()

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010