23 #ifndef CPN_REMOTECONTEXTCLIENT_H
24 #define CPN_REMOTECONTEXTCLIENT_H
34 #include <Variant/Variant.h>
54 virtual void Log(
int level,
const std::string &logmsg);
158 typedef std::map<CPN::Key_t, CPN::KernelBase*>
KernelMap;
std::map< unsigned, WaiterInfo * > WaiterMap
virtual void WaitForNodeEnd(const std::string &nodename)
Waits for the given node to signal end.
virtual ~RemoteContextClient()
virtual int LogLevel() const
void SendQueueMsg(CPN::Key_t kernelkey, RCTXMT_t msgtype, const CPN::SimpleQueueAttr &attr)
virtual CPN::Key_t GetReaderKernel(CPN::Key_t portkey)
RCTXMT_t
RCTXMT Remote Context Message Type These are the message types that the remote context uses to send i...
Variant GetEndpointInfo(RCTXMT_t msgtype, CPN::Key_t portkey)
This abstract class is the remote context client.
Variant RemoteCall(Variant msg)
virtual CPN::Key_t GetNodeKernel(CPN::Key_t nodekey)
virtual std::string GetWriterName(CPN::Key_t portkey)
virtual void GetKernelConnectionInfo(CPN::Key_t kernelkey, std::string &hostname, std::string &servname)
obtain the connection information for the given kernel
virtual std::string GetKernelName(CPN::Key_t kernelkey)
virtual CPN::Key_t GetReadersWriter(CPN::Key_t readerkey)
CPN::Key_t GetCreateEndpointKey(RCTXMT_t msgtype, CPN::Key_t nodekey, const std::string &portname)
virtual CPN::Key_t GetCreateWriterKey(CPN::Key_t nodekey, const std::string &portname)
void InternalCheckTerminated()
void AddWaiter(WaiterInfo *info)
void DispatchMessage(const Variant &msg)
virtual void Terminate()
Signal to the Context that the network is terminating. After this call most methods will throw a Shut...
std::list< Variant > messages
Definition of the queue attributes.
GenericWaiterPtr NewGenericWaiter()
Definition for node attributes.
The Context abstract data type.
virtual void SignalKernelEnd(CPN::Key_t kernelkey)
Signal to the Context that the given kernel is dead.
virtual CPN::Key_t SetupKernel(const std::string &name, const std::string &hostname, const std::string &servname, CPN::KernelBase *kernel)
Called by the Kernel when it has successfully set it self up. This gives the Context a way to notify ...
virtual CPN::Key_t CreateNodeKey(CPN::Key_t kernelkey, const std::string &nodename)
Tell the context to allocate a new node key and data structure for a node with nodename which is on k...
virtual void SignalNodeStart(CPN::Key_t nodekey)
Called by the node startup routine to indicate that the node has started.
virtual CPN::Key_t WaitForKernelStart(const std::string &kernel)
Does not return until the given kernel has started.
virtual CPN::Key_t GetKernelKey(const std::string &kernel)
virtual void SendCreateNode(CPN::Key_t kernelkey, const CPN::NodeAttr &attr)
Tell a given kernel that it needs to create a node.
virtual CPN::Key_t SetupKernel(const std::string &name, KernelBase *kernel)
Called by the kernel when it is not in remote mode.
virtual std::string GetReaderName(CPN::Key_t portkey)
virtual CPN::Key_t GetWritersReader(CPN::Key_t writerkey)
virtual bool IsTerminated()
The CPN::Context abstraction that holds all the global state for the process network.
virtual CPN::Key_t WaitForNodeStart(const std::string &nodename)
Waits until the node starts and returns the key, if the node is already started returns the key...
virtual void SendCreateWriter(CPN::Key_t kernelkey, const CPN::SimpleQueueAttr &attr)
Tell a given kernel that it needs to create a queue write end.
virtual bool RequireRemote()
Lets the kernel know that this context type requires remote activity. This overrides the kernel optio...
std::list< weak_ptr< GenericWaiter > > WaiterList
virtual void Log(int level, const std::string &logmsg)
Log a message to this outputer.
std::map< CPN::Key_t, CPN::KernelBase * > KernelMap
virtual void ConnectEndpoints(CPN::Key_t writerkey, CPN::Key_t readerkey, const std::string &qname)
Called by the kernel when a queue is created. Note that the endpoints may have been created when the ...
virtual CPN::Key_t GetCreateReaderKey(CPN::Key_t nodekey, const std::string &portname)
Get the key associated with the given endpoint for the given node. Creates the information if it does...
virtual void SendCreateReader(CPN::Key_t kernelkey, const CPN::SimpleQueueAttr &attr)
Tell a given kernel that it needs to create a queue read end.
virtual void SendMessage(const Variant &msg)=0
virtual void SendCreateQueue(CPN::Key_t kernelkey, const CPN::SimpleQueueAttr &attr)
Tell a given kernel that it needs to create a queue.
virtual void SignalNodeEnd(CPN::Key_t nodekey)
Called by the node cleanup routine to indicate that the node has ended.
virtual CPN::Key_t GetWriterKernel(CPN::Key_t portkey)
virtual std::string GetNodeName(CPN::Key_t nodekey)
auto_ptr< Pthread > terminateThread
virtual void SignalKernelStart(CPN::Key_t kernelkey)
Signal to the context that the given kernel has started.
shared_ptr< GenericWaiter > GenericWaiterPtr
virtual CPN::Key_t GetReaderNode(CPN::Key_t portkey)
This is a simplified internal representation of the queue attributes needed to create a queue...
virtual CPN::Key_t GetWriterNode(CPN::Key_t portkey)
virtual CPN::Key_t GetNodeKey(const std::string &nodename)
virtual void WaitForAllNodeEnd()
Convenience method which waits until there are no nodes running. If no node have started then this wi...