#include <ServiceMessage.hpp>
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] |
Definition at line 282 of file ServiceMessage.hpp.
anonymous enum |
Enumerator | |
---|---|
NAMESIZE |
Definition at line 285 of file ServiceMessage.hpp.
ServiceMessage::ServiceMessage | ( | ) |
Definition at line 44 of file ServiceMessage.cpp.
References APIManager, CONNECTION_ACTIVE, errorCode, MESSAGE_OK, messageData, messageDataLength, messageTarget, nameArg, NO_ERROR_CODE, operation, parameter1, parameter2, parameter3, parameter4, parameter5, result, retainMessageData, session, and userid.
Referenced by readMessage(), readResult(), writeMessage(), and writeResult().
|
inline |
Definition at line 291 of file ServiceMessage.hpp.
|
inline |
Definition at line 387 of file ServiceMessage.hpp.
References allocateResultMemory(), messageData, messageDataLength, and retainMessageData.
Referenced by RegistrationTable::queryCallback().
|
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.
length | The length to allocate. |
Definition at line 226 of file ServiceMessage.cpp.
References SysAPIManager::allocateMemory(), and MEMORY_ERROR.
Referenced by allocateMessageData(), readMessage(), and readResult().
|
inline |
Definition at line 315 of file ServiceMessage.hpp.
References errorCode, MESSAGE_OK, NO_ERROR_CODE, and result.
|
inline |
Definition at line 336 of file ServiceMessage.hpp.
References messageData, messageDataLength, and retainMessageData.
Referenced by DataQueue::add(), ServerMacroSpaceManager::addMacro(), freeMessageData(), and transferMessageData().
|
inline |
Definition at line 395 of file ServiceMessage.hpp.
References clearMessageData(), messageData, releaseResultMemory(), and retainMessageData.
Referenced by ServerRegistrationManager::dispatch(), RegistrationTable::dropCallback(), RegistrationTable::dropLibraryCallback(), RegistrationTable::queryLibraryCallback(), RegistrationTable::registerCallback(), RegistrationTable::registerLibraryCallback(), LocalMacroSpaceManager::saveMacroSpace(), setExceptionInfo(), setMessageData(), transferMessageData(), RegistrationTable::updateCallback(), writeMessage(), writeResult(), and ClientMessage::~ClientMessage().
|
inline |
Definition at line 331 of file ServiceMessage.hpp.
References dupString(), and nameArg.
|
inline |
Definition at line 343 of file ServiceMessage.hpp.
References messageData.
Referenced by DataQueue::add(), ServerMacroSpaceManager::addMacro(), RegistrationTable::dropLibraryCallback(), LocalRegistrationManager::queryCallback(), RegistrationTable::queryLibraryCallback(), RegistrationTable::registerCallback(), RegistrationTable::registerLibraryCallback(), LocalRegistrationManager::resolveCallback(), LocalMacroSpaceManager::saveMacroSpace(), and RegistrationTable::updateCallback().
|
inline |
Definition at line 344 of file ServiceMessage.hpp.
References messageDataLength.
Referenced by ServerMacroSpaceManager::addMacro(), and LocalMacroSpaceManager::saveMacroSpace().
|
inline |
Definition at line 321 of file ServiceMessage.hpp.
References errorCode, nameArg, and NO_ERROR_CODE.
Referenced by readResult().
void ServiceMessage::readMessage | ( | SysServerConnection * | connection | ) |
Read a message from the server-side stream.
server | The 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().
void ServiceMessage::readResult | ( | SysClientStream & | pipe | ) |
Read a message result back from a server message.
pipe | The 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().
|
static |
Free result memory in the case of a read failure.
data | The 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().
|
inline |
Definition at line 299 of file ServiceMessage.hpp.
References errorCode, freeMessageData(), nameArg, NAMESIZE, result, and SERVER_ERROR.
Referenced by APIServer::dispatch(), ServerMacroSpaceManager::dispatch(), ServerQueueManager::dispatch(), and ServerRegistrationManager::dispatch().
|
inline |
Definition at line 307 of file ServiceMessage.hpp.
References errorCode, freeMessageData(), ServiceException::getErrorCode(), ServiceException::getMessage(), nameArg, NAMESIZE, result, and SERVER_ERROR.
|
inline |
Definition at line 371 of file ServiceMessage.hpp.
References freeMessageData(), messageData, messageDataLength, and retainMessageData.
Referenced by LocalMacroSpaceManager::addMacro(), LocalQueueManager::addToNamedQueue(), LocalQueueManager::addToSessionQueue(), LocalRegistrationManager::dropCallback(), ServerMacroSpaceManager::getImage(), LocalMacroSpaceManager::loadMacroSpace(), ServerMacroSpaceManager::nextImage(), DataQueue::pullData(), LocalRegistrationManager::queryCallback(), and LocalRegistrationManager::registerCallback().
|
inline |
Definition at line 293 of file ServiceMessage.hpp.
References errorCode, NO_ERROR_CODE, and result.
Referenced by DataQueue::add(), ServerMacroSpaceManager::addMacro(), ServerQueueManager::addToNamedQueue(), ServerMacroSpaceManager::clear(), ServerQueueManager::clearNamedQueue(), ServerQueueManager::clearSessionQueue(), ServerQueueManager::createNamedQueue(), ServerQueueManager::createSessionQueue(), ServerMacroSpaceManager::deleteMacro(), ServerQueueManager::deleteNamedQueue(), ServerQueueManager::deleteSessionQueue(), RegistrationTable::dropCallback(), RegistrationTable::dropLibraryCallback(), ServerMacroSpaceManager::getDescriptor(), ServerMacroSpaceManager::getImage(), ServerQueueManager::getNamedQueueCount(), ServerQueueManager::getSessionQueueCount(), ServerMacroSpaceManager::iterateMacros(), ServerQueueManager::nestSessionQueue(), ServerMacroSpaceManager::nextDescriptor(), ServerMacroSpaceManager::nextImage(), ServerQueueManager::openNamedQueue(), DataQueue::pull(), DataQueue::pullData(), ServerQueueManager::pullFromNamedQueue(), RegistrationTable::queryCallback(), RegistrationTable::queryLibraryCallback(), ServerMacroSpaceManager::queryMacro(), ServerQueueManager::queryNamedQueue(), RegistrationTable::registerCallback(), RegistrationTable::registerLibraryCallback(), ServerMacroSpaceManager::reorderMacro(), and RegistrationTable::updateCallback().
|
inline |
Definition at line 346 of file ServiceMessage.hpp.
References clearMessageData(), freeMessageData(), MAKERXSTRING, messageData, messageDataLength, _RXSTRING::strlength, and _RXSTRING::strptr.
Referenced by LocalMacroSpaceManager::getMacro(), and LocalQueueManager::pullFromQueue().
void ServiceMessage::writeMessage | ( | SysClientStream & | pipe | ) |
Write a message over to the connection->
pipe | The 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().
void ServiceMessage::writeResult | ( | SysServerConnection * | connection | ) |
Write a server side message result back to the client.
server | The 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().
ErrorCode ServiceMessage::errorCode |
Definition at line 422 of file ServiceMessage.hpp.
Referenced by clearExceptionInfo(), raiseServerError(), ServiceMessage(), setExceptionInfo(), and setResult().
void* ServiceMessage::messageData |
Definition at line 423 of file ServiceMessage.hpp.
Referenced by allocateMessageData(), clearMessageData(), freeMessageData(), getMessageData(), readMessage(), readResult(), ServiceMessage(), setMessageData(), transferMessageData(), writeMessage(), and writeResult().
size_t ServiceMessage::messageDataLength |
Definition at line 424 of file ServiceMessage.hpp.
Referenced by allocateMessageData(), clearMessageData(), getMessageDataLength(), readMessage(), readResult(), ServiceMessage(), setMessageData(), transferMessageData(), writeMessage(), and writeResult().
ServerManager ServiceMessage::messageTarget |
Definition at line 413 of file ServiceMessage.hpp.
Referenced by ClientMessage::ClientMessage(), APIServerInstance::dispatch(), APIServer::processMessages(), and ServiceMessage().
char ServiceMessage::nameArg[NAMESIZE] |
Definition at line 426 of file ServiceMessage.hpp.
Referenced by ServerMacroSpaceManager::addMacro(), ServerQueueManager::addToNamedQueue(), ServerQueueManager::clearNamedQueue(), ClientMessage::ClientMessage(), LocalQueueManager::createNamedQueue(), ServerQueueManager::createNamedQueue(), ServerQueueManager::createUniqueQueue(), ServerMacroSpaceManager::deleteMacro(), ServerQueueManager::deleteNamedQueue(), RegistrationTable::dropCallback(), RegistrationTable::dropLibraryCallback(), getArgumentName(), ServerMacroSpaceManager::getDescriptor(), ServerMacroSpaceManager::getImage(), ServerQueueManager::getNamedQueueCount(), ServerMacroSpaceManager::nextDescriptor(), ServerMacroSpaceManager::nextImage(), ServerQueueManager::openNamedQueue(), APIServer::processMessages(), DataQueue::pullData(), ServerQueueManager::pullFromNamedQueue(), LocalQueueManager::pullFromQueue(), RegistrationTable::queryCallback(), RegistrationTable::queryLibraryCallback(), ServerMacroSpaceManager::queryMacro(), ServerQueueManager::queryNamedQueue(), raiseServerError(), RegistrationTable::registerCallback(), RegistrationTable::registerLibraryCallback(), ServerMacroSpaceManager::reorderMacro(), LocalMacroSpaceManager::saveMacroSpace(), ServiceMessage(), setExceptionInfo(), and RegistrationTable::updateCallback().
ServerOperation ServiceMessage::operation |
Definition at line 414 of file ServiceMessage.hpp.
Referenced by ClientMessage::ClientMessage(), APIServer::dispatch(), ServerMacroSpaceManager::dispatch(), ServerQueueManager::dispatch(), ServerRegistrationManager::dispatch(), APIServer::processMessages(), LocalQueueManager::pullFromQueue(), LocalMacroSpaceManager::saveMacroSpace(), and ServiceMessage().
uintptr_t ServiceMessage::parameter1 |
Definition at line 416 of file ServiceMessage.hpp.
Referenced by DataQueue::add(), LocalMacroSpaceManager::addMacro(), LocalQueueManager::addToNamedQueue(), LocalQueueManager::addToSessionQueue(), ServerQueueManager::clearSessionQueue(), ClientMessage::ClientMessage(), LocalQueueManager::createNamedQueue(), ServerQueueManager::createSessionQueue(), LocalQueueManager::createSessionQueue(), ServerQueueManager::createUniqueQueue(), ServerQueueManager::deleteSessionQueue(), APIServer::dispatch(), ServerRegistrationManager::dispatch(), LocalAPIManager::establishServerConnection(), ServerMacroSpaceManager::getDescriptor(), ServerMacroSpaceManager::getImage(), ServerQueueManager::getNamedQueueCount(), LocalQueueManager::getQueueCount(), ServerQueueManager::getSessionQueueCount(), LocalQueueManager::getSessionQueueCount(), ServerMacroSpaceManager::iterateMacros(), LocalMacroSpaceManager::loadMacroSpace(), ServerQueueManager::nestSessionQueue(), LocalQueueManager::nestSessionQueue(), ServerMacroSpaceManager::nextDescriptor(), ServerMacroSpaceManager::nextImage(), DataQueue::pull(), DataQueue::pullData(), LocalQueueManager::pullFromQueue(), LocalMacroSpaceManager::queryMacro(), LocalMacroSpaceManager::reorderMacro(), ServerMacroSpaceManager::reorderMacro(), LocalMacroSpaceManager::saveMacroSpace(), and ServiceMessage().
uintptr_t ServiceMessage::parameter2 |
Definition at line 417 of file ServiceMessage.hpp.
Referenced by DataQueue::add(), LocalMacroSpaceManager::addMacro(), ServerMacroSpaceManager::addMacro(), LocalQueueManager::addToNamedQueue(), LocalQueueManager::addToSessionQueue(), ServerMacroSpaceManager::getDescriptor(), ServerMacroSpaceManager::getImage(), LocalMacroSpaceManager::loadMacroSpace(), ServerQueueManager::nestSessionQueue(), LocalQueueManager::nestSessionQueue(), ServerMacroSpaceManager::nextDescriptor(), ServerMacroSpaceManager::nextImage(), LocalMacroSpaceManager::saveMacroSpace(), and ServiceMessage().
uintptr_t ServiceMessage::parameter3 |
Definition at line 418 of file ServiceMessage.hpp.
Referenced by LocalQueueManager::addToSessionQueue(), ServerQueueManager::addToSessionQueue(), LocalQueueManager::pullFromQueue(), ServerQueueManager::pullFromSessionQueue(), and ServiceMessage().
uintptr_t ServiceMessage::parameter4 |
Definition at line 419 of file ServiceMessage.hpp.
Referenced by ServiceMessage().
uintptr_t ServiceMessage::parameter5 |
Definition at line 420 of file ServiceMessage.hpp.
Referenced by ServiceMessage().
ServiceReturn ServiceMessage::result |
Definition at line 421 of file ServiceMessage.hpp.
Referenced by clearExceptionInfo(), LocalQueueManager::createNamedQueue(), APIServer::dispatch(), LocalMacroSpaceManager::mapReturnResult(), LocalQueueManager::mapReturnResult(), LocalRegistrationManager::mapReturnResult(), LocalQueueManager::openNamedQueue(), APIServer::processMessages(), LocalQueueManager::pullFromQueue(), LocalRegistrationManager::queryCallback(), LocalRegistrationManager::resolveCallback(), LocalMacroSpaceManager::saveMacroSpace(), ServiceMessage(), setExceptionInfo(), and setResult().
bool ServiceMessage::retainMessageData |
Definition at line 425 of file ServiceMessage.hpp.
Referenced by allocateMessageData(), clearMessageData(), freeMessageData(), ServerMacroSpaceManager::getImage(), ServerMacroSpaceManager::nextImage(), DataQueue::pullData(), readMessage(), readResult(), ServiceMessage(), and setMessageData().
SessionID ServiceMessage::session |
Definition at line 415 of file ServiceMessage.hpp.
Referenced by APIServerInstance::cleanupProcessResources(), RegistrationTable::dropCallback(), RegistrationTable::dropLibraryCallback(), APIServer::processMessages(), RegistrationTable::queryCallback(), RegistrationTable::registerCallback(), RegistrationTable::registerLibraryCallback(), ClientMessage::send(), and ServiceMessage().
char ServiceMessage::userid[MAX_USERID_LENGTH] |
Definition at line 427 of file ServiceMessage.hpp.
Referenced by APIServerInstance::APIServerInstance(), APIServerInstance::isUser(), APIServer::processMessages(), ClientMessage::send(), and ServiceMessage().