Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

xmog_remote_message Class Reference

A class that provides services for creating message packages or decoding message packages. More...

#include <xmog_remote_message.h>

List of all members.

Public Types

enum  xmog_message_id {
  NONE = 0, SIGN_ON = 1, SIGN_ON_STATUS = 2, THREAD_ID_REQUEST = 3,
  THREAD_ID_ASSIGNMENT = 4, THREAD_TERMINATED = 5, SESSION_TERMINATED = 6, DROP_OBJECT_REFS = 7,
  CLASS_INFO_REQUEST = 11, CLASS_INFO_RESPONSE = 12, MEMBER_IDS_REQUEST = 13, MEMBER_IDS_ASSIGNMENT = 14,
  METHOD_CALL = 15, METHOD_RETURN = 16, GET_FIELD_REQUEST = 17, GET_FIELD_RESPONSE = 18,
  SET_FIELD_REQUEST = 19, SET_FIELD_RESPONSE = 20, CONSTRUCTOR_CALL = 21, CONSTRUCTOR_RETURN = 22
}
 The message types that are used in the framework.
enum  xmog_signon_status { STATUS_OK = 0, STATUS_NO_NEW_SESSIONS = 1, STATUS_NOT_AUTHORIZED = 2, STATUS_SHUTTING_DOWN = 3 }
 The signon request reply codes used by the server.

Public Member Functions

 xmog_remote_message (size_t size=512)
int get_iovecs (iovec *vec)
 Returns the number of entries in the iovec[].
void * body () const
 Returns the message body.
void prependLength ()
 Prepends the message length to the message.
void writeBoolean (bool b)
 Appends a bool to the message.
bool readBoolean ()
 Reads a bool from the message.
void writeByte (jbyte b)
 Appends a byte to the message.
jbyte readByte ()
 Reads a byte from the message.
void writeChar (jchar c)
 Appends a jchar to the message.
jchar readChar ()
 Reads a jchar from the message.
void writeDouble (jdouble d)
 Appends a jdouble to the message.
jdouble readDouble ()
 Reads a jdouble from the message.
void writeFloat (jfloat d)
 Appends a jfloat to the message.
jfloat readFloat ()
 Reads a jfloat from the message.
void writeInt (jint i)
 Appends a 32bit integer to the message.
jint readInt ()
 Reads a 32bit integer from the message.
void writeShort (jshort s)
 Appends a 16bit integer to the message.
jshort readShort ()
 Reads a 16bit integer from the message.
void writeString (const char *str, size_t len=(size_t)-1)
 Appends a platform string to the message.
void writeString (const XMOG_WCHAR *str, size_t len=(size_t)-1)
 Appends a wide string to the message.
void writeUTF (const char *utf, size_t len=(size_t)-1)
 Appends a UTF string to the message.
int getMessageCode (int &code)
 Retrieves the message code.
int getSignOnReplyCode (int &code)
 Retrieves the sign-on reply code.
void dump ()

Static Public Member Functions

static xmog_remote_messagecreateSignOnMessage (const char *serverAppNameUTF, const char *clientDisplayNameUTF=NULL, bool alignDataForClient=true, const char *clientSignOnNameUTF=NULL, const char *clientCredentialsUTF=NULL, int authenticationType=0)
 Returns a dynamically allocated, fully initialized message object that can be used to sign on to the server.
static xmog_remote_messagecreateSignOffMessage ()
 Returns a dynamically allocated, fully initialized message object that can be used to sign off the server.
static xmog_remote_messagecreateMemberIDsRequestMessage (xmog_java_class *_clazz)
 Returns a dynamically allocates, fully initialized message object that can be used to query the member ids.
static xmog_remote_messagecreateMessage (void *body)
 Returns a message that represents a server's reply to a client request.


Detailed Description

A class that provides services for creating message packages or decoding message packages.


Member Function Documentation

void* xmog_remote_message::body  )  const
 

Returns the message body.

The message body is an opaque handle to the message content. It is currently implemented as an ACE_Message_Block pointer, but that is an implementation detail that shouldn't be relied upon by a user.

static xmog_remote_message* xmog_remote_message::createMemberIDsRequestMessage xmog_java_class _clazz  )  [static]
 

Returns a dynamically allocates, fully initialized message object that can be used to query the member ids.

Parameters:
_clazz the proxy type for which we're asking for an ID and member IDs.

static xmog_remote_message* xmog_remote_message::createMessage void *  body  )  [static]
 

Returns a message that represents a server's reply to a client request.

Parameters:
the message body as an ACE_Message_Block pointer.

static xmog_remote_message* xmog_remote_message::createSignOnMessage const char *  serverAppNameUTF,
const char *  clientDisplayNameUTF = NULL,
bool  alignDataForClient = true,
const char *  clientSignOnNameUTF = NULL,
const char *  clientCredentialsUTF = NULL,
int  authenticationType = 0
[static]
 

Returns a dynamically allocated, fully initialized message object that can be used to sign on to the server.

Parameters:
serverAppNameUTF The server can host more than one logical application, each of which is identified by a unique name. A logical application maps to a directory in the server's application root directory. This directory contains all information necessary to initialize the the application. If NULL or the empty string is used here, a default application is used.
clientDisplayNameUTF The name under which the session is known on the server. This name is mostly useful for debugging and identifying a particular session in the server monitoring console.
alignDataForClient A flag governing whether message data should be aligned or not.
clientSignOnNameUTF The username for autenticated login.
clientCredentialsUTF The credentials used for authenticated login.
authenticationType An index used to select an authentication mechanism.

int xmog_remote_message::get_iovecs iovec *  vec  ) 
 

Returns the number of entries in the iovec[].

Parameters:
vec the iovec that will be filled with the message contents.

jint xmog_remote_message::readInt  ) 
 

Reads a 32bit integer from the message.

This method converts the number from network to host order.

jshort xmog_remote_message::readShort  ) 
 

Reads a 16bit integer from the message.

This method converts the number from network to host order.

void xmog_remote_message::writeInt jint  i  ) 
 

Appends a 32bit integer to the message.

This method converts the number from host to network order.

void xmog_remote_message::writeShort jshort  s  ) 
 

Appends a 16bit integer to the message.

This method converts the number from host to network order.

void xmog_remote_message::writeString const XMOG_WCHAR *  str,
size_t  len = (size_t)-1
 

Appends a wide string to the message.

This method converts the wide string to UTF before appending it to the message.

Parameters:
str a string in platform encoding.
len the optional number of characters to encode. The default is -1, which stands for all characters. Notice that the argument is the number of characters, not the number of bytes.

void xmog_remote_message::writeString const char *  str,
size_t  len = (size_t)-1
 

Appends a platform string to the message.

This method converts the platform string to UTF before appending it to the message.

Parameters:
str a string in platform encoding.
len the optional number of characters to encode. The default is -1, which stands for all characters.

void xmog_remote_message::writeUTF const char *  utf,
size_t  len = (size_t)-1
 

Appends a UTF string to the message.

Parameters:
str a string in UTF encoding. In many cases, developers can directly use this method, which is much faster than the corresponding writeString() methods because no conversion has to be performed.
len the optional number of characters to encode. The default is -1, which stands for all characters.


The documentation for this class was generated from the following file:
Generated on Wed May 31 14:01:35 2006 for Shared Codemesh Runtime Library API Reference by  doxygen 1.4.1