at.spardat.xma.baserpc
Class RemoteData

java.lang.Object
  extended byat.spardat.xma.baserpc.RemoteData
Direct Known Subclasses:
ClientToServerData, ServerToClientData

public class RemoteData
extends java.lang.Object

Models the data transferred via BaseRPCs. The main functionality in this class is its ability to serialize and deserialize the data.


Constructor Summary
RemoteData()
           
 
Method Summary
protected  void externalize(XmaOutput o)
          Write the parameters to the XmaOutput.
 java.lang.Object getParameter(int id)
          Retrieves a parameter for a given id.
 int getParameterCount()
          Returns the number of parameters
 java.util.Collection getUnserializableCollection(int id)
          Retrieves a parameter that has been set via setUnserializableCollection.
protected  void internalize(XmaInput in)
          Reads parameters as written by externalizeParameters.
 void setParameter(int id, java.lang.Object parameter)
          Adds a parameter to this
 void setUnserializableCollection(int id, java.util.Collection parameter)
          Like setParameter, except that the provided collection is not serialized itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteData

public RemoteData()
Method Detail

externalize

protected void externalize(XmaOutput o)
                    throws java.io.IOException
Write the parameters to the XmaOutput.

Throws:
java.io.IOException

internalize

protected void internalize(XmaInput in)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException
Reads parameters as written by externalizeParameters.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

setParameter

public void setParameter(int id,
                         java.lang.Object parameter)
Adds a parameter to this

Parameters:
id - a numeric id of the parameter. Must not be less than zero and greater than 127.
parameter - the parameter data which has to implement java.io.Serializable and must be successfully be serialized. It cannot be null.
Throws:
java.lang.IllegalArgumentException - if any before mentioned condition is violated.

setUnserializableCollection

public void setUnserializableCollection(int id,
                                        java.util.Collection parameter)
Like setParameter, except that the provided collection is not serialized itself. Instead, only the elements of the collection are serialized. The corresponding get-call (getUnserializableCollection) must be used to retrieve the collection.


getParameter

public java.lang.Object getParameter(int id)
Retrieves a parameter for a given id.

Parameters:
id - the id that has been used in setParameter.
Returns:
the same object set via setParameter or null if there is no parameter with the given id.

getUnserializableCollection

public java.util.Collection getUnserializableCollection(int id)
Retrieves a parameter that has been set via setUnserializableCollection. Please note that the type returned need not be the one provided via setUnserializableCollection. In fact, you cannot make any assumptions regarding the returned type beyond beeing a Collection.

Returns:
null if no such parameter

getParameterCount

public int getParameterCount()
Returns the number of parameters