![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
attribute unsigned short period;
typedef sequence<Message> Messages;
publishes Message message_publisher;
provides History message_history;
home MessengerHome manages Messenger {};
provides History message_history;
publishes Message message_publisher;
emits Message message_publisher;
consumes Message message_consumer;
home ReceiverHome manages Receiver {};
home ReceiverHome manages Receiver {};
uses multiple Runnable runnables;
uses multiple Publication content;
home AdministratorHome manages Administrator {};
home AdministratorHome manages Administrator {};
![]() |
composition session Messenger_Impl
home executor MessengerHome_Exec
home executor MessengerHome_Exec
composition session Receiver_Impl
home executor ReceiverHome_Exec
composition session Administrator_Impl
home executor AdministratorHome_Exec
![]() |
![]() |
![]() |
![]() |
![]() |
class MESSENGER_EXEC_Export Runnable_exec_i
: public virtual ::CCM_Runnable,
public virtual ::CORBA::LocalObject
virtual ~Runnable_exec_i (void);
ACE_Thread_Mutex& get_run_lock();
//==================================================================
// Facet Executor Implementation Class: Runnable_exec_i
//==================================================================
Runnable_exec_i::Runnable_exec_i (void)
// initially, the Messenger does not publish
Runnable_exec_i::~Runnable_exec_i (void)
// allows the Messenger to acquire the lock and publish
// prevents the Messenger from acquiring the lock; can’t publish
Runnable_exec_i::get_run_lock()
attribute unsigned short period;
class MESSENGER_EXEC_Export Publication_exec_i
: public virtual ::CCM_Publication,
public virtual ::CORBA::LocalObject
Publication_exec_i (const char* text,
virtual ~Publication_exec_i (void);
// Operations from ::Publication
virtual void text (const char* text);
virtual CORBA::UShort period ();
virtual void period (CORBA::UShort period);
#include "Publication_exec_i.h"
//==================================================================
// Facet Executor Implementation Class: Publication_exec_i
//==================================================================
Publication_exec_i::Publication_exec_i (const char* text,
Publication_exec_i::~Publication_exec_i (void)
// Operations from ::Publication
ACE_Guard<ACE_Thread_Mutex> guard(this->lock_);
return CORBA::string_dup( this->text_.c_str() );
Publication_exec_i::text (const char* text)
ACE_Guard<ACE_Thread_Mutex> guard(this->lock_);
ACE_DEBUG((LM_INFO, ACE_TEXT("publication text changed to %C\n"), text ));
ACE_Guard<ACE_Thread_Mutex> guard(this->lock_);
Publication_exec_i::period (CORBA::UShort period)
ACE_Guard<ACE_Thread_Mutex> guard( this->lock_ );
ACE_TEXT("publication period changed to %d seconds\n"), period ));
ACE_TEXT("ignoring a negative period of %d\n"), period ));
#include "Messenger_exec_export.h"
class MESSENGER_EXEC_Export History_exec_i
: public virtual ::CCM_History,
public virtual ::CORBA::LocalObject
virtual ~History_exec_i (void);
virtual ::Messages* get_all ();
virtual ::Message* get_latest ();
typedef std::list<::Message_var> MessageList;
//==================================================================
// Facet Executor Implementation Class: History_exec_i
//==================================================================
History_exec_i::History_exec_i (void)
History_exec_i::~History_exec_i (void)
ACE_Guard<ACE_Thread_Mutex> guard(this->lock_);
ACE_DEBUG((LM_INFO, ACE_TEXT("History_i::get_all\n") ));
// create a Messages sequence, set its length
::Messages* retval = new ::Messages();
retval->length( this->messages_.size() );
// iterate through the MessageList, copying messages into the return sequence
for ( MessageList::iterator messageItr = this->messages_.begin();
messageItr != this->messages_.end();
// because the MessageList contains Message_vars, reference counting
// upon assignment into the sequence is handled properly for us.
ACE_Guard<ACE_Thread_Mutex> guard(this->lock_);
ACE_DEBUG((LM_INFO, ACE_TEXT("History_i::get_latest\n") ));
// just get the last message from the history. because the MessageList
// contains Message_vars, _var to _var assigmnent handles the reference
::Message_var retval = this->messages_.back();
void History_exec_i::add (::Message* message)
ACE_Guard<ACE_Thread_Mutex> guard(lock_);
// bump up the reference count; we don't own the parameter.
// the _var in the STL list takes ownership of the "copy"
this->messages_.push_back( message );
![]() |
publishes Message message_publisher;
provides History message_history;
home MessengerHome manages Messenger {};
provides <facet_interface> <facet_name>;
::CCM_<facet_interface>_ptr get_<facet_name>();
::CCM_Publication_ptr get_content();
composition session Messenger_Impl
home executor MessengerHome_Exec
![]() |
#include "Messenger_exec_export.h"
// forward declarations for executor implementations referenced
// in the Messenger_exec_i class definition
class MESSENGER_EXEC_Export Messenger_exec_i
: public virtual Messenger_Exec,
public virtual ::CORBA::LocalObject,
virtual ~Messenger_exec_i (void);
virtual void subject (const char* subject);
virtual ::CCM_Runnable_ptr get_control ();
virtual ::CCM_Publication_ptr get_content ();
virtual ::CCM_History_ptr get_message_history ();
// Operations from Components::SessionComponent
virtual void set_session_context (::Components::SessionContext_ptr ctx);
virtual void ccm_passivate ();
::CCM_Messenger_Context_var context_;
#include "Publication_exec_i.h"
//==================================================================
// Component Executor Implementation Class: Messenger_exec_i
//==================================================================
Messenger_exec_i::Messenger_exec_i ()
// initialize user-defined data members
this->control_ = new Runnable_exec_i();
this->history_ = new History_exec_i();
this->content_ = new Publication_exec_i(
"The quick brown fox jumped over the lazy dog",
Messenger_exec_i::~Messenger_exec_i (void)
this->control_->_remove_ref();
this->history_->_remove_ref();
this->content_->_remove_ref();
The bulk of the Messenger’s logic is in the svc() method.
ACE_DEBUG((LM_INFO, ACE_TEXT("svc()\n")));
ACE_OS::sleep( this->content_->period() );
// get the run_lock from the Runnable executor; we have an
// agreement with the Runnable executor that we must wait for
// the run_lock to be released before we publish.
ACE_Guard<ACE_Thread_Mutex> guard( this->control_->get_run_lock() );
// create a message to publish
::Message_var msg = new ::OBV_Message();
msg->subject( this->subject() );
msg->text( this->content_->text() );
msg->user( CORBA::string_dup( this->user_.c_str() ) );
// add the message to the message history
this->history_->add( msg.in() );
ACE_TEXT("Messenger_exec_i::svc: publishing message\n") ));
// publish to all interested consumers
this->context_->push_message_publisher( msg.in() );
ACE_TEXT("Published Message on subject %C\n User %C\n Text %C\n"),
return CORBA::string_dup( this->subject_.c_str() );
Messenger_exec_i::subject (const char* subject)
this->subject_ = CORBA::string_dup( subject );
Messenger_exec_i::get_content ()
// bump up ref count because we give up ownership when we return this
Messenger_exec_i::get_control ()
// bump up ref count because we give up ownership when we return this
Messenger_exec_i::get_message_history ()
// bump up ref count because we give up ownership when we return this
// Operations from Components::SessionComponent
Messenger_exec_i::set_session_context (::Components::SessionContext_ptr ctx)
this->context_ = ::CCM_Messenger_Context::_narrow (ctx);
if (CORBA::is_nil (this->context_.in ()))
Messenger_exec_i::ccm_activate ()
ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_activate\n")));
Messenger_exec_i::ccm_passivate ()
home MessengerHome manages Messenger {};
composition session Messenger_Impl
home executor MessengerHome_Exec
![]() |
class MESSENGER_EXEC_Export MessengerHome_exec_i
: public virtual MessengerHome_Exec,
public virtual ::CORBA::LocalObject
The CIDL compiler generates a default constructor and destructor.
virtual ~MessengerHome_exec_i (void);
virtual ::Components::EnterpriseComponent_ptr create ();
extern "C" MESSENGER_EXEC_Export ::Components::HomeExecutorBase_ptr
create_MessengerHome_Impl (void);
//==================================================================
// Home Executor Implementation Class: MessengerHome_exec_i
//==================================================================
MessengerHome_exec_i::MessengerHome_exec_i (void)
MessengerHome_exec_i::~MessengerHome_exec_i (void)
::Components::EnterpriseComponent_ptr
MessengerHome_exec_i::create ()
::Components::EnterpriseComponent_ptr retval =
::Components::EnterpriseComponent::_nil ();
extern "C" MESSENGER_EXEC_Export ::Components::HomeExecutorBase_ptr
create_MessengerHome_Impl (void)
::Components::HomeExecutorBase_ptr retval =
::Components::HomeExecutorBase::_nil ();
![]() |
consumes Message message_consumer;
home ReceiverHome manages Receiver {};
composition session Receiver_Impl
home executor ReceiverHome_Exec
consumes <event_type> <facet_name>;
virtual void push_<facet_name>( <event_type>* ev );
In our example, the IDL statement
consumes Message message_consumer;
virtual void push_message_consumer( ::Message* ev);
#include "Receiver_exec_export.h"
class RECEIVER_EXEC_Export Receiver_exec_i
: public virtual Receiver_Exec,
public virtual ::CORBA::LocalObject
virtual ~Receiver_exec_i (void);
virtual void push_message_consumer (::Message *ev);
virtual void set_session_context (::Components::SessionContext_ptr ctx);
virtual void ccm_passivate ();
::CCM_Receiver_Context_var context_;
uses <facet_interface> <facet_name>;
::<facet_interface>_ptr get_connection_<facet_name>();
::History_ptr get_connection_message_history();
//==================================================================
// Component Executor Implementation Class: Receiver_exec_i
//==================================================================
Receiver_exec_i::Receiver_exec_i (void)
Receiver_exec_i::~Receiver_exec_i (void)
Receiver_exec_i::push_message_consumer (::Message * ev)
CORBA::String_var subject = ev->subject();
CORBA::String_var user = ev->user();
CORBA::String_var text = ev->text();
ACE_TEXT("Received Message:\n Subject: %C\n User: %C\n Text: %C\n"),
// Use the history to (inefficiently) get the total number of messages
// published on this item so far
::History_var history = this->context_->get_connection_message_history();
::Messages_var messages = history->get_all();
ACE_TEXT(" Subject \"%C\" has published %d messages so far\n"),
// Operations from Components::SessionComponent
Receiver_exec_i::set_session_context (::Components::SessionContext_ptr ctx)
this->context_ = ::CCM_Receiver_Context::_narrow (ctx)
if (CORBA::is_nil (this->context_.in ()))
Receiver_exec_i::ccm_activate ()
Receiver_exec_i::ccm_passivate ()
home ReceiverHome manages Receiver {};
composition session Receiver_Impl
home executor ReceiverHome_Exec
class RECEIVER_EXEC_Export ReceiverHome_exec_i
: public virtual ReceiverHome_Exec,
public virtual ::CORBA::LocalObject
virtual ~ReceiverHome_exec_i (void);
virtual ::Components::EnterpriseComponent_ptr create ();
extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr
create_ReceiverHome_Impl (void);
//==================================================================
// Home Executor Implementation Class: ReceiverHome_exec_i
//==================================================================
ReceiverHome_exec_i::ReceiverHome_exec_i (void)
ReceiverHome_exec_i::~ReceiverHome_exec_i (void)
::Components::EnterpriseComponent_ptr
ReceiverHome_exec_i::create ()
::Components::EnterpriseComponent_ptr retval =
::Components::EnterpriseComponent::_nil ();
extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr
create_ReceiverHome_Impl (void)
::Components::HomeExecutorBase_ptr retval =
::Components::HomeExecutorBase::_nil ();
![]() |
uses multiple Runnable runnables;
uses multiple Publication content;
home AdministratorHome manages Administrator {};
composition session Administrator_Impl
home executor AdministratorHome_Exec
uses <facet_interface> <facet_name>;
::<facet_interface>_ptr get_connection_<facet_name>();
::History_ptr get_connection_message_history();
uses multiple <facet_interface> <facet_name>;
typedef <facet_name>Connection_var _var_type;
typedef sequence< <facet_name>Connection > <facet_name>Connections;
::<component name>::<facet_name>Connections*
get_connections_<facet_name>();
uses multiple Runnable runnables;
causes the IDL and CIDL compilers to generate the following:
typedef runnablesConnection_var _var_type;
typedef sequence< runnablesConnection > runnablesConnections;
::Administrator::runnablesConnections* get_connections_runnables();
#include "Administrator_svnt.h"
#include "Administrator_exec_export.h"
The executor inherits from ACE_Task_Base to realize the active object pattern.
class ADMINISTRATOR_EXEC_Export Administrator_exec_i
: public virtual Administrator_Exec,
public virtual ::CORBA::LocalObject
virtual ~Administrator_exec_i (void);
virtual void set_session_context (::Components::SessionContext_ptr ctx);
virtual void ccm_passivate ();
::CCM_Administrator_Context_var context_;
// Overridden from ACE_Task_Base
void changePublicationPeriod();
#include "Administrator_exec_i.h"
//==================================================================
// Component Executor Implementation Class: Administrator_exec_i
//==================================================================
Administrator_exec_i::Administrator_exec_i (void)
Administrator_exec_i::~Administrator_exec_i (void)
Administrator_exec_i::set_session_context (
::Components::SessionContext_ptr ctx)
this->context_ = ::CCM_Administrator_Context::_narrow (ctx);
if (CORBA::is_nil (this->context_.in ()))
Administrator_exec_i::ccm_activate ()
// Activate the Task, triggering its svc() method
Administrator_exec_i::ccm_passivate ()
Administrator_exec_i::ccm_remove ()
enum SelectionType { START=1, STOP, CHANGE_PERIOD, CHANGE_TEXT };
std::cout << "\nWhat do you want to do to the Messenger(s)?" << std::endl;
std::cout << START << ". Start" << std::endl;
std::cout << STOP << ". Stop" << std::endl;
std::cout << CHANGE_PERIOD << ". Change Publication Period" << std::endl;
std::cout << CHANGE_TEXT << ". Change Publication Text" << std::endl;
std::cout << "Please enter a selection: ";
std::cin.getline( selection_text, sizeof(selection_text) );
int selection = ACE_OS::atoi(selection_text);
std::cout << "Please enter a valid option" << std::endl;
void Administrator_exec_i::startPublishing()
// Get the attached Runnable facet(s)
::Administrator::runnablesConnections_var connections =
this->context_->get_connections_runnables();
std::cout << "Starting Publication" << std::endl;
for ( CORBA::ULong i = 0; i < connections->length(); ++i ) {
Runnable_var runnable = (*connections)[i].objref;
void Administrator_exec_i::stopPublishing()
// Get the attached Runnable facet(s)
::Administrator::runnablesConnections_var connections =
this->context_->get_connections_runnables();
std::cout << "Stopping Publication" << std::endl;
for ( CORBA::ULong i = 0; i < connections->length(); ++i ) {
Runnable_var runnable = (*connections)[i].objref;
void Administrator_exec_i::changePublicationPeriod()
// Get the attached Publication facet(s)
::Administrator::contentConnections_var contents =
this->context_->get_connections_content();
std::cout << "Please enter a new period in seconds: ";
std::cin.getline( period, sizeof( period ) );
for ( CORBA::ULong i = 0; i < contents->length(); ++i ) {
Publication_var publication = (*contents)[i].objref;
publication->period( ACE_OS::atoi(period) );
void Administrator_exec_i::changePublicationText()
// Get the attached Publication facet(s)
::Administrator::contentConnections_var contents =
this->context_->get_connections_content();
std::cout << "Please enter new text: ";
std::cin.getline( buffer, sizeof(buffer) );
for ( CORBA::ULong i = 0; i < contents->length(); ++i ) {
component Administrator { ... };
home AdministratorHome manages Administrator {};
composition session Administrator_Impl
home executor AdministratorHome_Exec
class ADMINISTRATOR_EXEC_Export AdministratorHome_exec_i
: public virtual AdministratorHome_Exec,
public virtual ::CORBA::LocalObject
AdministratorHome_exec_i (void);
virtual ~AdministratorHome_exec_i (void);
virtual ::Components::EnterpriseComponent_ptr create ();
extern "C" ADMINISTRATOR_EXEC_Export ::Components::HomeExecutorBase_ptr
create_AdministratorHome_Impl (void);
//==================================================================
// Home Executor Implementation Class: AdministratorHome_exec_i
//==================================================================
AdministratorHome_exec_i::AdministratorHome_exec_i (void)
AdministratorHome_exec_i::~AdministratorHome_exec_i (void)
::Components::EnterpriseComponent_ptr
AdministratorHome_exec_i::create ()
::Components::EnterpriseComponent_ptr retval =
::Components::EnterpriseComponent::_nil ();
extern "C" ADMINISTRATOR_EXEC_Export ::Components::HomeExecutorBase_ptr
create_AdministratorHome_Impl (void)
::Components::HomeExecutorBase_ptr retval =
::Components::HomeExecutorBase::_nil ();
![]() |
![]() |
![]() |
![]() |
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ImplementationArtifactDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>ACE/TAO/CIAO Libraries</label>
<location>$ACE_ROOT/lib/ACE</location>
<location>$ACE_ROOT/lib/TAO</location>
<location>$ACE_ROOT/lib/CIAO_Client</location>
</Deployment:ImplementationArtifactDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ImplementationArtifactDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Stub Artifact</label>
<location>Messenger_stub</location>
<referencedArtifact href="Libraries.iad"/>
</Deployment:ImplementationArtifactDescription>
<string>This IAD describes the Messenger's stub library</string>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ImplementationArtifactDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Servant Artifact</label>
<location>Messenger_svnt</location>
<referencedArtifact href="Libraries.iad"/>
<referencedArtifact href="Messenger_Stub.iad"/>
<string>createMessengerHome_Servant</string>
</Deployment:ImplementationArtifactDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ImplementationArtifactDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Executor Artifact</label>
<location>Messenger_exec</location>
<referencedArtifact href="Libraries.iad"/>
<referencedArtifact href="Messenger_Stub.iad"/>
<string>createMessengerHome_Impl</string>
</Deployment:ImplementationArtifactDescription>
publishes Message message_publisher;
provides History message_history;
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ComponentInterfaceDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Component</label>
<specificType>IDL:Messenger:1.0</specificType>
<supportedType>IDL:Messenger:1.0</supportedType>
<idlFile>Messenger.idl</idlFile>
component Messenger supports MyInterface {
<supportedType>IDL:MyInterface:1.0</supportedType>
<exclusiveProvider>false</exclusiveProvider>
<exclusiveUser>false</exclusiveUser>
<specificType>IDL:Runnable:1.0</specificType>
<supportedType>IDL:Runnable:1.0</supportedType>
<exclusiveProvider>false</exclusiveProvider>
<exclusiveUser>false</exclusiveUser>
<supportedType>IDL:Publication:1.0</supportedType>
<specificType>IDL:Publication:1.0</specificType>
<name>message_publisher</name>
<exclusiveProvider>false</exclusiveProvider>
<exclusiveUser>false</exclusiveUser>
<supportedType>IDL:Message:1.0</supportedType>
<specificType>IDL:Message:1.0</specificType>
<exclusiveProvider>false</exclusiveProvider>
<exclusiveUser>false</exclusiveUser>
<supportedType>IDL:History:1.0</supportedType>
<specificType>IDL:History:1.0</specificType>
<string>Default Subject</string>
</Deployment:ComponentInterfaceDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ComponentImplementationDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Implementation</label>
<implements href="Messenger.ccd"/>
<referencedArtifact href="Messenger_Stub.iad"/>
<referencedArtifact href="Messenger_Svnt.iad"/>
<referencedArtifact href="Messenger_Exec.iad"/>
<string>Messenger.ior</string>
</Deployment:ComponentImplementationDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ComponentPackageDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Component</label>
<realizes href="Messenger.ccd"/>
<referencedImplementation href="Messenger.cid"/>
![]() |
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ImplementationArtifactDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Receiver Stub Artifact</label>
<location>Receiver_stub</location>
<referencedArtifact href="Libraries.iad"/>
<referencedArtifact href="Messenger_Stub.iad"/>
</Deployment:ImplementationArtifactDescription>
consumes Message message_consumer;
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ComponentInterfaceDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Receiver Component</label>
<specificType>IDL:Receiver:1.0</specificType>
<supportedType>IDL:Receiver:1.0</supportedType>
<idlFile>Receiver.idl</idlFile>
<exclusiveProvider>false</exclusiveProvider>
<exclusiveUser>false</exclusiveUser>
<supportedType>IDL:Message:1.0</supportedType>
<specificType>IDL:Message:1.0</specificType>
<exclusiveProvider>false</exclusiveProvider>
<exclusiveUser>true</exclusiveUser>
<supportedType>IDL:History:1.0</supportedType>
<specificType>IDL:History:1.0</specificType>
<kind>SimplexReceptacle</kind>
</Deployment:ComponentInterfaceDescription>
![]() |
uses multiple Runnable runnables;
uses multiple Publication content;
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ComponentInterfaceDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Administrator Component</label>
<specificType>IDL:Administrator:1.0</specificType>
<supportedType>IDL:Administrator:1.0</supportedType>
<idlFile>Administrator.idl</idlFile>
<exclusiveProvider>false</exclusiveProvider>
<exclusiveUser>true</exclusiveUser>
<supportedType>IDL:Runnable:1.0</supportedType>
<specificType>IDL:Runnable:1.0</specificType>
<kind>MultiplexReceptacle</kind>
<exclusiveProvider>false</exclusiveProvider>
<exclusiveUser>true</exclusiveUser>
<supportedType>IDL:Publication:1.0</supportedType>
<specificType>IDL:Publication:1.0</specificType>
<kind>MultiplexReceptacle</kind>
</Deployment:ComponentInterfaceDescription>
![]() |
![]() |
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ComponentInterfaceDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Assembly</label>
</Deployment:ComponentInterfaceDescription>
![]() |
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ComponentImplementationDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Assembly</label>
<implements href="MessengerAssembly.ccd"/>
<instance xmi:id="a_Messenger">
<name>Messenger_Instance</name>
<package href="Messenger.cpd"/>
<instance xmi:id="first_Receiver">
<name>First_Receiver_Instance</name>
<package href="Receiver.cpd"/>
<instance xmi:id="second_Receiver">
<name>Second_Receiver_Instance</name>
<package href="Receiver.cpd"/>
<instance xmi:id="a_Administrator">
<name>Administrator_Instance</name>
<package href="Administrator.cpd"/>
<name>Messenger_to_First_Receiver_Publish</name>
<portName>message_publisher</portName>
<instance xmi:idref="a_Messenger"/>
<portName>message_consumer</portName>
<instance xmi:idref="first_Receiver"/>
<name>Messenger_to_First_Receiver_History</name>
<portName>message_history</portName>
<instance xmi:idref="a_Messenger"/>
<portName>message_history</portName>
<instance xmi:idref="first_Receiver"/>
![]() |
<name>Messenger_to_Second_Receiver_Publisher</name>
<portName>message_publisher</portName>
<instance xmi:idref="a_Messenger"/>
<portName>message_consumer</portName>
<instance xmi:idref="second_Receiver"/>
<name>Messenger_to_Second_Receiver_History</name>
<portName>message_history</portName>
<instance xmi:idref="a_Messenger"/>
<portName>message_history</portName>
<instance xmi:idref="second_Receiver"/>
<name>Messenger_to_Administrator_Control</name>
<instance xmi:idref="a_Messenger"/>
<portName>runnables</portName>
<instance xmi:idref="a_Administrator"/>
<name>Messenger_to_Administrator_Content</name>
<instance xmi:idref="a_Messenger"/>
<instance xmi:idref="a_Administrator"/>
<externalName>subject</externalName>
<propertyName>subject</propertyName>
<instance xmi:idref="a_Messenger"/>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:ComponentPackageDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Assembly Package</label>
<realizes href="MessengerAssembly.ccd"/>
<name>Messenger Application</name>
<referencedImplementation href="MessengerAssembly.cid"/>
</Deployment:ComponentPackageDescription>
![]() |
![]() |
![]() |
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:PackageConfiguration
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Application Configuration</label>
<basePackage href="MessengerAssembly.cpd"/>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Deployment:TopLevelPackageDescription
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<package href="Application.pcd"/>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Deployment Plan</label>
<instance xmi:id="Messenger_Instance_ID">
<name>Messenger_Instance</name>
<instance xmi:id="First_Receiver_Instance_ID">
<name>First_Receiver_Instance</name>
<node>First_Receiver_Node</node>
<instance xmi:id="Second_Receiver_Instance_ID">
<name>Second_Receiver_Instance</name>
<node>Second_Receiver_Node</node>
<instance xmi:id="Administrator_Instance_ID">
<name>Administrator_Instance</name>
<?xml version="1.0" encoding="UTF-8" ?>
xmlns:Deployment="http://www.omg.org/Deployment"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
<label>Messenger Application Domain</label>
<label>Messenger's Node</label>
<name>First_Receiver_Node</name>
<label>First Receiver's Node</label>
<name>Second_Receiver_Node</name>
<label>Second Receiver's Node</label>
<name>Administrator_Node</name>
<label>Administrator's Node</label>
Administrator_Node corbaloc:iiop:localhost:10000/NodeManager
First_Receiver_Node corbaloc:iiop:localhost:20000/NodeManager
Second_Receiver_Node corbaloc:iiop:localhost:30000/NodeManager
Messenger_Node corbaloc:iiop:localhost:40000/NodeManager
![]() |
The base path for all CIAO-related code, normally $TAO_ROOT/CIAO ( %TAO_ROOT%\CIAO ).
The base directory of the Xerces C++ installation. See See Building CIAO with Visual C++ See Obtain and Build the Xerces C++ Libraryand See Building CIAO on UNIX with GNU Make and gcc for more information on Xerces C++.
The library path must include the directory containing the Xerces C++ dynamic libraries, $XERCESCROOT/bin ( %XERCESCROOT%\bin ). You should add this location to your LD_LIBRARY_PATH environment variable or its equivalent. (On Windows, add this directory to your PATH so DLLs can be located at run time.)
$CIAO_ROOT/bin/generate_component_mpc.pl <component name>
$CIAO_ROOT/bin/generate_component_mpc.pl Messenger
The following commands have been executed:
generate_export_file.pl MESSENGER_STUB > Messenger_stub_export.h
generate_export_file.pl MESSENGER_SVNT > Messenger_svnt_export.h
generate_export_file.pl MESSENGER_EXEC > Messenger_exec_export.h
project(Messenger_stub): ccm_stub {
idlflags += -Wb,stub_export_macro=MESSENGER_STUB_Export
idlflags += -Wb,stub_export_include=Messenger_stub_export.h
idlflags += -Wb,skel_export_macro=MESSENGER_SVNT_Export
idlflags += -Wb,skel_export_include=Messenger_svnt_export.h
dynamicflags = MESSENGER_STUB_BUILD_DLL
project(Messenger_svnt) : ciao_servant {
idlflags += -Wb,export_macro=MESSENGER_SVNT_Export
idlflags += -Wb,export_include=Messenger_svnt_export.h
dynamicflags = MESSENGER_SVNT_BUILD_DLL
project(Messenger_exec) : ciao_executor {
libs += Messenger_stub Messenger_svnt
idlflags += -Wb,export_macro=MESSENGER_EXEC_Export
idlflags += -Wb,export_include=Messenger_exec_export.h
dynamicflags = MESSENGER_EXEC_BUILD_DLL
project(Messenger_stub): ccm_stub {
idlflags += -Wb,stub_export_macro=MESSENGER_STUB_Export
idlflags += -Wb,stub_export_include=Messenger_stub_export.h
idlflags += -Wb,skel_export_macro=MESSENGER_SVNT_Export
idlflags += -Wb,skel_export_include=Messenger_svnt_export.h
dynamicflags = MESSENGER_STUB_BUILD_DLL
project(Messenger_svnt): ciao_servant_dnc {
idlflags += -Wb,export_macro=MESSENGER_SVNT_Export
idlflags += -Wb,export_include=Messenger_svnt_export.h
dynamicflags = MESSENGER_SVNT_BUILD_DLL
// project must be a ciao_servant or ciao_server to use CIDL files
project(Messenger_exec): ciao_component_dnc {
libs += Messenger_stub Messenger_svnt
idlflags += -Wb,export_macro=MESSENGER_EXEC_Export
idlflags += -Wb,export_include=Messenger_exec_export.h
dynamicflags = MESSENGER_EXEC_BUILD_DLL
generate_component_mpc.pl Receiver
generate_component_mpc.pl Administrator
project(Receiver_stub): ccm_stub {
idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export
idlflags += -Wb,stub_export_include=Receiver_stub_export.h
idlflags += -Wb,skel_export_macro=RECEIVER_SVNT_Export
idlflags += -Wb,skel_export_include=Receiver_svnt_export.h
dynamicflags = RECEIVER_STUB_BUILD_DLL
project(Receiver_svnt): ciao_servant_dnc {
after += Receiver_stub Messenger_svnt
libs += Receiver_stub Messenger_stub Messenger_svnt
idlflags += -Wb,export_macro=RECEIVER_SVNT_Export
idlflags += -Wb,export_include=Receiver_svnt_export.h
dynamicflags = RECEIVER_SVNT_BUILD_DLL
project(Receiver_exec): ciao_component_dnc {
libs += Receiver_stub Receiver_svnt Messenger_stub
idlflags += -Wb,export_macro=RECEIVER_EXEC_Export
idlflags += -Wb,export_include=Receiver_exec_export.h
![]() |
![]() |
A process that maps component instances to component servers |
|
A process that parses a set of deployment descriptors and sends deployment information to the ExecutionManager |
$DANCE_ROOT/bin/dance_node_manager \
-ORBListenEndpoints iiop://localhost:10000 \
-s "$CIAO_ROOT/bin/ciao_componentserver"
$DANCE_ROOT/bin/dance_node_manager \
-ORBListenEndpoints iiop://localhost:20000 \
-s "$CIAO_ROOT/bin/ciao_componentserver"
$DANCE_ROOT/bin/dance_node_manager \
-ORBListenEndpoints iiop://localhost:30000 \
-s "$CIAO_ROOT/bin/ciao_componentserver"
$DANCE_ROOT/bin/dance_node_manager \
-ORBListenEndpoints iiop://localhost:40000 \
-s "$CIAO_ROOT/bin/ciao_componentserver"
cd $CIAO_ROOT/examples/DevGuideExamples/Messenger/descriptors
$DANCE_ROOT/bin/dance_execution_manager \
-o em.ior -i ApplicationNodeMap.dat
cd $CIAO_ROOT/examples/DevGuideExamples/Messenger/descriptors
$DANCE_ROOT/bin/dance_repository_manager \
-p package.tpd -d Application.cdp -k file://em.ior
$DANCE_ROOT/bin/dance_node_manager
-ORBListenEndpoints iiop://localhost:10000
%DANCE_ROOT%\bin\dance_node_manager.exe
-ORBListenEndpoints iiop://localhost:10000
-s "devenv /debugexe %CIAO_ROOT%\bin\ciao_componentserver.exe"
set XERCESCROOT=C:\xerces-c-src_2_6_0
copy ..\Build\Win32\VC7\Debug\xerces-c_2D.lib
copy xerces-c_2D.lib xerces-cd.lib
# please order by name to ease maintenance
#subinclude libs/date_time/build ;
subinclude libs/filesystem/build ;
#subinclude libs/python/build ;
#subinclude libs/signals/build ;
#subinclude libs/thread/build ;
C:\Boost-Jam\bjam.exe "-sTOOLS=vc7.1"
copy C:\Boost-1.30.2\libs\regex\build\bin\libboost_regex.lib\vc7.1\debug\runtime-link-dynamic\libboost_regex_debug.lib
copy C:\Boost-1.30.2\libs\filesystem\build\bin\libboost_filesystem.lib\vc7.1\debug\runtime-link-dynamic\libboost_filesystem.lib
rename libboost_regex_debug.lib boost_regex_debug.lib
http://www.dre.vanderbilt.edu/cidlc/prerequisites/Utility-1.2.2.tar.bz2
set XERCESCROOT=C:\xerces-c-src_2_6_0
set UTILITY_ROOT=C:\Utility-1.2.2
export XERCESCROOT=$HOME/xerces-c-src_2_6_0
./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread
http://www.dre.vanderbilt.edu/cidlc/prerequisites/Utility-1.2.2.tar.bz2
export CIAO_ROOT=$TAO_ROOT/CIAO
export XERCESCROOT=$HOME/xerces-c-src_2_6_0
export UTILITY_ROOT=$HOME/Utility-1.2.2
export BOOST_ROOT=$HOME/boost_1_32_0
export BOOST_INCLUDE=$BOOST_ROOT
export BOOST_LIB=$BOOST_ROOT/libs
Administrator_Node corbaloc:iiop:localhost:10000/NodeManager
First_Receiver_Node corbaloc:iiop:localhost:20000/NodeManager
Second_Receiver_Node corbaloc:iiop:localhost:30000/NodeManager
Messenger_Node corbaloc:iiop:localhost:40000/NodeManager
$DANCE_ROOT/bin/dance_node_manager \
-ORBListenEndpoints iiop://localhost:10000 \
-s "$CIAO_ROOT/bin/ciao_componentserver"
$DANCE_ROOT/bin/dance_execution_Manager \
-o em.ior -i ApplicationNodeMap.dat
$DANCE_ROOT/bin/dance_repository_manager \
![]() |
cidlc -I . -I $CIAO_ROOT/ccm -I $CIAO_ROOT/ciao -I $TAO_ROOT \
-I $CIAO_ROOT/ccm -I $CIAO_ROOT/ciao -I $TAO_ROOT -I $TAO_ROOT/tao -I $TAO_ROOT/orbsvcs
Run the preprocessor on the IDL file, but do not generate any IDL or C++ code. |
||
Add include_path to the list of paths searched for include files. |
Use this suffix instead of the default to construct the name of the descriptor file. |
||
Use this regular expression to construct the name of the descriptor file |
![]() |
tao_idl3_to_idl2 -I $CIAO_ROOT -I $CIAO_ROOT/ciao -I $CIAO_ROOT/ciao -I $TAO_ROOT \
-I $TAO_ROOT/tao -I $TAO_ROOT/orbsvcs \
Equivalent IDL2 for Messenger’s IDL3 file, to be run through another ORB’s IDL compiler. |
publishes Message message_publisher;
provides History message_history;
home MessengerHome manages Messenger {};
#include "Publication_IDL2.idl"
interface Messenger : Components::CCMObject
Publication provide_content ();
History provide_message_history ();
Components::Cookie subscribe_message_publisher (
raises (Components::ExceededConnectionLimit);
MessageConsumer unsubscribe_message_publisher (in Components::Cookie ck)
raises (Components::InvalidConnection);
interface MessengerHomeExplicit : Components::CCMHome
interface MessengerHomeImplicit : Components::KeylessCCMHome
raises (Components::CreateFailure);
interface MessengerHome : MessengerHomeExplicit, MessengerHomeImplicit
tao_idl3_to_idl2 -I $CIAO_ROOT -I $CIAO_ROOT/ciao -I $CIAO_ROOT/ciao -I $TAO_ROOT \