Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-03


oracle.svcmsg
Class ServiceMessage

java.lang.Object
  extended by oracle.svcmsg.ServiceMessage

All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
JboServiceMessage

public class ServiceMessage
extends java.lang.Object
implements java.io.Serializable

This class carries service message that contains either requests from SvcMsgSender to SvcMsgReceiver, or returning responses from SvcMsgReceiver to SvcMsgSender.

Requests and responses must be serializable objects (java.io.Serializable). Usually requests are objects that implement oracle.svcmsg.Request and responses those that implement oracle.svcmsg.Response.

See Also:
Serialized Form

Constructor Summary
ServiceMessage()
          Constructs a blank service message.
ServiceMessage(java.lang.String name)
          Constructs a blank service message with the given name.

 

Method Summary
 void addRequest(java.io.Serializable req)
          Adds a request to the request list.
 void addRequestWithKey(java.lang.Object key, java.io.Serializable req)
          Adds a request to the request list and then puts it in the by-key hash map.
 void addResponse(java.io.Serializable res)
          Adds a request to the response list.
 void addResponseWithKey(java.lang.Object key, java.io.Serializable res)
          Adds a response to the response list and then puts it in the by-key hash map.
 void clear()
          Clears the service message.
protected  void clearEntries()
          Clears request and response arrays.
 ServiceMessage copyTo(ServiceMessage copy)
          Copies the content of this message to copy.
 java.lang.String getName()
          Returns the service message name.
 java.io.Serializable getRequestByKey(java.lang.Object key)
          Gets the request by its key.
 java.util.List getRequests()
          Returns the requests as a List.
 java.io.Serializable getResponseByKey(java.lang.Object key)
          Gets the response by its key.
 java.util.List getResponses()
          Returns the responses as a List.
 void insertReponseWityKey(int index, java.lang.Object key, java.io.Serializable res)
          Inserts a response at a specific index position and then puts it in the by-key hash map.
 void insertRequest(int index, java.io.Serializable req)
          Inserts a request at a specific index position.
 void insertRequestWithKey(int index, java.lang.Object key, java.io.Serializable req)
          Inserts a request at a specific index position and then puts it in the by-key hash map.
 void insertResponse(int index, java.io.Serializable res)
          Inserts a response at a specific index position.
 void removeRequest(int index)
          Removes the request at the specified postion.
 void removeRequestByKey(java.lang.Object key)
          Removes the request by its key.
 void removeResponse(int index)
          Removes the response at the specified postion.
 void removeResponseByKey(java.lang.Object key)
          Removes the response by its key.
 java.util.Iterator requestElements()
          Returns an iterator through request objects from the by-key hash map.
 java.util.Iterator requestKeys()
          Returns an iterator through request keys of the by-key hash map.
 java.util.Iterator responseElements()
          Returns an iterator through response objects from the by-key hash map.
 java.util.Iterator responseKeys()
          Returns an iterator through response keys of the by-key hash map.
 void setName(java.lang.String name)
          Sets the service message name.
protected  void setRequests(java.util.List requests)
          Sets the request array list.
protected  void setResponses(java.util.List responses)
          Sets the response array list.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ServiceMessage

public ServiceMessage()
Constructs a blank service message.

ServiceMessage

public ServiceMessage(java.lang.String name)
Constructs a blank service message with the given name.
Parameters:
name - the service message name.

Method Detail

getName

public java.lang.String getName()
Returns the service message name.
Returns:
the service message name. May be null if a name was not given to the service message.

setName

public void setName(java.lang.String name)
Sets the service message name.
Parameters:
name - the service message name.

clearEntries

protected void clearEntries()
Clears request and response arrays. It also clears hash maps that manage request and response keys. It does not clear the service message name.

clear

public void clear()
Clears the service message. It first calls clearEntries() to clear requests/responses. Then, it resets the service message name to null.

copyTo

public ServiceMessage copyTo(ServiceMessage copy)
Copies the content of this message to copy. It copies requests, responses, and the name.
Parameters:
copy - the destination of the copy operation.
Returns:
the copy object.

getRequests

public java.util.List getRequests()
Returns the requests as a List.
Returns:
the requests.

getResponses

public java.util.List getResponses()
Returns the responses as a List.
Returns:
the responses.

setRequests

protected void setRequests(java.util.List requests)
Sets the request array list.
Parameters:
requests - the request list to set the service message's request array list.

setResponses

protected void setResponses(java.util.List responses)
Sets the response array list.
Parameters:
responses - the response list to set the service message's response array list.

addRequest

public void addRequest(java.io.Serializable req)
Adds a request to the request list.
Parameters:
req - the request object.

addRequestWithKey

public void addRequestWithKey(java.lang.Object key,
                              java.io.Serializable req)
Adds a request to the request list and then puts it in the by-key hash map.
Parameters:
key - the request key.
req - the request object.

addResponse

public void addResponse(java.io.Serializable res)
Adds a request to the response list.
Parameters:
res - the response object.

addResponseWithKey

public void addResponseWithKey(java.lang.Object key,
                               java.io.Serializable res)
Adds a response to the response list and then puts it in the by-key hash map.
Parameters:
key - the response key.
res - the response object.

getRequestByKey

public java.io.Serializable getRequestByKey(java.lang.Object key)
Gets the request by its key.
Returns:
the request object. null if the key is not found.

getResponseByKey

public java.io.Serializable getResponseByKey(java.lang.Object key)
Gets the response by its key.
Returns:
the response object. null if the key is not found.

insertRequest

public void insertRequest(int index,
                          java.io.Serializable req)
Inserts a request at a specific index position.
Parameters:
index - the index at which the request is to be inserted.
req - the request object.

insertRequestWithKey

public void insertRequestWithKey(int index,
                                 java.lang.Object key,
                                 java.io.Serializable req)
Inserts a request at a specific index position and then puts it in the by-key hash map.
Parameters:
index - the index at which the request is to be inserted.
key - the request key.
req - the request object.

insertResponse

public void insertResponse(int index,
                           java.io.Serializable res)
Inserts a response at a specific index position.
Parameters:
index - the index at which the response is to be inserted.
res - the response object.

insertReponseWityKey

public void insertReponseWityKey(int index,
                                 java.lang.Object key,
                                 java.io.Serializable res)
Inserts a response at a specific index position and then puts it in the by-key hash map.
Parameters:
index - the index at which the response is to be inserted.
key - the response key.
res - the response object.

removeRequest

public void removeRequest(int index)
Removes the request at the specified postion.
Parameters:
index - the position at which the request is to be removed.

removeRequestByKey

public void removeRequestByKey(java.lang.Object key)
Removes the request by its key.
Parameters:
key - the request key.

removeResponse

public void removeResponse(int index)
Removes the response at the specified postion.
Parameters:
index - the position at which the response is to be removed.

removeResponseByKey

public void removeResponseByKey(java.lang.Object key)
Removes the response by its key.
Parameters:
key - the response key.

requestKeys

public java.util.Iterator requestKeys()
Returns an iterator through request keys of the by-key hash map.
Returns:
the iterator.

requestElements

public java.util.Iterator requestElements()
Returns an iterator through request objects from the by-key hash map.
Returns:
the iterator.

responseKeys

public java.util.Iterator responseKeys()
Returns an iterator through response keys of the by-key hash map.
Returns:
the iterator.

responseElements

public java.util.Iterator responseElements()
Returns an iterator through response objects from the by-key hash map.
Returns:
the iterator.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-03


Copyright © 1997, 2009, Oracle. All rights reserved.