Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CODEX_KeyService::DecoratedClientMessageEvent< MT > Class Template Reference

Event class for messages that must be routed back to an originating server. More...

#include <DecoratedClientMessageEvent.h>

Inheritance diagram for CODEX_KeyService::DecoratedClientMessageEvent< MT >:

Inheritance graph
[legend]
Collaboration diagram for CODEX_KeyService::DecoratedClientMessageEvent< MT >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DecoratedClientMessageEvent (CODEX_Events::Activity *source, ClientMessageHandler *destination, const unsigned char *server, const unsigned char *mID)
 Create an event that included routing information.
virtual ~DecoratedClientMessageEvent ()
 Virtual destructor.
bool handle ()
 Handle this event -- invokes the appropriate handler from the destination Activity, which must have type ClientMessageHandler.
const unsigned char * server () const
 The ID of the server acting as delegate for this message.
const unsigned char * mID () const
 The unique request ID for this message.
ClientMessageHandlerdestination () const
 The destination.
const MT & message () const
 The wrapped object.
void reRoute (ClientMessageHandler *newDestination)
 Re-route this event to another Activity.
bool unmarshal (unsigned char **pp, long length)
 Forwards an unmarshal request to the wrapped object.
Activitysource ()
 The Activity that created this event.

Protected Attributes

ClientMessageHandlerm_destination
 The CODEX_Events::Activity that handles this event.
Activity * m_source
 Source of this event.

Detailed Description

template<class MT>
class CODEX_KeyService::DecoratedClientMessageEvent< MT >

Event class for messages that must be routed back to an originating server.

A single parser exists for all client request messages coming from delegate servers, so the source activity cannot be used to tie the request to its originating server. Instead, we store the server information explicitly, including the request number. A handler that is DecoratedClientMessageEvent-aware can then read the supplementary information, while one that isn't can treat it as any other ClientMessageEvent. Specifically, this allows us to use the same verifier class for requests from clients and requests from delegates, though the objects must be distinct because they have different destinations.

Definition at line 43 of file DecoratedClientMessageEvent.h.


Member Function Documentation

template<class MT>
void CODEX_KeyService::ClientMessageEvent< MT >::reRoute ClientMessageHandler newDestination  )  [inline, inherited]
 

Re-route this event to another Activity.

This is a much cheaper operation than copying the data to a new event. The CODEX_Events::Activity calling this should return false in its handler, so that the event will be re-added to the queue.

Definition at line 103 of file ClientMessageEvent.h.

References CODEX_KeyService::ClientMessageEvent< MT >::m_destination.


The documentation for this class was generated from the following file:
Generated on Fri May 6 17:42:18 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1