org.spicefactory.cinnamon.service
Class ServiceRequest

java.lang.Object
  extended by org.spicefactory.cinnamon.service.ServiceMessage
      extended by org.spicefactory.cinnamon.service.ServiceRequest
All Implemented Interfaces:
Externalizable
Direct Known Subclasses:
ServiceRequestProxy

public class ServiceRequest
extends ServiceMessage

Represents a single service request. All information needed for a service invocation is encapsulated in this single instance. It is usually the only object sent in a Cinnamon AMF3 request.

Author:
Jens Halm

Constructor Summary
ServiceRequest()
          Creates a new ServiceRequest.
ServiceRequest(String serviceName, String operationName, Object[] parameters)
          Creates a new ServiceRequest.
 
Method Summary
 String getOperationName()
          The name of the operation to invoke.
 Object[] getParameters()
          The method parameters.
 String getServiceName()
          The name of the service to invoke.
 void readExternal(DataInput in)
          Restores the content of this object from the DataInput instance.
 void setParameters(Object[] parameters)
          Sets the parameters to use for the service invocation.
 String toString()
           
 void writeExternal(DataOutput out)
          Saves the content of this object to the DataOutput instance.
 
Methods inherited from class org.spicefactory.cinnamon.service.ServiceMessage
getHeaderNames, getHeaderValue, removeHeader, setHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceRequest

public ServiceRequest()
Creates a new ServiceRequest. Default Constructor needed for instances that will be constructed on the client and deserialized on the server side.


ServiceRequest

public ServiceRequest(String serviceName,
                      String operationName,
                      Object[] parameters)
Creates a new ServiceRequest.

Parameters:
serviceName - the name of the service
operationName - the name of the operation
parameters - the method parameters
Method Detail

getServiceName

public String getServiceName()
The name of the service to invoke.

Returns:
the name of the service to invoke

getOperationName

public String getOperationName()
The name of the operation to invoke.

Returns:
the name of the operation to invoke

getParameters

public Object[] getParameters()
The method parameters. The returned array is not a clone of the parameter array, so any changes made to the array by a ServiceInterceptor will affect the following service invocation. At the time a ServiceInterceptor gets invoked, any necessary type conversion has not been done yet.

Returns:
the method parameters

setParameters

public void setParameters(Object[] parameters)
Sets the parameters to use for the service invocation. Interceptors or the ServiceMessageProcessor have the opportunity to overwrite the parameters sent by the client.

Parameters:
parameters - the parameters to use for the service invocation

readExternal

public void readExternal(DataInput in)
Description copied from interface: Externalizable
Restores the content of this object from the DataInput instance. Values must be read in the same sequence as they were written on the client side.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class ServiceMessage
Parameters:
in - the AMF3 data to read from

writeExternal

public void writeExternal(DataOutput out)
Description copied from interface: Externalizable
Saves the content of this object to the DataOutput instance.

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class ServiceMessage
Parameters:
out - the output to write to

toString

public String toString()
Overrides:
toString in class Object