Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

mobile.protocol
Class Request  view Request download Request.java

java.lang.Object
  extended bymobile.protocol.Frame
      extended bymobile.protocol.Request
All Implemented Interfaces:
mobile.bearer.http.Protocol

public class Request
extends Frame

This class provides implementation of message sent to the proxy server. This message represents an action such as a call of a JMS or JNDI method.


Field Summary
 int rms_id
           Id of the RMS record containing this Request.
 
Fields inherited from class mobile.protocol.Frame
code, id, owner
 
Fields inherited from interface mobile.bearer.http.Protocol
ACKNOWLEDGE_MESSAGE, CLOSE_CONNECTION, CLOSE_MESSAGE_CONSUMER, CLOSE_MESSAGE_PRODUCER, COMMIT, CREATE_CONNECTION, CREATE_DURABLE_CONSUMER, CREATE_DURABLE_TOPIC_SUBSCRIBER, CREATE_QUEUE_CONNECTION, CREATE_QUEUE_RECEIVER, CREATE_QUEUE_SENDER, CREATE_QUEUE_SESSION, CREATE_RECEIVER, CREATE_SENDER, CREATE_SESSION, CREATE_TEMPORARY_DESTINATION, CREATE_TEMPORARY_QUEUE, CREATE_TEMPORARY_TOPIC, CREATE_TOPIC_CONNECTION, CREATE_TOPIC_PUBLISHER, CREATE_TOPIC_SESSION, CREATE_TOPIC_SUBSCRIBER, DELETE_TEMPORARY_DESTINATION, DELETE_TEMPORARY_QUEUE, DELETE_TEMPORARY_TOPIC, EXC_INVALID_DESTINATION, EXC_NAMING, EXC_OTHER, EXC_RESOURCE_ALLOCATION, INT_LEN, LONG_LEN, LOOKUP, MAX_BYTES_LEN, PUBLISH_BYTES_MESSAGE, PUBLISH_TEXT_MESSAGE, QUEUE, RECEIVE_MESSAGE, RECEIVE_MESSAGE_FROM_QUEUE, RECEIVE_MESSAGE_FROM_TOPIC, RECEIVE_MESSAGE_TIMEOUT, REP_BYTES_MESSAGE, REP_BYTES_MESSAGE_FROM_QUEUE, REP_BYTES_MESSAGE_FROM_TOPIC, REP_CONNECTION, REP_CONNECTION_FACTORY, REP_DURABLE_TOPIC_SUBSCRIBER, REP_QUEUE, REP_QUEUE_CONNECTION, REP_QUEUE_CONNECTION_FACTORY, REP_QUEUE_RECEIVER, REP_QUEUE_SENDER, REP_QUEUE_SESSION, REP_RECEIVER, REP_SENDER, REP_SESSION, REP_TEMPORARY_DESTINATION, REP_TEMPORARY_QUEUE, REP_TEMPORARY_TOPIC, REP_TEXT_MESSAGE, REP_TEXT_MESSAGE_FROM_QUEUE, REP_TEXT_MESSAGE_FROM_TOPIC, REP_TOPIC, REP_TOPIC_CONNECTION, REP_TOPIC_CONNECTION_FACTORY, REP_TOPIC_PUBLISHER, REP_TOPIC_SESSION, REP_TOPIC_SUBSCRIBER, ROLLBACK, SEND_BYTES_MESSAGE, SEND_TEXT_MESSAGE, START_CONNECTION, STOP_CONNECTION, TEMPRORARY, TOPIC
 
Constructor Summary
  Request()
           A default constructor for this class.
(package private) Request(byte[] msg)
           A constructor used to recreate the request from the byte array form used, when the request is stored in the record store
 
Method Summary
private  java.lang.Boolean byteToBool(byte[] tab, int offset)
           Converts a byte from tab starting at offset into an Boolean object
private  int byteToInt(byte[] tab, int offset)
           Converts four consecutive bytes of tab starting at offset into an int value
private  long byteToLong(byte[] tab, int offset)
           Converts eight consecutive bytes of tab starting at offset into a long value
private  void copyBytes(byte[] source, byte[] dest, int offset, int len)
           Copies len bytes from source to dest beginning from offset in the dest and from the begining in the source
private  void copyBytesRMS(byte[] source, byte[] dest, int offset, int len)
           Copies len bytes from source to dest beginning from offset in the source and from the begining in the dest
private  void intToByte(int anInt, byte[] tab, int offset)
           Converts an int value into 4 bytes and puts them into the tab beginning at the given offset
private  void log(java.lang.String msg)
          logs a debuging message
private  void longToByte(long aLong, byte[] tab, int offset)
           Converts a long value into 8 bytes and puts them into the tab beginning at the given offset
 byte[] rmsSerialize()
           Converts this message to a byte array.
 byte[] serialize()
           Converts this message to a byte array.
 
Methods inherited from class mobile.protocol.Frame
getData, getNext, getPrev, setData, setNext, setPrev
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rms_id

public int rms_id

Id of the RMS record containing this Request. Some records are stored in the RMS to ensure reliability of message sending.

Constructor Detail

Request

Request(byte[] msg)

A constructor used to recreate the request from the byte array form used, when the request is stored in the record store


Request

public Request()

A default constructor for this class.

Method Detail

log

private void log(java.lang.String msg)
logs a debuging message


intToByte

private void intToByte(int anInt,
                       byte[] tab,
                       int offset)

Converts an int value into 4 bytes and puts them into the tab beginning at the given offset


longToByte

private void longToByte(long aLong,
                        byte[] tab,
                        int offset)

Converts a long value into 8 bytes and puts them into the tab beginning at the given offset


copyBytes

private void copyBytes(byte[] source,
                       byte[] dest,
                       int offset,
                       int len)

Copies len bytes from source to dest beginning from offset in the dest and from the begining in the source


serialize

public byte[] serialize()

Converts this message to a byte array. All objects associated with this request are converted to their byte representation.


rmsSerialize

public byte[] rmsSerialize()

Converts this message to a byte array. All objects associated with this request are converted to their byte representation. All request attributes are also stored in the array.

It is used when the request is stored in the record store.


copyBytesRMS

private void copyBytesRMS(byte[] source,
                          byte[] dest,
                          int offset,
                          int len)

Copies len bytes from source to dest beginning from offset in the source and from the begining in the dest


byteToInt

private int byteToInt(byte[] tab,
                      int offset)

Converts four consecutive bytes of tab starting at offset into an int value


byteToLong

private long byteToLong(byte[] tab,
                        int offset)

Converts eight consecutive bytes of tab starting at offset into a long value


byteToBool

private java.lang.Boolean byteToBool(byte[] tab,
                                     int offset)

Converts a byte from tab starting at offset into an Boolean object