Library: RemotingNG
Package: ORB
Header: Poco/RemotingNG/Skeleton.h
A Skeleton is responsible for demultiplexing incoming requests to the correct service object method, using MethodHandler objects.
Direct Base Classes: AttributedObject
All Base Classes: Poco::RefCountedObject, AttributedObject
Known Derived Classes: EventSubscriber
Member Functions: addMethodHandler, invoke
Inherited Functions: duplicate, getAttribute, hasAttribute, referenceCount, release, setAttribute
typedef std::map < std::string, MethodHandler::Ptr > MethodHandlers;
typedef Poco::AutoPtr < Skeleton > Ptr;
Skeleton();
Creates a Skeleton.
virtual ~Skeleton();
Destroys the Skeleton.
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.
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.