Poco::RemotingNG

class Skeleton

Library: RemotingNG
Package: ORB
Header: Poco/RemotingNG/Skeleton.h

Description

A Skeleton is responsible for demultiplexing incoming requests to the correct service object method, using MethodHandler objects.

Inheritance

Direct Base Classes: AttributedObject, Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject, AttributedObject

Known Derived Classes: EventSubscriber

Member Summary

Member Functions: addMethodHandler, invoke

Inherited Functions: clearAttributes, countAttributes, duplicate, enumerateAttributes, getAttribute, hasAttribute, operator =, referenceCount, release, removeAttribute, setAttribute

Types

MethodHandlers

typedef std::map < std::string, MethodHandler::Ptr > MethodHandlers;

Ptr

typedef Poco::AutoPtr < Skeleton > Ptr;

Constructors

Skeleton

Skeleton();

Creates a Skeleton.

Destructor

~Skeleton virtual

virtual ~Skeleton();

Destroys the Skeleton.

Member Functions

invoke

bool invoke(
    ServerTransport & transport,
    RemoteObject::Ptr pRemoteObject
);

Invoke a method on the RemoteObject.

First, obtains a Deserializer from the given ServerTransport by calling beginRequest(). Then, determines the method name from the request (by calling Deserializer::findMessage()), obtains the MethodHandler for the method and invokes the method using the MethodHandler.

If no MethodHandler is found, a MethodNotFoundException is sent back to the client. If the type of the received message is neither MESSAGE_REQUEST nor MESSAGE_EVENT, a UnexpectedMessageException will be thrown.

After processing the request, endRequest() is called on the ServerTransport.

Returns true if the method was found, false otherwise.

addMethodHandler protected

void addMethodHandler(
    const std::string & name,
    MethodHandler::Ptr pMethodHandler
);

Adds a MethodHandler for the service object's method with the given name to the Skeleton. Takes ownership of the MethodHandler.