ServiceMessage Class Reference

#include <ServiceMessage.hpp>

Inheritance diagram for ServiceMessage:
[legend]

Public Types

enum  { NAMESIZE = 256 }
 

Public Member Functions

 ServiceMessage ()
 
 ~ServiceMessage ()
 
void setResult (ServiceReturn code)
 
void setExceptionInfo (ErrorCode error, const char *message)
 
void setExceptionInfo (ServiceException *e)
 
void clearExceptionInfo ()
 
void raiseServerError ()
 
char * getArgumentName ()
 
void clearMessageData ()
 
void * getMessageData ()
 
size_t getMessageDataLength ()
 
void transferMessageData (RXSTRING &data)
 
void setMessageData (void *data, size_t length)
 
void * allocateMessageData (size_t length)
 
void freeMessageData ()
 
void readMessage (SysServerConnection *server)
 
void writeResult (SysServerConnection *server)
 
void writeMessage (SysClientStream &server)
 
void readResult (SysClientStream &server)
 

Static Public Member Functions

static void * allocateResultMemory (size_t length)
 
static void releaseResultMemory (void *mem)
 

Public Attributes

ServerManager messageTarget
 
ServerOperation operation
 
SessionID session
 
uintptr_t parameter1
 
uintptr_t parameter2
 
uintptr_t parameter3
 
uintptr_t parameter4
 
uintptr_t parameter5
 
ServiceReturn result
 
ErrorCode errorCode
 
void * messageData
 
size_t messageDataLength
 
bool retainMessageData
 
char nameArg [NAMESIZE]
 
char userid [MAX_USERID_LENGTH]
 

Detailed Description

Definition at line 282 of file ServiceMessage.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NAMESIZE 

Definition at line 285 of file ServiceMessage.hpp.

Constructor & Destructor Documentation

◆ ServiceMessage()

◆ ~ServiceMessage()

ServiceMessage::~ServiceMessage ( )
inline

Definition at line 291 of file ServiceMessage.hpp.

Member Function Documentation

◆ allocateMessageData()

void* ServiceMessage::allocateMessageData ( size_t  length)
inline

◆ allocateResultMemory()

void * ServiceMessage::allocateResultMemory ( size_t  length)
static

Allocate a buffer for result information returned by a service message. This is allocated using the Rexx API allocation routine so that the memory can be handed out and deallocated by an API caller.

Parameters
lengthThe length to allocate.
Returns
A data pointer with the result memory.

Definition at line 226 of file ServiceMessage.cpp.

References SysAPIManager::allocateMemory(), and MEMORY_ERROR.

Referenced by allocateMessageData(), readMessage(), and readResult().

◆ clearExceptionInfo()

void ServiceMessage::clearExceptionInfo ( )
inline

Definition at line 315 of file ServiceMessage.hpp.

References errorCode, MESSAGE_OK, NO_ERROR_CODE, and result.

◆ clearMessageData()

void ServiceMessage::clearMessageData ( )
inline

◆ freeMessageData()

◆ getArgumentName()

char* ServiceMessage::getArgumentName ( )
inline

Definition at line 331 of file ServiceMessage.hpp.

References dupString(), and nameArg.

◆ getMessageData()

◆ getMessageDataLength()

size_t ServiceMessage::getMessageDataLength ( )
inline

◆ raiseServerError()

void ServiceMessage::raiseServerError ( )
inline

Definition at line 321 of file ServiceMessage.hpp.

References errorCode, nameArg, and NO_ERROR_CODE.

Referenced by readResult().

◆ readMessage()

void ServiceMessage::readMessage ( SysServerConnection connection)

Read a message from the server-side stream.

Parameters
serverThe server stream that has already received a connection message.

Definition at line 68 of file ServiceMessage.cpp.

References allocateResultMemory(), messageData, messageDataLength, SysSocketConnection::read(), releaseResultMemory(), retainMessageData, SERVER_FAILURE, and ServiceMessage().

Referenced by APIServer::processMessages().

◆ readResult()

void ServiceMessage::readResult ( SysClientStream pipe)

Read a message result back from a server message.

Parameters
pipeThe connection used to send the original message.

Definition at line 160 of file ServiceMessage.cpp.

References allocateResultMemory(), messageData, messageDataLength, raiseServerError(), SysSocketConnection::read(), releaseResultMemory(), retainMessageData, SERVER_FAILURE, and ServiceMessage().

Referenced by ClientMessage::send().

◆ releaseResultMemory()

void ServiceMessage::releaseResultMemory ( void *  data)
static

Free result memory in the case of a read failure.

Parameters
dataThe data to be released.

Definition at line 241 of file ServiceMessage.cpp.

References SysAPIManager::releaseMemory().

Referenced by freeMessageData(), readMessage(), readResult(), MacroItem::update(), MacroItem::~MacroItem(), and QueueItem::~QueueItem().

◆ setExceptionInfo() [1/2]

void ServiceMessage::setExceptionInfo ( ErrorCode  error,
const char *  message 
)
inline

◆ setExceptionInfo() [2/2]

void ServiceMessage::setExceptionInfo ( ServiceException e)
inline

◆ setMessageData()

◆ setResult()

◆ transferMessageData()

void ServiceMessage::transferMessageData ( RXSTRING data)
inline

◆ writeMessage()

void ServiceMessage::writeMessage ( SysClientStream pipe)

Write a message over to the connection->

Parameters
pipeThe pipe we've opened to write the message.

Definition at line 141 of file ServiceMessage.cpp.

References freeMessageData(), messageData, messageDataLength, SERVER_FAILURE, ServiceMessage(), and SysSocketConnection::write().

Referenced by LocalAPIManager::closeConnection(), and ClientMessage::send().

◆ writeResult()

void ServiceMessage::writeResult ( SysServerConnection connection)

Write a server side message result back to the client.

Parameters
serverThe server message stream used to receive the original message.

Definition at line 120 of file ServiceMessage.cpp.

References freeMessageData(), messageData, messageDataLength, SERVER_FAILURE, ServiceMessage(), and SysSocketConnection::write().

Referenced by APIServer::processMessages().

Member Data Documentation

◆ errorCode

ErrorCode ServiceMessage::errorCode

◆ messageData

◆ messageDataLength

◆ messageTarget

◆ nameArg

◆ operation

◆ parameter1

◆ parameter2

◆ parameter3

◆ parameter4

uintptr_t ServiceMessage::parameter4

Definition at line 419 of file ServiceMessage.hpp.

Referenced by ServiceMessage().

◆ parameter5

uintptr_t ServiceMessage::parameter5

Definition at line 420 of file ServiceMessage.hpp.

Referenced by ServiceMessage().

◆ result

◆ retainMessageData

◆ session

◆ userid


The documentation for this class was generated from the following files: