Orocos Real-Time Toolkit
2.8.3
|
This class manages the creation of TaskContext Corba Servers and a Corba Object Request Broker (Orb) which executes the servers. More...
#include <rtt/transports/corba/TaskContextServer.hpp>
Public Member Functions | |
~TaskContextServer () | |
When a TaskContextServer is destroyed, the object reference is removed from the Naming Service and the servant is deleted. More... | |
CTaskContext_ptr | server () const |
Get the Corba Object of this TaskContext. More... | |
Static Public Member Functions | |
static void | ShutdownOrb (bool wait_for_completion=true) |
Invoke this method once to shutdown the Orb which is running the task servers in RunOrb(). More... | |
static void | CleanupServers () |
Destroys all TaskContextServer objects. More... | |
static void | RunOrb () |
Invoke this method to run the orb and accept client requests. More... | |
static void | ThreadOrb () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is kept (instead of using only default parameters in the other version) for ABI compatibility. More... | |
static void | ThreadOrb (int scheduler, int priority=RTT::os::LowestPriority, unsigned cpu_affinity=0) |
Invoke this method to run the orb in a separate thread and accept client requests from that thread. More... | |
static void | DestroyOrb () |
Invoke this method once to cleanup the orb. More... | |
static TaskContextServer * | Create (TaskContext *tc, bool use_naming=true, bool require_name_service=false) |
Factory method: create a CORBA server for an existing TaskContext. More... | |
static TaskContextServer * | Create (TaskContext *tc, const std::string &alias, bool use_naming=true, bool require_name_service=false) |
Factory method: create a CORBA server for an existing TaskContext. More... | |
static CTaskContext_ptr | CreateServer (TaskContext *tc, bool use_naming=true, bool require_name_service=false) |
Factory method: create a CORBA server for an existing TaskContext. More... | |
static CTaskContext_ptr | CreateServer (TaskContext *tc, const std::string &alias, bool use_naming=true, bool require_name_service=false) |
Factory method: create a CORBA server for an existing TaskContext. More... | |
static void | CleanupServer (TaskContext *tc) |
Deletes a TaskContext server for a given taskcontext. More... | |
static std::string | getIOR (TaskContext *tc) |
Get the IOR of a given TaskContext. More... | |
static RTT_CORBA_API bool | InitOrb (int argc, char *argv[], Seconds orb_timeout=0) |
Invoke this method once to initialise the Orb which will run the task servers. More... | |
Static Public Attributes | |
static CORBA::ORB_var | orb |
The orb of this process. More... | |
static PortableServer::POA_var | rootPOA |
The root POA of this process. More... | |
Protected Types | |
typedef std::map< TaskContext *, TaskContextServer * > | ServerMap |
typedef std::map< TaskContext *, std::string > | IorMap |
Protected Member Functions | |
TaskContextServer (TaskContext *taskcontext, bool use_naming, bool require_name_service) | |
Private constructor which creates a new servant. More... | |
TaskContextServer (TaskContext *taskcontext, const std::string &alias, bool use_naming, bool require_name_service) | |
Private constructor which creates a new servant using an alias. More... | |
void | initTaskContextServer (bool require_name_service) |
Static Protected Member Functions | |
static void | DoShutdownOrb (bool wait_for_completion=true) |
Internal shutdown function, used by both thread and ShutdownOrb. More... | |
Protected Attributes | |
PortableServer::POA_var | mpoa |
PortableServer::ServantBase_var | mtask_i |
corba::CTaskContext_var | mtask |
TaskContext * | mtaskcontext |
bool | muse_naming |
std::string | mregistered_name |
Static Protected Attributes | |
static ServerMap | servers |
static base::ActivityInterface * | orbrunner = 0 |
static bool | is_shutdown = false |
static IorMap | iors |
Friends | |
class | OrbRunner |
class | TaskContextProxy |
This class manages the creation of TaskContext Corba Servers and a Corba Object Request Broker (Orb) which executes the servers.
The Orb may be run from the main thread or in its own thread.
Definition at line 65 of file TaskContextServer.hpp.
|
protected |
Definition at line 79 of file TaskContextServer.hpp.
|
protected |
Definition at line 72 of file TaskContextServer.hpp.
|
protected |
Private constructor which creates a new servant.
Definition at line 252 of file TaskContextServer.cpp.
References initTaskContextServer().
Referenced by Create(), and CreateServer().
|
protected |
Private constructor which creates a new servant using an alias.
Definition at line 245 of file TaskContextServer.cpp.
References initTaskContextServer().
RTT::corba::TaskContextServer::~TaskContextServer | ( | ) |
When a TaskContextServer is destroyed, the object reference is removed from the Naming Service and the servant is deleted.
Definition at line 77 of file TaskContextServer.cpp.
References RTT::Info, and RTT::Warning.
|
static |
Deletes a TaskContext server for a given taskcontext.
If no such server exists, this method silently does nothing.
Definition at line 270 of file TaskContextServer.cpp.
References RTT::corba::CDataFlowInterface_i::deregisterServant(), RTT::TaskContext::getName(), RTT::Info, RTT::corba::ApplicationServer::orb, RTT::TaskContext::provides(), and servers.
|
static |
Destroys all TaskContextServer objects.
Definition at line 258 of file TaskContextServer.cpp.
References RTT::corba::CDataFlowInterface_i::clearServants(), RTT::Info, is_shutdown, RTT::corba::ApplicationServer::orb, and servers.
Referenced by DestroyOrb(), and DoShutdownOrb().
|
static |
Factory method: create a CORBA server for an existing TaskContext.
tc | The TaskContext to serve. |
use_naming | Set to false in order not to use the Corba Naming Service. |
require_naming | Set to true to require that the Corba Naming Service be found. |
0 | if the ORB is not initialised, or if require_name_service==true and the name service was not found |
Definition at line 408 of file TaskContextServer.cpp.
References RTT::TaskContext::getName().
Referenced by RTT::corba::TaskContextProxy::addPeer(), RTT::corba::TaskContextProxy::connectPeers(), RTT::corba::TaskContextProxy::connectPorts(), and RTT::corba::TaskContextProxy::connectServices().
|
static |
Factory method: create a CORBA server for an existing TaskContext.
tc | The TaskContext to serve. |
alias | Alias to use as name when registering the CORBA server. |
use_naming | Set to false in order not to use the Corba Naming Service. |
require_naming | Set to true to require that the Corba Naming Service be found. |
0 | if the ORB is not initialised, or if require_name_service==true and the name service was not found |
Definition at line 412 of file TaskContextServer.cpp.
References RTT::Debug, RTT::os::endl(), RTT::Info, RTT::corba::ApplicationServer::orb, servers, TaskContextServer(), and RTT::corba::IllegalServer::what().
|
static |
Factory method: create a CORBA server for an existing TaskContext.
Same as above, but immediately return the Corba object. Also checks if tc is TaskContextProxy and returns the server of the proxy if so.
tc | The TaskContext to serve. |
use_naming | Set to false in order not to use the Corba Naming Service. |
require_naming | Set to true to require that the Corba Naming Service be found. |
0 | if the ORB is not initialised, or if require_name_service==true and the name service was not found |
Definition at line 433 of file TaskContextServer.cpp.
References RTT::TaskContext::getName().
Referenced by RTT::corba::AnyConversion< RTT::TaskContext * >::createAny(), and RTT::corba::AnyConversion< RTT::TaskContext * >::updateAny().
|
static |
Factory method: create a CORBA server for an existing TaskContext.
Same as above, but immediately return the Corba object. Also checks if tc is TaskContextProxy and returns the server of the proxy if so.
tc | The TaskContext to serve. |
alias | Alias to use as name when registering the CORBA server. |
use_naming | Set to false in order not to use the Corba Naming Service. |
require_naming | Set to true to require that the Corba Naming Service be found. |
0 | if the ORB is not initialised, or if require_name_service==true and the name service was not found |
Definition at line 437 of file TaskContextServer.cpp.
References RTT::Debug, RTT::os::endl(), RTT::Info, RTT::corba::ApplicationServer::orb, RTT::corba::TaskContextProxy::proxies, server(), servers, TaskContextServer(), and RTT::corba::IllegalServer::what().
|
static |
Invoke this method once to cleanup the orb.
Definition at line 378 of file TaskContextServer.cpp.
References CleanupServers(), CORBA_EXCEPTION_INFO, RTT::Error, RTT::Info, RTT::corba::ApplicationServer::orb, orbrunner, RTT::corba::ApplicationServer::rootPOA, and RTT::base::ActivityInterface::stop().
|
staticprotected |
Internal shutdown function, used by both thread and ShutdownOrb.
Definition at line 288 of file TaskContextServer.cpp.
References CleanupServers(), CORBA_EXCEPTION_INFO, RTT::Error, RTT::Info, is_shutdown, and RTT::corba::ApplicationServer::orb.
Referenced by ShutdownOrb().
|
static |
Get the IOR of a given TaskContext.
tc | The TaskContext to find the IOR for |
Definition at line 471 of file TaskContextServer.cpp.
References iors.
|
staticinherited |
Invoke this method once to initialise the Orb which will run the task servers.
orb_timeout | timeout value for each remote call, expressed in seconds. The resolution is up to 100 nano seconds. Anything smaller will be interpreted as a zero. |
Definition at line 55 of file ApplicationServer.cpp.
References CORBA_EXCEPTION_INFO, RTT::Error, RTT::Logger::log(), RTT::Logger::nl(), RTT::corba::ApplicationServer::orb, and RTT::corba::ApplicationServer::rootPOA.
Referenced by RTT::corba::TaskContextFactory::InitOrb().
|
protected |
Definition at line 119 of file TaskContextServer.cpp.
References RTT_corba_CTaskContext_i::activate_this(), CORBA_EXCEPTION_INFO, RTT::Debug, RTT::os::endl(), RTT::Error, RTT::Info, and RTT::Warning.
Referenced by TaskContextServer().
|
static |
Invoke this method to run the orb and accept client requests.
Use ShutdownOrb() to break out of this method.
Definition at line 316 of file TaskContextServer.cpp.
References CORBA_EXCEPTION_INFO, RTT::Error, RTT::Info, and RTT::corba::ApplicationServer::orb.
Referenced by RTT::corba::OrbRunner::loop().
CTaskContext_ptr RTT::corba::TaskContextServer::server | ( | ) | const |
Get the Corba Object of this TaskContext.
If you want to store this reference, you must _duplicate it. This object universally identifies the remote TaskContextServer and can be used to tell other (remote) objects where to find it.
Definition at line 465 of file TaskContextServer.cpp.
References mtask.
Referenced by RTT::corba::TaskContextProxy::addPeer(), RTT::corba::TaskContextProxy::connectPeers(), RTT::corba::TaskContextProxy::connectPorts(), RTT::corba::TaskContextProxy::connectServices(), and CreateServer().
|
static |
Invoke this method once to shutdown the Orb which is running the task servers in RunOrb().
When this function returns, no CORBA invocations are in progress, unless wait_for_completion is false.
Definition at line 282 of file TaskContextServer.cpp.
References DoShutdownOrb().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This is kept (instead of using only default parameters in the other version) for ABI compatibility.
Definition at line 361 of file TaskContextServer.cpp.
References ORO_SCHED_RT.
|
static |
Invoke this method to run the orb in a separate thread and accept client requests from that thread.
Use ShutdownOrb() to break out of this method.
Definition at line 362 of file TaskContextServer.cpp.
References RTT::Error, RTT::Info, RTT::corba::ApplicationServer::orb, OrbRunner, orbrunner, and RTT::base::ActivityInterface::start().
|
friend |
Definition at line 69 of file TaskContextServer.hpp.
Referenced by ThreadOrb().
|
friend |
Definition at line 70 of file TaskContextServer.hpp.
|
staticprotected |
Definition at line 80 of file TaskContextServer.hpp.
Referenced by getIOR().
|
staticprotected |
Definition at line 75 of file TaskContextServer.hpp.
Referenced by CleanupServers(), and DoShutdownOrb().
|
protected |
Definition at line 77 of file TaskContextServer.hpp.
|
protected |
Definition at line 98 of file TaskContextServer.hpp.
|
protected |
Definition at line 95 of file TaskContextServer.hpp.
Referenced by server().
|
protected |
Definition at line 94 of file TaskContextServer.hpp.
|
protected |
Definition at line 96 of file TaskContextServer.hpp.
|
protected |
Definition at line 97 of file TaskContextServer.hpp.
|
staticinherited |
The orb of this process.
Definition at line 62 of file ApplicationServer.hpp.
Referenced by CleanupServer(), CleanupServers(), RTT::corba::TaskContextProxy::Create(), Create(), RTT::corba::TaskContextProxy::CreateFromFile(), CreateServer(), RTT::corba::TaskContextProxy::DestroyOrb(), DestroyOrb(), DoShutdownOrb(), RTT::corba::RemoteChannelElement< T >::getRemoteURI(), RTT::corba::TaskContextProxy::initFromURIOrTaskname(), RTT::corba::ApplicationServer::InitOrb(), RTT::corba::TaskContextProxy::ProxyPOA(), RTT::corba::RemoteChannelElement< T >::RemoteChannelElement(), RunOrb(), and ThreadOrb().
|
staticprotected |
Definition at line 74 of file TaskContextServer.hpp.
Referenced by DestroyOrb(), and ThreadOrb().
|
staticinherited |
The root POA of this process.
Definition at line 67 of file ApplicationServer.hpp.
Referenced by RTT::corba::TaskContextProxy::DestroyOrb(), DestroyOrb(), and RTT::corba::ApplicationServer::InitOrb().
|
staticprotected |
Definition at line 73 of file TaskContextServer.hpp.
Referenced by CleanupServer(), CleanupServers(), RTT::corba::TaskContextProxy::Create(), Create(), and CreateServer().