diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2005-09-01 15:28:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2005-09-01 15:28:11 +0000 |
commit | 673f08b8c0467969f4d65a713e193daabc8a19e3 (patch) | |
tree | 0e0307a9dd8220b3ac5d1df47b3a80a341d2b35d | |
parent | 577271c298fec3f237d8eab805f71f5c653a268f (diff) | |
download | ATCD-673f08b8c0467969f4d65a713e193daabc8a19e3.tar.gz |
Thu Sep 1 10:20:48 2005 William Otte <wotte@dre.vanderbilt.edu>
101 files changed, 3296 insertions, 8243 deletions
diff --git a/TAO/CIAO/ciao/Active_Objref_Map.cpp b/TAO/CIAO/ciao/Active_Objref_Map.cpp deleted file mode 100644 index 00558f8f796..00000000000 --- a/TAO/CIAO/ciao/Active_Objref_Map.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// $Id$ - -#include "ciao/Active_Objref_Map.h" - - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Active_Map_Manager<CORBA::Object_var>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Active_Map_Manager<CORBA::Object_var>; -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/CIAO/ciao/Active_Objref_Map.h b/TAO/CIAO/ciao/Active_Objref_Map.h deleted file mode 100644 index 15a366f0969..00000000000 --- a/TAO/CIAO/ciao/Active_Objref_Map.h +++ /dev/null @@ -1,36 +0,0 @@ -// $Id$ - -/** - * @file Active_Objref_Map.h - * - * A CIAO implementation of object reference map which enables - * fast insertion/deletion/indexing of object reference thru - * map-generated keys. - * - * @sa ACE_Active_Map_Manager - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef CIAO_ACTIVE_OBJREF_MAP_H -#define CIAO_ACTIVE_OBJREF_MAP_H -#include /**/ "ace/pre.h" - -#include "ace/Active_Map_manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciao/CIAO_Container_Export.h" -#include "tao/Object.h" - -namespace CIAO -{ - typedef ACE_Active_Map_Manager<CORBA::Object_var> Active_Objref_Map; - - CIAO_CONTAINER_SINGLETON_DECLARATION (ACE_Active_Map_Manager<CORBA::Object_var>); -} - -#include /**/ "ace/post.h" -#endif /* CIAO_ACTIVE_OBJREF_MAP_H */ diff --git a/TAO/CIAO/ciao/CCM_Base.idl b/TAO/CIAO/ciao/CCM_Base.idl deleted file mode 100644 index 7e89723be4b..00000000000 --- a/TAO/CIAO/ciao/CCM_Base.idl +++ /dev/null @@ -1,144 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -I W:/ACE_wrappers/TAO Component_Base.idl - * tao_idl -I ../.. \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Base.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if defined (CIAO_HAS_IMPORT_KEYWORD) -// import ::CORBA; -#else -#include <orb.idl> -#endif /* CIAO_HAS_IMPORT_KEYWORD */ - -#if !defined (CCM_BASE_IDL) -#define CCM_BASE_IDL - -module Components -{ - /** - * @@ Commented out temporarily for lack of typePrefix support. - */ - typeprefix Components "omg.org"; - - typedef string FeatureName; - typedef sequence<FeatureName> NameList; - - valuetype Cookie - { - private CORBA::OctetSeq cookieValue; - }; - - valuetype PortDescription - { - public FeatureName name; - public CORBA::RepositoryId type_id; - }; - - valuetype FacetDescription : PortDescription - { - public Object facet_ref; - }; - - typedef sequence<FacetDescription> FacetDescriptions; - - typedef unsigned long FailureReason; - - exception InvalidName {}; - exception InvalidConnection {}; - exception ExceededConnectionLimit {}; - exception AlreadyConnected {}; - exception NoConnection {}; - exception CookieRequired {}; - exception CreateFailure { - FailureReason reason; - }; - exception FinderFailure - { - FailureReason reason; - }; - exception RemoveFailure - { - FailureReason reason; - }; - exception DuplicateKeyValue {}; - exception InvalidKey {}; - exception UnknownKeyValue {}; - exception NoKeyAvailable {}; - exception BadEventType - { - CORBA::RepositoryId expected_event_type; - }; - exception HomeNotFound {}; - exception WrongComponentType {}; - - typedef FailureReason InvalidConfigurationReason; - const InvalidConfigurationReason UnknownConfigValueName = 0; - const InvalidConfigurationReason InvalidConfigValueType = 1; - const InvalidConfigurationReason ConfigValueRequired = 2; - const InvalidConfigurationReason ConfigValueNotExpected = 3; - exception InvalidConfiguration - { - InvalidConfigurationReason reason; - FeatureName name; - }; - exception IllegalState {}; - - interface Navigation - { - Object provide_facet (in FeatureName name) - raises (InvalidName); - FacetDescriptions get_all_facets(); - FacetDescriptions get_named_facets (in NameList names) - raises (InvalidName); - boolean same_component (in Object object_ref); - }; - - valuetype ConnectionDescription - { - public Cookie ck; - public Object objref; - }; - typedef sequence<ConnectionDescription> ConnectionDescriptions; - - valuetype ReceptacleDescription : PortDescription - { - public boolean is_multiple; - public ConnectionDescriptions connections; - }; - typedef sequence<ReceptacleDescription> ReceptacleDescriptions; - - interface Receptacles - { - Cookie connect (in FeatureName name, in Object connection ) - raises (InvalidName, - InvalidConnection, - AlreadyConnected, - ExceededConnectionLimit); - - // @@ Changed to return the previously connected object reference -- basef on RTF 1.1. - Object disconnect (in FeatureName name, in Cookie ck) - raises (InvalidName, - InvalidConnection, - CookieRequired, - NoConnection); - - ConnectionDescriptions get_connections (in FeatureName name) - raises (InvalidName); - - ReceptacleDescriptions get_all_receptacles (); - - ReceptacleDescriptions get_named_receptacles (in NameList names) - raises (InvalidName); - }; -}; -#endif /* CCM_BASE_IDL */ diff --git a/TAO/CIAO/ciao/CCM_Component.idl b/TAO/CIAO/ciao/CCM_Component.idl deleted file mode 100644 index 3dcc86e4dd3..00000000000 --- a/TAO/CIAO/ciao/CCM_Component.idl +++ /dev/null @@ -1,149 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_COMPONENT_IDL) -#define CCM_COMPONENT_IDL - -#include "CCM_Event.idl" -#include "tao/IFR_Client/IFR_Base.pidl" - -module Components -{ - typeprefix Components "omg.org"; - - abstract valuetype PrimaryKeyBase {}; - - interface CCMObject; //forward reference - - interface CCMHome - { - CORBA::IRObject get_component_def (); - CORBA::IRObject get_home_def (); - void remove_component ( in CCMObject comp) - raises (RemoveFailure); - }; - typedef sequence<CCMHome> CCMHomes; - - interface KeylessCCMHome - { - CCMObject create_component() - raises (CreateFailure); - }; - - interface HomeFinder - { - CCMHome find_home_by_component_type (in CORBA::RepositoryId comp_repid) - raises (HomeNotFound); - - CCMHome find_home_by_home_type (in CORBA::RepositoryId home_repid) - raises (HomeNotFound); - - CCMHome find_home_by_name (in string home_name) - raises (HomeNotFound); - }; - - interface Configurator - { - void configure (in CCMObject comp) - raises (WrongComponentType); - }; - - valuetype ConfigValue - { - public FeatureName name; - public any value; - }; - - typedef sequence<ConfigValue> ConfigValues; - - interface StandardConfigurator : Configurator - { - void set_configuration (in ConfigValues descr); - }; - - interface HomeConfiguration : CCMHome - { - void set_configurator (in Configurator cfg); - void set_configuration_values (in ConfigValues config); - void complete_component_configuration (in boolean b); - void disable_home_configuration(); - }; - - valuetype ComponentPortDescription - { - public FacetDescriptions facets; - public ReceptacleDescriptions receptacles; - public ConsumerDescriptions consumers; - public EmitterDescriptions emitters; - public PublisherDescriptions publishers; - }; - - interface CCMObject : Navigation, Receptacles, Events - { - CORBA::IRObject get_component_def ( ); - CCMHome get_ccm_home( ); - PrimaryKeyBase get_primary_key( ) - raises (NoKeyAvailable); - - /// CIAO specific operations to have some control on when and how - /// to activate components. - /** - * This is all from our work on ARMS where we needed to know whether - * every component has been configured, say for example to use - * logging in the assembly which could in turn be provided by a - * component. To get around all this we are adding some methods on - * this till we think of some standard way to do this. The problem - * is that the deployer should be able to call this as opposed to - * the home calling it as soon as the component is created. - * - * All these operations are called in the order mentioned, ie. the - * deployer calls ciao_preactivate () on all components, then - * ciao_activate and then ciao_postactivate (). The speciality is - * that these operations would be invoked on every target object - * before the next call is made. It is similar to the way - * portable interceptors work, trying to get everything onto the - * flow stack, but differ in the intention. - */ - void ciao_preactivate () - raises (InvalidConfiguration); - - void ciao_activate () - raises (InvalidConfiguration); - - void ciao_postactivate () - raises (InvalidConfiguration); - - void configuration_complete () - raises (InvalidConfiguration); - - void remove() - raises (RemoveFailure); - ComponentPortDescription get_all_ports (); - }; - - // @@ Enumeration and DefaultEnumeration are only for EJB to CCM - // mapping? At any rate, we should be able to skip them for now. - abstract valuetype Enumeration - { - boolean has_more_elements(); - CCMObject next_element(); - }; - - typedef sequence<CCMObject> CCMObjectSeq; - - valuetype DefaultEnumeration : Enumeration - { - private CCMObjectSeq objects; - }; -}; -#endif /* CCM_COMPONENT_IDL */ diff --git a/TAO/CIAO/ciao/CCM_Container.idl b/TAO/CIAO/ciao/CCM_Container.idl deleted file mode 100644 index 220a09ea261..00000000000 --- a/TAO/CIAO/ciao/CCM_Container.idl +++ /dev/null @@ -1,155 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_CONTAINER_IDL) -#define CCM_CONTAINER_IDL - -#include "CCM_Component.idl" -#include "orbsvcs/SecurityLevel2.idl" -#include "CCM_Transaction.idl" - -// *************** Basic Container interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - typedef SecurityLevel2::Credentials Principal; - - local interface CCMContext - { - Principal get_caller_principal(); - - CCMHome get_CCM_home(); - - boolean get_rollback_only() - raises (IllegalState); - - Transaction::UserTransaction get_user_transaction() - raises (IllegalState); - - boolean is_caller_in_role (in string role); - - void set_rollback_only() - raises (IllegalState); - }; - - enum CCMExceptionReason - { - SYSTEM_ERROR, - CREATE_ERROR, - REMOVE_ERROR, - DUPLICATE_KEY, - FIND_ERROR, - OBJECT_NOT_FOUND, - NO_SUCH_ENTITY - }; - - exception CCMException - { - CCMExceptionReason reason; - }; - - local interface EnterpriseComponent {}; - - local interface SessionContext : CCMContext - { - Object get_CCM_object() - raises (IllegalState); - }; - - local interface SessionComponent : EnterpriseComponent - { - void set_session_context ( in SessionContext ctx) - raises (CCMException); - - void ccm_activate() - raises (CCMException); - - void ccm_passivate() - raises (CCMException); - - /// The following two methods are CIAO specific extension. - /** - * This method is invoked before ccm_activate () is called. All - * components in the assembly get this callback before the - * ccm_activate () is called. - */ - void ciao_preactivate () - raises (CCMException); - - /** - * This method is invoked after ccm_activate () is called. All - * components in the assembly get this callback after the - * ccm_activate () is called. - */ - void ciao_postactivate () - raises (CCMException); - - void ccm_remove () - raises (CCMException); - }; - - local interface SessionSynchronization - { - void after_begin () - raises (CCMException); - - void before_completion () - raises (CCMException); - - void after_completion (in boolean committed) - raises (CCMException); - }; - - local interface EntityContext : CCMContext - { - Object get_CCM_object () - raises (IllegalState); - - PrimaryKeyBase get_primary_key () - raises (IllegalState); - }; - - local interface EntityComponent : EnterpriseComponent - { - void set_entity_context (in EntityContext ctx) - raises (CCMException); - - void unset_entity_context () - raises (CCMException); - - void ccm_activate () - raises (CCMException); - - void ccm_load () - raises (CCMException); - - void ccm_store () - raises (CCMException); - - void ccm_passivate () - raises (CCMException); - - void ccm_remove () - raises (CCMException); - }; - - - local interface HomeExecutorBase - { - }; -}; -#endif /* CCM_CONTAINER_IDL */ diff --git a/TAO/CIAO/ciao/CCM_Container_Ex.idl b/TAO/CIAO/ciao/CCM_Container_Ex.idl deleted file mode 100644 index 0aeb481807d..00000000000 --- a/TAO/CIAO/ciao/CCM_Container_Ex.idl +++ /dev/null @@ -1,183 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_CONTAINER_EX_IDL) -#define CCM_CONTAINER_EX_IDL - -#include "CCM_Container.idl" -#include <CosPersistentState.idl> - -// *************** Extended Container Interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - enum BadComponentReferenceReason - { - NON_LOCAL_REFERENCE, - NON_COMPONENT_REFERENCE, - WRONG_CONTAINER - }; - - typedef CosPersistentState::CatalogBase CatalogBase; - typedef CosPersistentState::_TypeId _TypeId; - - typedef short SegmentId; - const SegmentId COMPONENT_SEGMENT = 0; - - typedef short FacetId; - const FacetId COMPONENT_FACET = 0; - - typedef sequence<octet> IdData; - typedef CosPersistentState::Pid PersistentId; - - typedef short StateIdType; - const StateIdType PERSISTENT_ID = 0; - - exception BadComponentReference - { - BadComponentReferenceReason reason; - }; - exception PolicyMismatch {}; - exception PersistenceNotAvailable {}; - exception UnknownActualHome {}; - exception ProxyHomeNotSupported {}; - exception InvalidStateIdData {}; - - local interface HomeRegistration - { - void register_home (in CCMHome home_ref, - in string home_name); - - void unregister_home (in CCMHome home_ref); - }; - - local interface CCM2Context : CCMContext - { - HomeRegistration get_home_registration (); - - void req_passivate () - raises (PolicyMismatch); - - CatalogBase get_persistence (in _TypeId catalog_type_id) - raises (PersistenceNotAvailable); - }; - - local interface ProxyHomeRegistration : HomeRegistration - { - void register_proxy_home (in CCMHome rhome, - in CCMHome ahome) - raises (UnknownActualHome, - ProxyHomeNotSupported); - }; - - local interface Session2Context : SessionContext, CCM2Context - { - Object create_ref (in CORBA::RepositoryId repid); - - Object create_ref_from_oid (in CORBA::OctetSeq oid, - in CORBA::RepositoryId repid); - - CORBA::OctetSeq get_oid_from_ref (in Object objref) - raises (IllegalState, - BadComponentReference); - }; - - abstract valuetype StateIdValue - { - StateIdType get_sid_type(); - IdData get_sid_data(); - }; - - local interface StateIdFactory - { - StateIdValue create (in IdData data) - raises (InvalidStateIdData); - }; - - valuetype PersistentIdValue : StateIdValue - { - private PersistentId pid; - - PersistentId get_pid(); - factory init (in PersistentId pid); - }; - - valuetype SegmentDescr - { - private StateIdValue sid; - private SegmentId seg; - - StateIdValue get_sid(); - SegmentId get_seg_id(); - factory init (in StateIdValue sid, - in SegmentId seg); - }; - - typedef sequence<SegmentDescr> SegmentDescrSeq; - - local interface ComponentId - { - FacetId get_target_facet(); - - SegmentId get_target_segment(); - - StateIdValue get_target_state_id (in StateIdFactory sid_factory) - raises (InvalidStateIdData); - - StateIdValue get_segment_state_id (in SegmentId seg, - in StateIdFactory sid_factory) - raises (InvalidStateIdData); - - ComponentId create_with_new_target (in FacetId new_target_facet, - in SegmentId new_target_segment); - - SegmentDescrSeq get_segment_descrs (in StateIdFactory sid_factory) - raises (InvalidStateIdData); - }; - - local interface Entity2Context : EntityContext, CCM2Context - { - ComponentId get_component_id () - raises (IllegalState); - - ComponentId create_component_id (in FacetId target_facet, - in SegmentId target_segment, - in SegmentDescrSeq seq_descrs); - - ComponentId create_monolithic_component_id (in FacetId target_facet, - in StateIdValue sid); - - Object create_ref_from_cid (in CORBA::RepositoryId repid, - in ComponentId cid); - - ComponentId get_cid_from_ref (in Object objref) - raises (BadComponentReference); - }; - - local interface ExecutorLocator : EnterpriseComponent - { - Object obtain_executor (in string name) - raises (CCMException); - - void release_executor (in Object exc) - raises (CCMException); - - void configuration_complete() - raises (InvalidConfiguration); - }; -}; -#endif /* CCM_CONTAINER_EX_IDL */ diff --git a/TAO/CIAO/ciao/CCM_Core.mpc b/TAO/CIAO/ciao/CCM_Core.mpc deleted file mode 100644 index 78183923d84..00000000000 --- a/TAO/CIAO/ciao/CCM_Core.mpc +++ /dev/null @@ -1,114 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project (CIAO_Client) : taolib_with_idl, valuetype, ifr_client { - sharedname = CIAO_Client - idlflags += -Sc -Wb,stub_export_include=CIAO_Client_Export.h -Wb,stub_export_macro=CIAO_CLIENT_Export -Wb,skel_export_include=CIAO_Container_Export.h -Wb,skel_export_macro=CIAO_CONTAINER_Export - dynamicflags = CIAO_CLIENT_BUILD_DLL - - // This is necessary for MPC to pull in rules.ciao.GNU - includes += $(CIAO_ROOT) - - IDL_Files { - CCM_Base.idl - CCM_Event.idl - CCM_Component.idl - CIAO_Value.idl - } - - Source_Files { - CCM_BaseC.cpp - CCM_EventC.cpp - CCM_ComponentC.cpp - CIAO_ValueC.cpp - Client_init.cpp - } - - Header_Files { - CIAO_Client_Export.h - CIAO_common.h - } - - Template_Files { - } -} - -project (CIAO_Container) : orbsvcslib, portableserver, security, valuetype, ifr_client { - after += CIAO_Client - sharedname = CIAO_Container - libs += CIAO_Client - idlflags += -Sc -Wb,export_include=CIAO_Container_Export.h - idlflags += -Wb,export_macro=CIAO_CONTAINER_Export - dynamicflags = CIAO_CONTAINER_BUILD_DLL - - // This is necessary for MPC to pull in rules.ciao.GNU - includes += $(CIAO_ROOT) - - IDL_Files { - CCM_Transaction.idl - CosPersistentState.idl - CCM_Container.idl - CCM_Container_Ex.idl - } - - Source_Files { - CCM_TransactionC.cpp - CosPersistentStateC.cpp - CCM_ContainerC.cpp - CCM_Container_ExC.cpp - CCM_BaseS.cpp - CCM_EventS.cpp - CCM_ComponentS.cpp - Cookies.cpp - } - - Template_Files { - } -} - -project (CIAO_Server) : orbsvcslib, portableserver, valuetype, ifr_client, security, utils { - after += CIAO_Container - includes += $(CIAO_ROOT) - sharedname = CIAO_Server - libs += CIAO_Client CIAO_Container - idlflags += -Sc -Wb,export_include=CIAO_Server_Export.h -Wb,export_macro=CIAO_SERVER_Export - - dynamicflags = CIAO_SERVER_BUILD_DLL - - IDL_Files { - CCM_Deployment.idl - CIAO_Servers.idl - } - - Source_Files { - CCM_DeploymentC.cpp - CCM_DeploymentS.cpp - CIAO_ServersC.cpp - CIAO_ServersS.cpp - ComponentInstallation_Impl.cpp - ComponentServer_Impl.cpp - Container_Base.cpp - Container_Impl.cpp - Context_Impl_Base.cpp - Home_Servant_Impl_Base.cpp - Servant_Impl_Base.cpp - Servant_Activator.cpp - Port_Activator.cpp - Server_init.cpp - ServerActivator_Impl.cpp - StandardConfigurator_Impl.cpp - } - - Header_Files { - CIAO_Server_Export.h - CIAO_common.h - } - - Template_Files { - Context_Impl_T.cpp - Home_Servant_Impl_T.cpp - Object_Set_T.cpp - Servant_Impl_T.cpp - Servant_Activator_T.cpp - } -} diff --git a/TAO/CIAO/ciao/CCM_Deployment.idl b/TAO/CIAO/ciao/CCM_Deployment.idl deleted file mode 100644 index c2325864898..00000000000 --- a/TAO/CIAO/ciao/CCM_Deployment.idl +++ /dev/null @@ -1,155 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -I ../.. \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Deployment.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_DEPLOYMENT_IDL) -#define CCM_DEPLOYMENT_IDL - -#include "CCM_Component.idl" - -// *************** Packaging and Deployment *************** - -module Components -{ - typeprefix Components "omg.org"; - - module Deployment - { - typedef string UUID; - typedef string Location; - - enum AssemblyState - { - INACTIVE, - INSERVICE - }; - - exception UnknownImplId {}; - exception InvalidLocation {}; - exception InstallationFailure - { - FailureReason reason; - }; - exception InvalidAssembly {}; - - interface ComponentInstallation - { - void install(in UUID implUUID, - in Location component_loc) - raises (InvalidLocation, - InstallationFailure); - - void replace(in UUID implUUID, - in Location component_loc) - raises (InvalidLocation, - InstallationFailure); - - void remove(in UUID implUUID) - raises (UnknownImplId, - RemoveFailure); - - Location get_implementation (in UUID implUUID) - raises (UnknownImplId, - InstallationFailure); - }; - - interface Assembly - { - void build() - raises (CreateFailure); - - void tear_down() - raises (RemoveFailure); - - AssemblyState get_state(); - }; - - interface AssemblyFactory - { - Cookie create_assembly (in Location assembly_loc) - raises (InvalidLocation, - CreateFailure); - - Assembly lookup(in Cookie c) - raises (InvalidAssembly); - - void destroy(in Cookie c) - raises (InvalidAssembly, - RemoveFailure); - }; - - interface ComponentServer; // Forward decl. - typedef sequence<ComponentServer> ComponentServers; - - interface ServerActivator - { - ComponentServer create_component_server (in ConfigValues config) - raises (CreateFailure, - InvalidConfiguration); - - void remove_component_server (in ComponentServer server) - raises (RemoveFailure); - - ComponentServers get_component_servers (); - }; - - interface Container; // Forward decl. - typedef sequence<Container> Containers; - - interface ComponentServer - { - readonly attribute ConfigValues configuration; - - ServerActivator get_server_activator (); - Container create_container (in ConfigValues config) - raises (CreateFailure, - InvalidConfiguration); - - void remove_container (in Container cref) - raises (RemoveFailure); - - Containers get_containers (); - - void remove () - raises (RemoveFailure); - }; - - exception ImplEntryPointNotFound {}; - - interface Container - { - readonly attribute ConfigValues configuration; - - ComponentServer get_component_server (); - - CCMHome install_home (in UUID id, - in string entrypt, - in ConfigValues config) - raises (UnknownImplId, - ImplEntryPointNotFound, - InstallationFailure, - InvalidConfiguration); - - void remove_home (in CCMHome href) - raises (RemoveFailure); - - CCMHomes get_homes (); - void remove () - raises (RemoveFailure); - - }; - - }; -}; -#endif /* CCM_DEPLOYMENT_IDL */ diff --git a/TAO/CIAO/ciao/CCM_Event.idl b/TAO/CIAO/ciao/CCM_Event.idl deleted file mode 100644 index 575220a0283..00000000000 --- a/TAO/CIAO/ciao/CCM_Event.idl +++ /dev/null @@ -1,105 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Event.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_EVENT_IDL) -#define CCM_EVENT_IDL - -#include "CCM_Base.idl" - -module Components -{ - typeprefix Components "omg.org"; - - abstract valuetype EventBase {}; - - interface EventConsumerBase - { - void push_event (in EventBase evt) raises (BadEventType); - - // CIAO-specific operation to help support the capability - // to subscribe to eventtypes more derived than the type - // consumed. - boolean ciao_is_substitutable (in string event_repo_id); - }; - - valuetype ConsumerDescription : PortDescription - { - public EventConsumerBase consumer; - }; - typedef sequence<ConsumerDescription> ConsumerDescriptions; - - valuetype EmitterDescription : PortDescription - { - public EventConsumerBase consumer; - }; - typedef sequence<EmitterDescription> EmitterDescriptions; - - valuetype SubscriberDescription - { - public Cookie ck; - public EventConsumerBase consumer; - }; - typedef sequence<SubscriberDescription> SubscriberDescriptions; - - valuetype PublisherDescription : PortDescription - { - public SubscriberDescriptions consumer; - }; - typedef sequence<PublisherDescription> PublisherDescriptions; - - interface Events - { - EventConsumerBase get_consumer (in FeatureName sink_name) - raises (InvalidName); - - Cookie subscribe (in FeatureName publisher_name, - in EventConsumerBase subscriber) - raises (InvalidName, - AlreadyConnected, - InvalidConnection, - ExceededConnectionLimit); - - EventConsumerBase unsubscribe (in FeatureName publisher_name, - in Cookie ck) - raises (InvalidName, - InvalidConnection); - - void connect_consumer (in FeatureName emitter_name, - in EventConsumerBase consumer) - raises (InvalidName, - AlreadyConnected, - InvalidConnection); - - EventConsumerBase disconnect_consumer (in FeatureName source_name) - raises (InvalidName, - NoConnection); - - ConsumerDescriptions get_all_consumers (); - - ConsumerDescriptions get_named_consumers (in NameList names) - raises (InvalidName); - - EmitterDescriptions get_all_emitters (); - - EmitterDescriptions get_named_emitters (in NameList names) - raises (InvalidName); - - PublisherDescriptions get_all_publishers (); - - PublisherDescriptions get_named_publishers (in NameList names) - raises (InvalidName); - }; -}; -#endif /* CCM_EVENT_IDL */ diff --git a/TAO/CIAO/ciao/CCM_Transaction.idl b/TAO/CIAO/ciao/CCM_Transaction.idl deleted file mode 100644 index c0c8cdc2c1d..00000000000 --- a/TAO/CIAO/ciao/CCM_Transaction.idl +++ /dev/null @@ -1,89 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Transaction.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_TRANSACTION_IDL) -#define CCM_TRANSACTION_IDL - -module Components -{ - typeprefix Components "omg.org"; - - // @@ Components::Transaction is still there. - module Transaction - { - - typedef sequence<octet> TranToken; - - exception NoTransaction {}; - exception NotSupported {}; - exception SystemError {}; - exception RollbackError {}; - exception HeuristicMixed {}; - exception HeuristicRollback {}; - exception Security {}; - exception InvalidToken {}; - - enum Status - { - ACTIVE, - MARKED_ROLLBACK, - PREPARED, - COMMITTED, - ROLLED_BACK, - NO_TRANSACTION, - PREPARING, - COMMITTING, - ROLLING_BACK - }; - - local interface UserTransaction { - void begin () - raises (NotSupported, - SystemError); - - void commit () - raises (RollbackError, - NoTransaction, - HeuristicMixed, - HeuristicRollback, - Security, - SystemError); - - void rollback () - raises (NoTransaction, - Security, - SystemError); - - void set_rollback_only () - raises (NoTransaction, - SystemError); - - Status get_status() - raises (SystemError); - - void set_timeout (in long to) - raises (SystemError); - - TranToken suspend () - raises (NoTransaction, - SystemError); - - void resume (in TranToken txtoken) - raises (InvalidToken, - SystemError); - }; - }; -}; -#endif /* CCM_TRANSACTION_IDL */ diff --git a/TAO/CIAO/ciao/CIAO_Client_Export.h b/TAO/CIAO/ciao/CIAO_Client_Export.h deleted file mode 100644 index 9da1de18261..00000000000 --- a/TAO/CIAO/ciao/CIAO_Client_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s CIAO_CLIENT -// ------------------------------ -#ifndef CIAO_CLIENT_EXPORT_H -#define CIAO_CLIENT_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_CLIENT_HAS_DLL) -# define CIAO_CLIENT_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_CLIENT_HAS_DLL */ - -#if !defined (CIAO_CLIENT_HAS_DLL) -# define CIAO_CLIENT_HAS_DLL 1 -#endif /* ! CIAO_CLIENT_HAS_DLL */ - -#if defined (CIAO_CLIENT_HAS_DLL) && (CIAO_CLIENT_HAS_DLL == 1) -# if defined (CIAO_CLIENT_BUILD_DLL) -# define CIAO_CLIENT_Export ACE_Proper_Export_Flag -# define CIAO_CLIENT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_CLIENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_CLIENT_BUILD_DLL */ -# define CIAO_CLIENT_Export ACE_Proper_Import_Flag -# define CIAO_CLIENT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_CLIENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_CLIENT_BUILD_DLL */ -#else /* CIAO_CLIENT_HAS_DLL == 1 */ -# define CIAO_CLIENT_Export -# define CIAO_CLIENT_SINGLETON_DECLARATION(T) -# define CIAO_CLIENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_CLIENT_HAS_DLL == 1 */ - -// Set CIAO_CLIENT_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_CLIENT_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_CLIENT_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_CLIENT_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_CLIENT_NTRACE */ - -#if (CIAO_CLIENT_NTRACE == 1) -# define CIAO_CLIENT_TRACE(X) -#else /* (CIAO_CLIENT_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_CLIENT_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_CLIENT_NTRACE == 1) */ - -#endif /* CIAO_CLIENT_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/ciao/CIAO_Config.h b/TAO/CIAO/ciao/CIAO_Config.h new file mode 100644 index 00000000000..42b04622520 --- /dev/null +++ b/TAO/CIAO/ciao/CIAO_Config.h @@ -0,0 +1,20 @@ +// -*- C++ -*- +//============================================================================= +/** + * @file CIAO_Config.h + * + * $Id$ + * + * CIAO compile time configuration file. + * + * @author Bala Natarajan <bala @ dre.vanderbilt.edu> + */ +//============================================================================= +#ifndef CIAO_CONFIG_H +#define CIAO_CONFIG_H + +#if !defined (CIAO_DEFAULT_MAP_SIZE) +# define CIAO_DEFAULT_MAP_SIZE 64 +#endif /* CIAO_DEFAULT_MAP_SIZE */ + +#endif /*CIAO_CONFIG_H*/ diff --git a/TAO/CIAO/ciao/CIAO_Container_Export.h b/TAO/CIAO/ciao/CIAO_Container_Export.h deleted file mode 100644 index ee5e3507162..00000000000 --- a/TAO/CIAO/ciao/CIAO_Container_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s CIAO_CONTAINER -// ------------------------------ -#ifndef CIAO_CONTAINER_EXPORT_H -#define CIAO_CONTAINER_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_CONTAINER_HAS_DLL) -# define CIAO_CONTAINER_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_CONTAINER_HAS_DLL */ - -#if !defined (CIAO_CONTAINER_HAS_DLL) -# define CIAO_CONTAINER_HAS_DLL 1 -#endif /* ! CIAO_CONTAINER_HAS_DLL */ - -#if defined (CIAO_CONTAINER_HAS_DLL) && (CIAO_CONTAINER_HAS_DLL == 1) -# if defined (CIAO_CONTAINER_BUILD_DLL) -# define CIAO_CONTAINER_Export ACE_Proper_Export_Flag -# define CIAO_CONTAINER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_CONTAINER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_CONTAINER_BUILD_DLL */ -# define CIAO_CONTAINER_Export ACE_Proper_Import_Flag -# define CIAO_CONTAINER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_CONTAINER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_CONTAINER_BUILD_DLL */ -#else /* CIAO_CONTAINER_HAS_DLL == 1 */ -# define CIAO_CONTAINER_Export -# define CIAO_CONTAINER_SINGLETON_DECLARATION(T) -# define CIAO_CONTAINER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_CONTAINER_HAS_DLL == 1 */ - -// Set CIAO_CONTAINER_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_CONTAINER_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_CONTAINER_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_CONTAINER_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_CONTAINER_NTRACE */ - -#if (CIAO_CONTAINER_NTRACE == 1) -# define CIAO_CONTAINER_TRACE(X) -#else /* (CIAO_CONTAINER_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_CONTAINER_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_CONTAINER_NTRACE == 1) */ - -#endif /* CIAO_CONTAINER_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/ciao/CIAO_Export.h b/TAO/CIAO/ciao/CIAO_Export.h deleted file mode 100644 index 4c2a38ca5f6..00000000000 --- a/TAO/CIAO/ciao/CIAO_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s CIAO -// ------------------------------ -#ifndef CIAO_EXPORT_H -#define CIAO_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_HAS_DLL) -# define CIAO_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_HAS_DLL */ - -#if !defined (CIAO_HAS_DLL) -# define CIAO_HAS_DLL 1 -#endif /* ! CIAO_HAS_DLL */ - -#if defined (CIAO_HAS_DLL) && (CIAO_HAS_DLL == 1) -# if defined (CIAO_BUILD_DLL) -# define CIAO_Export ACE_Proper_Export_Flag -# define CIAO_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_BUILD_DLL */ -# define CIAO_Export ACE_Proper_Import_Flag -# define CIAO_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_BUILD_DLL */ -#else /* CIAO_HAS_DLL == 1 */ -# define CIAO_Export -# define CIAO_SINGLETON_DECLARATION(T) -# define CIAO_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_HAS_DLL == 1 */ - -// Set CIAO_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_NTRACE */ - -#if (CIAO_NTRACE == 1) -# define CIAO_TRACE(X) -#else /* (CIAO_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_NTRACE == 1) */ - -#endif /* CIAO_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/ciao/CIAO_Server_Export.h b/TAO/CIAO/ciao/CIAO_Server_Export.h deleted file mode 100644 index 03096a0ed8e..00000000000 --- a/TAO/CIAO/ciao/CIAO_Server_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s CIAO_SERVER -// ------------------------------ -#ifndef CIAO_SERVER_EXPORT_H -#define CIAO_SERVER_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_SERVER_HAS_DLL) -# define CIAO_SERVER_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_SERVER_HAS_DLL */ - -#if !defined (CIAO_SERVER_HAS_DLL) -# define CIAO_SERVER_HAS_DLL 1 -#endif /* ! CIAO_SERVER_HAS_DLL */ - -#if defined (CIAO_SERVER_HAS_DLL) && (CIAO_SERVER_HAS_DLL == 1) -# if defined (CIAO_SERVER_BUILD_DLL) -# define CIAO_SERVER_Export ACE_Proper_Export_Flag -# define CIAO_SERVER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_SERVER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_SERVER_BUILD_DLL */ -# define CIAO_SERVER_Export ACE_Proper_Import_Flag -# define CIAO_SERVER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_SERVER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_SERVER_BUILD_DLL */ -#else /* CIAO_SERVER_HAS_DLL == 1 */ -# define CIAO_SERVER_Export -# define CIAO_SERVER_SINGLETON_DECLARATION(T) -# define CIAO_SERVER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_SERVER_HAS_DLL == 1 */ - -// Set CIAO_SERVER_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_SERVER_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_SERVER_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_SERVER_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_SERVER_NTRACE */ - -#if (CIAO_SERVER_NTRACE == 1) -# define CIAO_SERVER_TRACE(X) -#else /* (CIAO_SERVER_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_SERVER_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_SERVER_NTRACE == 1) */ - -#endif /* CIAO_SERVER_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/ciao/CIAO_Servers.idl b/TAO/CIAO/ciao/CIAO_Servers.idl deleted file mode 100644 index 8f5b7fcf3ee..00000000000 --- a/TAO/CIAO/ciao/CIAO_Servers.idl +++ /dev/null @@ -1,20 +0,0 @@ -// $Id$ - -/** - * @file CIAO_Servers.idl - * - * @brief Some CIAO helper interfaces for implementing various server - * tools. - */ - -#include "CCM_Deployment.idl" - -module CIAO -{ - interface Activator_Callback - { - Components::Deployment::ServerActivator - register_component_server (in Components::Deployment::ComponentServer svr, - out Components::ConfigValues config); - }; -}; diff --git a/TAO/CIAO/ciao/CIAO_Value.idl b/TAO/CIAO/ciao/CIAO_Value.idl deleted file mode 100644 index 52efed12f75..00000000000 --- a/TAO/CIAO/ciao/CIAO_Value.idl +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ - -/** - * @file CIAO_Value.idl - * - * @brief Some CIAO valuetype extension for internal use. - */ - -#include "CCM_Base.idl" - -/** - * @ Note: This needs deprecation. - * - */ -module CIAO -{ - valuetype Cookie : Components::Cookie - { - CORBA::OctetSeq get_cookie (); - }; -}; diff --git a/TAO/CIAO/ciao/CIAO_common.h b/TAO/CIAO/ciao/CIAO_common.h deleted file mode 100644 index e933c75fe32..00000000000 --- a/TAO/CIAO/ciao/CIAO_common.h +++ /dev/null @@ -1,53 +0,0 @@ -// $Id$ - -/** - * @file CIAO_common.h - * - * This file collects common CIAO macro definitions. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef CIAO_COMMON_H -#define CIAO_COMMON_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined ACE_LACKS_PRAGMA_ONCE -#pragma once -#endif /* ! ACE_LACKS_PRAGMA_ONCE */ - -#include "CIAO_Client_Export.h" - -#define CIAO_REGISTER_VALUE_FACTORY(ORB,FACTORY,VALUETYPE) {\ - CORBA::ValueFactory factory = new FACTORY; \ - CORBA::ValueFactory prev_factory = \ - ORB->register_value_factory \ - (VALUETYPE::_tao_obv_static_repository_id (), \ - factory); \ - if (prev_factory) prev_factory->_remove_ref (); \ - factory->_remove_ref (); } - -namespace CIAO -{ - /** - * Return the debug level. The debug level of CIAO is control by - * an environment variable "CIAO_DEBUG_LEVEL". It should be an int - * value. If it is not defined, the default debug level is 0. The - * value of debug value is evaluated on its first use and the value - * is then cached. The actual implementation of this function is in - * Client_init.cpp. - * - * Some recommendation for using the debug_level - * - * > 0 : For component users. Component developers are encouraged - * to develop their own - * > 10 : For CIAO tools - * > 20 : For CIAO core. - */ - CIAO_CLIENT_Export int debug_level (void); -} - -#include /**/ "ace/post.h" -#endif /* CIAO_COMMON_H */ diff --git a/TAO/CIAO/ciao/Client_init.cpp b/TAO/CIAO/ciao/Client_init.cpp deleted file mode 100644 index 93d83982ee8..00000000000 --- a/TAO/CIAO/ciao/Client_init.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// $Id$ - -#include "Client_init.h" -#include "CIAO_common.h" -#include "CCM_ComponentC.h" -#include "CIAO_ValueC.h" -#include "ace/Env_Value_T.h" - -int -CIAO::Client_init (CORBA::ORB_ptr o) -{ - CIAO_REGISTER_VALUE_FACTORY (o, Components::Cookie_init, - Components::Cookie); - CIAO_REGISTER_VALUE_FACTORY (o, Components::Cookie_init, - CIAO::Cookie); - CIAO_REGISTER_VALUE_FACTORY (o, Components::PortDescription_init, - Components::PortDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::FacetDescription_init, - Components::FacetDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ConnectionDescription_init, - Components::ConnectionDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ReceptacleDescription_init, - Components::ReceptacleDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ConsumerDescription_init, - Components::ConsumerDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::EmitterDescription_init, - Components::EmitterDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::SubscriberDescription_init, - Components::SubscriberDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::PublisherDescription_init, - Components::PublisherDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ConfigValue_init, - Components::ConfigValue); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ComponentPortDescription_init, - Components::ComponentPortDescription); - return 0; -} - -/// This should really be an anonymous namespace, but some compilers -/// still don't support this features. Therefore, just use a long -/// namespace name here. -namespace ciao_anonymous_namespace -{ - int debug_level = -1; -} - -int -CIAO::debug_level (void) -{ - if (ciao_anonymous_namespace::debug_level == -1) - { - // Initialize the thing. - ACE_Env_Value<int> envar ("CIAO_DEBUG_LEVEL", 0); - ciao_anonymous_namespace::debug_level = envar; - } - - return ciao_anonymous_namespace::debug_level; -} diff --git a/TAO/CIAO/ciao/Client_init.h b/TAO/CIAO/ciao/Client_init.h deleted file mode 100644 index 065c1f2a280..00000000000 --- a/TAO/CIAO/ciao/Client_init.h +++ /dev/null @@ -1,40 +0,0 @@ -// $Id$ - -/** - * @file Client_init.h - * - * Initializing CIAO client side ORB, if they need to. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef CIAO_CLIENT_INIT_H -#define CIAO_CLIENT_INIT_H -#include /**/ "ace/pre.h" - -#include "CIAO_Client_Export.h" - -#if !defined ACE_LACKS_PRAGMA_ONCE -#pragma once -#endif /* ! ACE_LACKS_PRAGMA_ONCE */ - -namespace CORBA -{ - class ORB; - typedef ORB *ORB_ptr; -} - -namespace CIAO -{ - /** - * The initialize routine for any clients that need to access - * component. This routine now simply registers various valuetype - * factories defined in CIAO_Component.pidl. Currently, this method - * should be call right after ORB initialization but we should try - * to register these stuff automatically. - */ - CIAO_CLIENT_Export int Client_init (CORBA::ORB_ptr o); -} - -#include /**/ "ace/post.h" -#endif /* CIAO_CLIENT_INIT_H */ diff --git a/TAO/CIAO/ciao/ComponentInstallation_Impl.cpp b/TAO/CIAO/ciao/ComponentInstallation_Impl.cpp deleted file mode 100644 index dd43aef60fe..00000000000 --- a/TAO/CIAO/ciao/ComponentInstallation_Impl.cpp +++ /dev/null @@ -1,194 +0,0 @@ -// $Id$ - -#include "ComponentInstallation_Impl.h" -#include "ace/Configuration_Import_Export.h" - -#if !defined (__ACE_INLINE__) -# include "ComponentInstallation_Impl.inl" -#endif /* __ACE_INLINE__ */ - -CIAO::ComponentInstallation_Impl::~ComponentInstallation_Impl () -{ - this->fini (); -} - -PortableServer::POA_ptr -CIAO::ComponentInstallation_Impl::_default_POA (void) -{ - return PortableServer::POA::_duplicate (this->poa_.in ()); -} - -int -CIAO::ComponentInstallation_Impl::init (const char *fname, - const char *section - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (fname == 0) - ACE_THROW_RETURN (CORBA::INTERNAL (), -1); - else - this->filename_ = CORBA::string_dup (fname); - - if (section == 0) - section = "ComponentInstallation"; - this->section_name_ = CORBA::string_dup (section); - - ACE_Configuration_Heap *tmp = 0; - ACE_NEW_THROW_EX (tmp, - ACE_Configuration_Heap (), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (-1); - - auto_ptr<ACE_Configuration_Heap> config (tmp); - - if (config->open () != 0) - { - ACE_DEBUG ((LM_ERROR, "Unable to initilize installation datafile\n")); - ACE_THROW_RETURN (CORBA::INTERNAL (), -1); - } - - ACE_Ini_ImpExp import (*config); - - if (import.import_config (fname) != 0) - { - ACE_DEBUG ((LM_ERROR, "Unable to import from installation datafile: %s\n", fname)); - ACE_THROW_RETURN (CORBA::INTERNAL (), -1); - } - this->installation_ = config.release (); - - return 0; -} - -int -CIAO::ComponentInstallation_Impl::fini () -{ - if (this->installation_ != 0) - { - // @ back up the installation and destroy the - ACE_Ini_ImpExp exp (*this->installation_); - - if (exp.export_config (this->filename_.in ()) != 0) - ACE_DEBUG ((LM_DEBUG, - "CIAO::ComponentInstallation Failed to store the installation information to file: %s\n", - this->filename_.in ())); - delete this->installation_; - this->installation_ = 0; - } - return 0; -} - -void -CIAO::ComponentInstallation_Impl::install (const char * implUUID, - const char * component_loc - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::InvalidLocation, - Components::Deployment::InstallationFailure)) -{ - // Only use the root section for now. - const ACE_Configuration_Section_Key &root_section - = this->installation_->root_section (); - ACE_Configuration::VALUETYPE type; - - ACE_Configuration_Section_Key section; - this->installation_->open_section (root_section, - this->section_name_.in (), - 1, - section); - - // Check if implUUID has already been installed. - if (this->installation_->find_value (section, - implUUID, - type) == 0) - ACE_THROW (Components::Deployment::InstallationFailure ()); - - // @@ We may need to do some extra work to provide a more - // comprehensive component installation facility. - - ACE_TString value (component_loc, 0, 0); - if (this->installation_->set_string_value (section, - implUUID, - value) != 0) - ACE_THROW (Components::Deployment::InstallationFailure ()); -} - -void -CIAO::ComponentInstallation_Impl::replace (const char * implUUID, - const char * component_loc - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::InvalidLocation, - Components::Deployment::InstallationFailure)) -{ - // Only use the root section for now. - const ACE_Configuration_Section_Key &root_section - = this->installation_->root_section (); - - ACE_Configuration_Section_Key section; - this->installation_->open_section (root_section, - this->section_name_.in (), - 1, - section); - - // @@ We may need to do some extra work to provide a more - // comprehensive component installation facility. - - ACE_TString value (component_loc, 0, 0); - if (this->installation_->set_string_value (section, - implUUID, - value) != 0) - ACE_THROW (Components::Deployment::InstallationFailure ()); -} - -void -CIAO::ComponentInstallation_Impl::remove (const char * implUUID - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::RemoveFailure)) -{ - if (implUUID == 0) - ACE_THROW (Components::Deployment::UnknownImplId ()); - - // Only use the root section for now. - const ACE_Configuration_Section_Key &root_section - = this->installation_->root_section (); - - ACE_Configuration_Section_Key section; - this->installation_->open_section (root_section, - this->section_name_.in (), - 1, - section); - - if (this->installation_->remove_value (section, - implUUID) != 0) - // This should very well be UnknownImplId instead. - ACE_THROW (Components::RemoveFailure ()); -} - -char * -CIAO::ComponentInstallation_Impl::get_implementation (const char * implUUID - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::Deployment::InstallationFailure)) -{ - const ACE_Configuration_Section_Key &root_section - = this->installation_->root_section (); - ACE_TString retstr; - - ACE_Configuration_Section_Key section; - this->installation_->open_section (root_section, - this->section_name_.in (), - 1, - section); - - // Check if implUUID has already been installed. - if (this->installation_->get_string_value (section, - implUUID, - retstr) != 0) - ACE_THROW_RETURN (Components::Deployment::UnknownImplId (), - 0); - - return CORBA::string_dup (retstr.fast_rep ()); -} diff --git a/TAO/CIAO/ciao/ComponentInstallation_Impl.h b/TAO/CIAO/ciao/ComponentInstallation_Impl.h deleted file mode 100644 index b2c70d8fefd..00000000000 --- a/TAO/CIAO/ciao/ComponentInstallation_Impl.h +++ /dev/null @@ -1,116 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ComponentInstallation_Impl.h - * - * $Id$ - * - * This file contains implementation for the servant of - * Components::Deployment::ComponentInstallation interface. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ -//============================================================================= - - -#ifndef CIAO_COMPONENTINSTALLATION_IMPL_H -#define CIAO_COMPONENTINSTALLATION_IMPL_H -#include /**/ "ace/pre.h" - -#include "CCM_DeploymentS.h" -#include "ace/Configuration.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - - -namespace CIAO -{ - /** - * @class ComponentInstallation_Impl - * - * @brief Servant implementation for Components::Deployment::ComponentInstallation - * - * This class implements the Components::Deployment::ComponentInstallation - * interface as defined by the CCM spcification. As the interface - * implies, this is actually part of the deployment interface and is - * used to manage the lifecycle of containers running on the server. - */ - class CIAO_SERVER_Export ComponentInstallation_Impl - : public virtual POA_Components::Deployment::ComponentInstallation - { - public: - /// Constructor - ComponentInstallation_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p); - - /// Destructor - virtual ~ComponentInstallation_Impl (void); - - /// Get the containing POA. This operation does *not* - /// increase the reference count of the POA. - virtual PortableServer::POA_ptr _default_POA (void); - - /// Initialize the ComponentInstallation. - int init (const char *fname, - const char *section - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Initialize the ComponentInstallation. - int fini (); - - /// Components::Deployment::ComponentInstallation defined attributes/operations. - - virtual void install (const char * implUUID, - const char * component_loc - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::InvalidLocation, - Components::Deployment::InstallationFailure)); - - virtual void replace (const char * implUUID, - const char * component_loc - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::InvalidLocation, - Components::Deployment::InstallationFailure)); - - virtual void remove (const char * implUUID - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::RemoveFailure)); - - virtual char * get_implementation (const char * implUUID - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::Deployment::InstallationFailure)); - - protected: - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; - - /// Keep a pointer to the managing POA. - PortableServer::POA_var poa_; - - /// Persistent store filename for storing the configuration info. - CORBA::String_var filename_; - - /// Section name in Configuration - CORBA::String_var section_name_; - - /// Mapping and persistent - ACE_Configuration *installation_; - }; -} - -#if defined (__ACE_INLINE__) -# include "ComponentInstallation_Impl.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_COMPONENTINSTALLATION_IMPL_H */ diff --git a/TAO/CIAO/ciao/ComponentInstallation_Impl.inl b/TAO/CIAO/ciao/ComponentInstallation_Impl.inl deleted file mode 100644 index 856817bf70c..00000000000 --- a/TAO/CIAO/ciao/ComponentInstallation_Impl.inl +++ /dev/null @@ -1,11 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -CIAO::ComponentInstallation_Impl::ComponentInstallation_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p) - : orb_ (CORBA::ORB::_duplicate (o)), - poa_ (PortableServer::POA::_duplicate (p)), - installation_ (0) -{ -} diff --git a/TAO/CIAO/ciao/ComponentServer_Impl.cpp b/TAO/CIAO/ciao/ComponentServer_Impl.cpp deleted file mode 100644 index 63cf731ef2c..00000000000 --- a/TAO/CIAO/ciao/ComponentServer_Impl.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// $Id$ - -#include "ComponentServer_Impl.h" -#include "Container_Impl.h" - -#if !defined (__ACE_INLINE__) -# include "ComponentServer_Impl.inl" -#endif /* __ACE_INLINE__ */ - -CIAO::ComponentServer_Impl::~ComponentServer_Impl () -{ - // @@ remove all Containers? -} - -PortableServer::POA_ptr -CIAO::ComponentServer_Impl::_default_POA (void) -{ - return PortableServer::POA::_duplicate (this->poa_.in ()); -} - -int -CIAO::ComponentServer_Impl::init (::Components::ConfigValues &options - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // @@ Initialize ComponentServer and create the internal container - // implementation that actually interacts with installed - // homes/components. - - ACE_NEW_THROW_EX (this->config_, - ::Components::ConfigValues (), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (-1); - - *this->config_ = options; - - // We will probably need two ORBs in this process. One for the - // deployment framework, and one for the actual components. - return 0; -} - -::Components::ConfigValues * -CIAO::ComponentServer_Impl::configuration (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - Components::ConfigValues *retval; - - ACE_NEW_THROW_EX (retval, - Components::ConfigValues (), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (0); - - *retval = this->config_.inout (); - - return retval; -} - -::Components::Deployment::ServerActivator_ptr -CIAO::ComponentServer_Impl::get_server_activator (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return Components::Deployment::ServerActivator::_duplicate (this->activator_.in ()); -} - -::Components::Deployment::Container_ptr -CIAO::ComponentServer_Impl::create_container (const Components::ConfigValues & config - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CreateFailure, - Components::InvalidConfiguration)) -{ - CIAO::Container_Impl *container_servant = 0; - - ACE_NEW_THROW_EX (container_servant, - CIAO::Container_Impl (this->orb_.in (), - this->poa_.in (), - this->get_objref (), - this->static_config_flag_, - this->static_entrypts_maps_ - ), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (0); - - PortableServer::ServantBase_var safe_servant (container_servant); - container_servant->init (config, - this->get_component_installation () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - PortableServer::ObjectId_var oid - = this->poa_->activate_object (container_servant - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Object_var obj - = this->poa_->id_to_reference (oid.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - Components::Deployment::Container_var ci - = Components::Deployment::Container::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // Cached the objref in its servant. - container_servant->set_objref (ci.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - - this->container_set_.add (ci.in ()); - } - - return ci._retn (); -} - -void -CIAO::ComponentServer_Impl::remove_container (Components::Deployment::Container_ptr cref - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) -{ - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); - - if (this->container_set_.object_in_set (cref) == 0) - ACE_THROW (Components::RemoveFailure()); - - cref->remove (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // @@ Deactivate object. - PortableServer::ObjectId_var oid - = this->poa_->reference_to_id (cref - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->poa_->deactivate_object (oid.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Should we remove the server still, even if the previous call failed. - - if (this->container_set_.remove (cref) == -1) - ACE_THROW (::Components::RemoveFailure ()); -} - -Components::Deployment::Containers * -CIAO::ComponentServer_Impl::get_containers (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - - Components::Deployment::Containers_var retval; - - ACE_NEW_THROW_EX (retval.out (), - Components::Deployment::Containers (), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (0); - - CORBA::ULong len = this->container_set_.size (); - retval->length (len); // resize - -#if 0 - // TAO is broken here. Both <replace>, <get_buffer> and friends are missing. - this->container_set_.copy (len, retval->get_buffer (0)); -#else - for (CORBA::ULong i = 0; i < len; ++i) - { - retval[i] = this->container_set_.at (i); - } -#endif - - return retval._retn (); -} - -void -CIAO::ComponentServer_Impl::remove (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) -{ - // @@ Need to remove all containers/homes/components. - - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/CIAO/ciao/ComponentServer_Impl.h b/TAO/CIAO/ciao/ComponentServer_Impl.h deleted file mode 100644 index ffcf991a55a..00000000000 --- a/TAO/CIAO/ciao/ComponentServer_Impl.h +++ /dev/null @@ -1,152 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ComponentServer_Impl.h - * - * $Id$ - * - * This file contains implementation for the servant of - * Components::Deployment::ComponentServer interface. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ -//============================================================================= - - -#ifndef CIAO_COMPONENTSERVER_IMPL_H -#define CIAO_COMPONENTSERVER_IMPL_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CCM_DeploymentS.h" -#include "Object_Set_T.h" - -namespace CIAO -{ - struct Static_Config_EntryPoints_Maps; - /** - * @class ComponentServer_Impl - * - * @brief Servant implementation for Components::Deployment::ComponentServer - * - * This class implements the Components::Deployment::ComponentServer - * interface as defined by the CCM spcification. As the interface - * implies, this is actually part of the deployment interface and is - * used to manage the lifecycle of containers running on the server. - */ - class CIAO_SERVER_Export ComponentServer_Impl - : public virtual POA_Components::Deployment::ComponentServer - { - public: - /// Constructor - ComponentServer_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - int static_config_flag = 0, - const Static_Config_EntryPoints_Maps* static_entrypts_maps = 0 - ); - - /// Destructor - virtual ~ComponentServer_Impl (void); - - /// Get the containing POA. This operation does *not* - /// increase the reference count of the POA. - virtual PortableServer::POA_ptr _default_POA (void); - - /// Initialize the ComponentServer with a name. - int init (::Components::ConfigValues &options - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Components::Deployment::ComponentServer defined attributes/operations. - - virtual ::Components::ConfigValues * - configuration (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::Deployment::ServerActivator_ptr - get_server_activator (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::Deployment::Container_ptr - create_container (const Components::ConfigValues & config - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CreateFailure, - Components::InvalidConfiguration)); - - virtual void remove_container (Components::Deployment::Container_ptr cref - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)); - - virtual ::Components::Deployment::Containers * - get_containers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)); - - // ------------ CIAO Internal operations ------------- - /// Set the cached object reference - void set_objref (Components::Deployment::ServerActivator_ptr act, - const Components::ConfigValues &config, - Components::Deployment::ComponentServer_ptr cs = 0 - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the cached object reference of this ComponentServer object. - /// This operation does *NOT* increase the reference count. - Components::Deployment::ComponentServer_ptr - get_objref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - - /// Get the cached ComponentInstallation object reference. - /// This operation does *NOT* increase the reference count. - Components::Deployment::ComponentInstallation_ptr - get_component_installation (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - -protected: - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; - - /// Keep a pointer to the managing POA. - PortableServer::POA_var poa_; - - /// Cached ConfigValues. - Components::ConfigValues_var config_; - - /// And a reference to the ServerActivator that created us. - Components::Deployment::ServerActivator_var activator_; - - /// Cache the object reference to ourselves. - Components::Deployment::ComponentServer_var objref_; - - /// And a reference to the ServerActivator that created us. - Components::Deployment::ComponentInstallation_var installation_; - - /// Synchronize access to the object set. - TAO_SYNCH_MUTEX lock_; - - /// Keep a list of managed Container objects. - Object_Set<Components::Deployment::Container, ::Components::Deployment::Container_var> container_set_; - - /// Flag to indicate static configuration. - int static_config_flag_; - - /// Reference to CIAO static config entry points map. - const Static_Config_EntryPoints_Maps* static_entrypts_maps_; - }; -} - -#if defined (__ACE_INLINE__) -# include "ComponentServer_Impl.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_COMPONENTSERVER_IMPL_H */ diff --git a/TAO/CIAO/ciao/ComponentServer_Impl.inl b/TAO/CIAO/ciao/ComponentServer_Impl.inl deleted file mode 100644 index 275516e8db1..00000000000 --- a/TAO/CIAO/ciao/ComponentServer_Impl.inl +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -CIAO::ComponentServer_Impl::ComponentServer_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - int static_config_flag, - const Static_Config_EntryPoints_Maps* static_entrypts_maps) - : orb_ (CORBA::ORB::_duplicate (o)), - poa_ (PortableServer::POA::_duplicate (p)), - static_config_flag_ (static_config_flag), - static_entrypts_maps_ (static_entrypts_maps) -{ -} - -ACE_INLINE void -CIAO::ComponentServer_Impl::set_objref (Components::Deployment::ServerActivator_ptr act, - const Components::ConfigValues &config, - Components::Deployment::ComponentServer_ptr cs - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (!CORBA::is_nil (this->activator_.in ()) || !CORBA::is_nil (this->objref_.in ())) - ACE_THROW (CORBA::BAD_INV_ORDER ()); - - this->config_ = new Components::ConfigValues (config); - this->activator_ = Components::Deployment::ServerActivator::_duplicate (act); - this->objref_ = Components::Deployment::ComponentServer::_duplicate (cs); -} - -ACE_INLINE Components::Deployment::ComponentServer_ptr -CIAO::ComponentServer_Impl::get_objref (ACE_ENV_SINGLE_ARG_DECL) -{ - if (CORBA::is_nil (this->objref_.in ())) - { - this->objref_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - - return this->objref_.in (); -} - -ACE_INLINE Components::Deployment::ComponentInstallation_ptr -CIAO::ComponentServer_Impl::get_component_installation (ACE_ENV_SINGLE_ARG_DECL) -{ - if (CORBA::is_nil (this->installation_.in ())) - { - if (this->static_config_flag_ == 1) - return 0; - - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - - CORBA::Object_var tmp = this->orb_->resolve_initial_references ("ComponentInstallation" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - this->installation_ = - Components::Deployment::ComponentInstallation::_narrow (tmp.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (CORBA::is_nil (this->installation_.in ())) - ACE_THROW_RETURN (CORBA::INTERNAL (), 0); - } - - return this->installation_.in (); -} diff --git a/TAO/CIAO/ciao/Component_Base.idl b/TAO/CIAO/ciao/Component_Base.idl deleted file mode 100644 index df173894f03..00000000000 --- a/TAO/CIAO/ciao/Component_Base.idl +++ /dev/null @@ -1,788 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I W:/ACE_wrappers/TAO -I W:/ACE_wrappers/TAO/orbsvcs/orbsvcs Component_Base.idl - * - * This file has been split into - * CIAO_Base.pidl - * CIAO_Event.pidl - * CIAO_Component.pidl - * CIAO_Transaction.pidl - * CIAO_Container.pidl - * CIAO_Container_Ex.pidl - * CIAO_Deployment.pidl - */ - -// import ::CORBA -// import ::SecurityLevel2 -// import ::CosPersistentState -// import ::PortableServer -// import ::CosNotification -// import ::CosNotifyChannelAdmin - -#include <orb.idl> -#include <SecurityLevel2.idl> -#include <CosPersistentState.idl> -// #include <CosNotification.idl> -// #include <CosNotifyChannelAdmin.idl> - -/** - * Temporarily fix for lacking of typePrefix keyword. - * Search for the word "typePrefix" when tao_idl starts - * supporting the keyword. - */ -#pragma prefix "omg.org" - -module Components { - - /** - * @@ Commented out temporarily for lack of typePrefix support. - */ - // typePrefix Components "omg.org" - typedef string FeatureName; - typedef sequence<FeatureName> NameList; - - valuetype Cookie - { - private CORBA::OctetSeq cookieValue; - }; - - valuetype PortDescription - { - public FeatureName Name; - public CORBA::RepositoryId type_id; - }; - - valuetype FacetDescription : PortDescription - { - public Object facet_ref; - }; - - typedef sequence<FacetDescription> FacetDescriptions; - - typedef unsigned long FailureReason; - - exception InvalidName {}; - exception InvalidConnection {}; - exception ExceededConnectionLimit {}; - exception AlreadyConnected {}; - exception NoConnection {}; - exception CookieRequired {}; - exception CreateFailure { - FailureReason reason; - }; - exception FinderFailure - { - FailureReason reason; - }; - exception RemoveFailure - { - FailureReason reason; - }; - exception DuplicateKeyValue {}; - exception InvalidKey {}; - exception UnknownKeyValue {}; - exception NoKeyAvailable {}; - exception BadEventType - { - CORBA::RepositoryId expected_event_type; - }; - exception HomeNotFound {}; - exception WrongComponentType {}; - - typedef FailureReason InvalidConfigurationReason; - const InvalidConfigurationReason UnknownConfigValueName = 0; - const InvalidConfigurationReason InvalidConfigValueType = 1; - const InvalidConfigurationReason ConfigValueRequired = 2; - const InvalidConfigurationReason ConfigValueNotExpected = 3; - exception InvalidConfiguration - { - InvalidConfigurationReason reason; - FeatureName name; - }; - exception IllegalState {}; - - interface Navigation - { - Object provide_facet (in FeatureName name) - raises (InvalidName); - FacetDescriptions get_all_facets(); - FacetDescriptions get_named_facets (in NameList names) - raises (InvalidName); - boolean same_component (in Object object_ref); - }; - - valuetype ConnectionDescription - { - public Cookie ck; - public Object objref; - }; - typedef sequence<ConnectionDescription> ConnectionDescriptions; - - valuetype ReceptacleDescription : PortDescription - { - public boolean is_multiple; - public ConnectionDescriptions connections; - }; - typedef sequence<ReceptacleDescription> ReceptacleDescriptions; - - interface Receptacles - { - Cookie connect (in FeatureName name, in Object connection ) - raises (InvalidName, - InvalidConnection, - AlreadyConnected, - ExceededConnectionLimit); - - // @@ Changed to return the previously connected object reference -- basef on RTF 1.1. - Object disconnect (in FeatureName name, in Cookie ck) - raises (InvalidName, - InvalidConnection, - CookieRequired, - NoConnection); - - ConnectionDescriptions get_connections (in FeatureName name) - raises (InvalidName); - - ReceptacleDescriptions get_all_receptacles (); - - ReceptacleDescriptions get_named_receptacles (in NameList names) - raises (InvalidName); - }; - - abstract valuetype EventBase {}; - - interface EventConsumerBase - { - void push_event (in EventBase evt) raises (BadEventType); - }; - - valuetype ConsumerDescription : PortDescription - { - public EventConsumerBase consumer; - }; - typedef sequence<ConsumerDescription> ConsumerDescriptions; - - valuetype EmitterDescription : PortDescription - { - public EventConsumerBase consumer; - }; - typedef sequence<EmitterDescription> EmitterDescriptions; - - valuetype SubscriberDescription - { - public Cookie ck; - public EventConsumerBase consumer; - }; - typedef sequence<SubscriberDescription> SubscriberDescriptions; - - valuetype PublisherDescription : PortDescription - { - public SubscriberDescriptions consumer; - }; - typedef sequence<PublisherDescription> PublisherDescriptions; - - interface Events - { - EventConsumerBase get_consumer (in FeatureName sink_name) - raises (InvalidName); - - Cookie subscribe (in FeatureName publisher_name, - in EventConsumerBase subscriber) - raises (InvalidName, - AlreadyConnected, - InvalidConnection, - ExceededConnectionLimit); - - EventConsumerBase unsubscribe (in FeatureName publisher_name, - in Cookie ck) - raises (InvalidName, - InvalidConnection); - - void connect_consumer (in FeatureName emitter_name, - in EventConsumerBase consumer) - raises (InvalidName, - AlreadyConnected, - InvalidConnection); - - EventConsumerBase disconnect_consumer (in FeatureName source_name) - raises (InvalidName, - NoConnection); - - ConsumerDescriptions get_all_consumers (); - - ConsumerDescriptions get_named_consumers (in NameList names) - raises (InvalidName); - - EmitterDescriptions get_all_emitters (); - - EmitterDescriptions get_named_emitters (in NameList names) - raises (InvalidName); - - PublisherDescriptions get_all_publishers (); - - PublisherDescriptions get_named_publishers (in NameList names) - raises (InvalidName); - }; - - abstract valuetype PrimaryKeyBase {}; - - interface CCMObject; //forward reference - - interface CCMHome - { - CORBA::IRObject get_component_def (); - CORBA::IRObject get_home_def (); - void remove_component ( in CCMObject comp) - raises (RemoveFailure); - }; - typedef sequence<CCMHome> CCMHomes; - - interface KeylessCCMHome - { - CCMObject create_component() - raises (CreateFailure); - }; - - interface HomeFinder - { - CCMHome find_home_by_component_type (in CORBA::RepositoryId comp_repid) - raises (HomeNotFound); - - CCMHome find_home_by_home_type (in CORBA::RepositoryId home_repid) - raises (HomeNotFound); - - CCMHome find_home_by_name (in string home_name) - raises (HomeNotFound); - }; - - interface Configurator - { - void configure (in CCMObject comp) - raises (WrongComponentType); - }; - - valuetype ConfigValue - { - public FeatureName name; - public any value; - }; - - typedef sequence<ConfigValue> ConfigValues; - - interface StandardConfigurator : Configurator - { - void set_configuration (in ConfigValues descr); - }; - - interface HomeConfiguration : CCMHome - { - void set_configurator (in Configurator cfg); - void set_configuration_values (in ConfigValues config); - void complete_component_configuration (in boolean b); - void disable_home_configuration(); - }; - - valuetype ComponentPortDescription - { - public FacetDescriptions facets; - public ReceptacleDescriptions receptacles; - public ConsumerDescriptions consumers; - public EmitterDescriptions emitters; - public PublisherDescriptions publishers; - }; - - interface CCMObject : Navigation, Receptacles, Events - { - CORBA::IRObject get_component_def ( ); - CCMHome get_ccm_home( ); - PrimaryKeyBase get_primary_key( ) - raises (NoKeyAvailable); - void configuration_complete( ) - raises (InvalidConfiguration); - void remove() - raises (RemoveFailure); - ComponentPortDescription get_all_ports (); - }; - - - // @@ Enumeration and DefaultEnumeration are only for EJB to CCM - // mapping? At any rate, we should be able to skip them for now. - abstract valuetype Enumeration - { - boolean has_more_elements(); - CCMObject next_element(); - }; - - typedef sequence<CCMObject> CCMObjectSeq; - - valuetype DefaultEnumeration : Enumeration - { - private CCMObjectSeq objects; - }; - - // @@ Components::Transaction is still there. - module Transaction - { - - typedef sequence<octet> TranToken; - - exception NoTransaction {}; - exception NotSupported {}; - exception SystemError {}; - exception RollbackError {}; - exception HeuristicMixed {}; - exception HeuristicRollback {}; - exception Security {}; - exception InvalidToken {}; - - enum Status - { - ACTIVE, - MARKED_ROLLBACK, - PREPARED, - COMMITTED, - ROLLED_BACK, - NO_TRANSACTION, - PREPARING, - COMMITTING, - ROLLING_BACK - }; - - local interface UserTransaction { - void begin () - raises (NotSupported, - SystemError); - - void commit () - raises (RollbackError, - NoTransaction, - HeuristicMixed, - HeuristicRollback, - Security, - SystemError); - - void rollback () - raises (NoTransaction, - Security, - SystemError); - - void set_rollback_only () - raises (NoTransaction, - SystemError); - - Status get_status() - raises (SystemError); - - void set_timeout (in long to) - raises (SystemError); - - TranToken suspend () - raises (NoTransaction, - SystemError); - - void resume (in TranToken txtoken) - raises (InvalidToken, - SystemError); - }; - }; - - // *************** Basic Container interfaces *************** - - typedef SecurityLevel2::Credentials Principal; - - local interface CCMContext - { - Principal get_caller_principal(); - - CCMHome get_CCM_home(); - - boolean get_rollback_only() - raises (IllegalState); - - Transaction::UserTransaction get_user_transaction() - raises (IllegalState); - - boolean is_caller_in_role (in string role); - - void set_rollback_only() - raises (IllegalState); - }; - - enum CCMExceptionReason - { - SYSTEM_ERROR, - CREATE_ERROR, - REMOVE_ERROR, - DUPLICATE_KEY, - FIND_ERROR, - OBJECT_NOT_FOUND, - NO_SUCH_ENTITY - }; - - exception CCMException - { - CCMExceptionReason reason; - }; - - local interface EnterpriseComponent {}; - - local interface SessionContext : CCMContext - { - Object get_CCM_object() - raises (IllegalState); - }; - - local interface SessionComponent : EnterpriseComponent - { - void set_session_context ( in SessionContext ctx) - raises (CCMException); - - void ccm_activate() - raises (CCMException); - - void ccm_passivate() - raises (CCMException); - - void ccm_remove () - raises (CCMException); - }; - - local interface SessionSynchronization - { - void after_begin () - raises (CCMException); - - void before_completion () - raises (CCMException); - - void after_completion (in boolean committed) - raises (CCMException); - }; - - local interface EntityContext : CCMContext - { - Object get_CCM_object () - raises (IllegalState); - - PrimaryKeyBase get_primary_key () - raises (IllegalState); - }; - - local interface EntityComponent : EnterpriseComponent - { - void set_entity_context (in EntityContext ctx) - raises (CCMException); - - void unset_entity_context () - raises (CCMException); - - void ccm_activate () - raises (CCMException); - - void ccm_load () - raises (CCMException); - - void ccm_store () - raises (CCMException); - - void ccm_passivate () - raises (CCMException); - - void ccm_remove () - raises (CCMException); - }; - - // *************** Extended Container Interfaces *************** - - enum BadComponentReferenceReason - { - NON_LOCAL_REFERENCE, - NON_COMPONENT_REFERENCE, - WRONG_CONTAINER - }; - - typedef CosPersistentState::CatalogBase CatalogBase; - typedef CosPersistentState::_TypeId _TypeId; - - typedef short SegmentId; - const SegmentId COMPONENT_SEGMENT = 0; - - typedef short FacetId; - const FacetId COMPONENT_FACET = 0; - - typedef sequence<octet> IdData; - typedef CosPersistentState::Pid PersistentId; - - typedef short StateIdType; - const StateIdType PERSISTENT_ID = 0; - - exception BadComponentReference - { - BadComponentReferenceReason reason; - }; - exception PolicyMismatch {}; - exception PersistenceNotAvailable {}; - exception UnknownActualHome {}; - exception ProxyHomeNotSupported {}; - exception InvalidStateIdData {}; - - local interface HomeRegistration - { - void register_home (in CCMHome home_ref, - in string home_name); - - void unregister_home (in CCMHome home_ref); - }; - - local interface CCM2Context : CCMContext - { - HomeRegistration get_home_registration (); - - void req_passivate () - raises (PolicyMismatch); - - CatalogBase get_persistence (in _TypeId catalog_type_id) - raises (PersistenceNotAvailable); - }; - - local interface ProxyHomeRegistration : HomeRegistration - { - void register_proxy_home (in CCMHome rhome, - in CCMHome ahome) - raises (UnknownActualHome, - ProxyHomeNotSupported); - }; - - local interface Session2Context : SessionContext, CCM2Context - { - Object create_ref (in CORBA::RepositoryId repid); - - Object create_ref_from_oid (in CORBA::OctetSeq oid, - in CORBA::RepositoryId repid); - - CORBA::OctetSeq get_oid_from_ref (in Object objref) - raises (IllegalState, - BadComponentReference); - }; - - abstract valuetype StateIdValue - { - StateIdType get_sid_type(); - IdData get_sid_data(); - }; - - local interface StateIdFactory - { - StateIdValue create (in IdData data) - raises (InvalidStateIdData); - }; - - valuetype PersistentIdValue : StateIdValue - { - private PersistentId pid; - - PersistentId get_pid(); - factory init (in PersistentId pid); - }; - - valuetype SegmentDescr - { - private StateIdValue sid; - private SegmentId seg; - - StateIdValue get_sid(); - SegmentId get_seg_id(); - factory init (in StateIdValue sid, - in SegmentId seg); - }; - - typedef sequence<SegmentDescr> SegmentDescrSeq; - - local interface ComponentId - { - FacetId get_target_facet(); - - SegmentId get_target_segment(); - - StateIdValue get_target_state_id (in StateIdFactory sid_factory) - raises (InvalidStateIdData); - - StateIdValue get_segment_state_id (in SegmentId seg, - in StateIdFactory sid_factory) - raises (InvalidStateIdData); - - ComponentId create_with_new_target (in FacetId new_target_facet, - in SegmentId new_target_segment); - - SegmentDescrSeq get_segment_descrs (in StateIdFactory sid_factory) - raises (InvalidStateIdData); - }; - - local interface Entity2Context : EntityContext, CCM2Context - { - ComponentId get_component_id () - raises (IllegalState); - - ComponentId create_component_id (in FacetId target_facet, - in SegmentId target_segment, - in SegmentDescrSeq seq_descrs); - - ComponentId create_monolithic_component_id (in FacetId target_facet, - in StateIdValue sid); - - Object create_ref_from_cid (in CORBA::RepositoryId repid, - in ComponentId cid); - - ComponentId get_cid_from_ref (in Object objref) - raises (BadComponentReference); - }; - - local interface ExecutorLocator : EnterpriseComponent - { - Object obtain_executor (in string name) - raises (CCMException); - - void release_executor (in Object exc) - raises (CCMException); - - void configuration_complete() - raises (InvalidConfiguration); - }; - - local interface HomeExecutorBase - { - }; - - // *************** Packaging and Deployment *************** - - module Deployment - { - typedef string UUID; - typedef string Location; - - enum AssemblyState - { - INACTIVE, - INSERVICE - }; - - exception UnknownImplId {}; - exception InvalidLocation {}; - exception InstallationFailure - { - FailureReason reason; - }; - exception InvalidAssembly {}; - - interface ComponentInstallation - { - void install(in UUID implUUID, - in Location component_loc) - raises (InvalidLocation, - InstallationFailure); - - void replace(in UUID implUUID, - in Location component_loc) - raises (InvalidLocation, - InstallationFailure); - - void remove(in UUID implUUID) - raises (UnknownImplId, - RemoveFailure); - - Location get_implementation (in UUID implUUID) - raises (UnknownImplId, - InstallationFailure); - }; - - interface Assembly - { - void build() - raises (CreateFailure); - - void tear_down() - raises (RemoveFailure); - - AssemblyState get_state(); - }; - - interface AssemblyFactory - { - Cookie create_assembly(in Location assembly_loc) - raises (InvalidLocation, - CreateFailure); - - Assembly lookup(in Cookie c) - raises (InvalidAssembly); - - void destroy(in Cookie c) - raises (InvalidAssembly, - RemoveFailure); - }; - - interface ComponentServer; // Forward decl. - typedef sequence<ComponentServer> ComponentServers; - - interface ServerActivator - { - ComponentServer create_component_server (in ConfigValues config) - raises (CreateFailure, - InvalidConfiguration); - - void remove_component_server (in ComponentServer server) - raises (RemoveFailure); - - ComponentServers get_component_servers (); - }; - - interface Container; // Forward decl. - typedef sequence<Container> Containers; - - interface ComponentServer - { - readonly attribute ConfigValues configuration; - - ServerActivator get_server_activator (); - Container create_container (in ConfigValues config) - raises (CreateFailure, - InvalidConfiguration); - - void remove_container (in Container cref) - raises (RemoveFailure); - - Containers get_containers (); - - void remove () - raises (RemoveFailure); - }; - - exception ImplEntryPointNotFound {}; - - interface Container - { - readonly attribute ConfigValues configuration; - - ComponentServer get_component_server (); - - CCMHome install_home (in UUID id, - in string entrypt, - in ConfigValues config) - raises (UnknownImplId, - ImplEntryPointNotFound, - InstallationFailure, - InvalidConfiguration); - - void remove_home (in CCMHome href) - raises (RemoveFailure); - - CCMHomes get_homes (); - void remove () - raises (RemoveFailure); - - }; - - }; -}; diff --git a/TAO/CIAO/ciao/Components.idl b/TAO/CIAO/ciao/Components.idl deleted file mode 100644 index 3846f59685b..00000000000 --- a/TAO/CIAO/ciao/Components.idl +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ - -/** - * @@ This file is included in the generated executor - * mapping IDL file, and for now just includes - * CCM_Container.idl. - */ - -#if !defined (CIAO_COMPONENTS_IDL) -#define CIAO_COMPONENTS_IDL - -#include "CCM_Container.idl" - -#endif /* CIAO_COMPONENTS_IDL */ - diff --git a/TAO/CIAO/ciao/ComponentsC.h b/TAO/CIAO/ciao/ComponentsC.h deleted file mode 100644 index a1c75c61736..00000000000 --- a/TAO/CIAO/ciao/ComponentsC.h +++ /dev/null @@ -1,97 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be/be_codegen.cpp:150 - -#ifndef _TAO_IDL_COMPONENTSC_H_ -#define _TAO_IDL_COMPONENTSC_H_ - -#include "tao/ORB.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/CDR.h" -#include "tao/Environment.h" -#include "tao/AnyTypeCode/TypeCode.h" - -#include "CCM_ContainerC.h" - -#if defined (TAO_EXPORT_MACRO) -#undef TAO_EXPORT_MACRO -#endif -#define TAO_EXPORT_MACRO - -#if defined (TAO_EXPORT_NESTED_CLASSES) -# if defined (TAO_EXPORT_NESTED_MACRO) -# undef TAO_EXPORT_NESTED_MACRO -# endif /* defined (TAO_EXPORT_NESTED_MACRO) */ -# define TAO_EXPORT_NESTED_MACRO -#endif /* TAO_EXPORT_NESTED_CLASSES */ - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if defined (__BORLANDC__) -#pragma option push -w-rvl -w-rch -w-ccc -w-inl -#endif /* __BORLANDC__ */ - -// TAO_IDL - Generated from -// be/be_visitor_traits.cpp:50 - -// Traits specializations. -namespace TAO -{ -} - -// TAO_IDL - Generated from -// be/be_visitor_root/cdr_op.cpp:48 - -#ifndef __ACE_INLINE__ - -// TAO_IDL - Generated from -// be/be_visitor_root/cdr_op.cpp:64 - -#endif /* __ACE_INLINE__ */ - -// TAO_IDL - Generated from -// be/be_codegen.cpp:911 - - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#if defined (__BORLANDC__) -#pragma option pop -#endif /* __BORLANDC__ */ - -#endif /* ifndef */ diff --git a/TAO/CIAO/ciao/ComponentsS.h b/TAO/CIAO/ciao/ComponentsS.h deleted file mode 100644 index 01d9be52593..00000000000 --- a/TAO/CIAO/ciao/ComponentsS.h +++ /dev/null @@ -1,63 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be/be_codegen.cpp:390 - -#ifndef _TAO_IDL_COMPONENTSS_H_ -#define _TAO_IDL_COMPONENTSS_H_ - - -#include "CCM_ContainerS.h" -#include "ComponentsC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Collocation_Proxy_Broker.h" -#include "tao/PortableServer/PortableServer.h" -#include "tao/PortableServer/Servant_Base.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if defined (__BORLANDC__) -#pragma option push -w-rvl -w-rch -w-ccc -w-inl -#endif /* __BORLANDC__ */ - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#if defined (__BORLANDC__) -#pragma option pop -#endif /* __BORLANDC__ */ - -#endif /* ifndef */ diff --git a/TAO/CIAO/ciao/Container_Base.cpp b/TAO/CIAO/ciao/Container_Base.cpp deleted file mode 100644 index 72948bbc68c..00000000000 --- a/TAO/CIAO/ciao/Container_Base.cpp +++ /dev/null @@ -1,433 +0,0 @@ -// $Id$ - -#include "Container_Base.h" -#include "ace/DLL.h" -#include "tao/Utils/PolicyList_Destroyer.h" -#include "ace/OS_NS_stdio.h" -#include "ace/SString.h" -#include "Servant_Activator.h" - -#if !defined (__ACE_INLINE__) -# include "Container_Base.inl" -#endif /* __ACE_INLINE__ */ - -namespace CIAO -{ - -//////////////////////////////////////////////////////////////// - Container::Container (CORBA::ORB_ptr o) - : orb_ (CORBA::ORB::_duplicate (o)) - { - } - - Container::~Container () - { - } - - PortableServer::POA_ptr - Container::the_POA (void) const - { - return this->component_poa_.in (); - } - - CORBA::ORB_ptr - Container::the_ORB (void) const - { - return this->orb_.in (); - } - - /////////////////////////////////////////////////////////////// - - ACE_Atomic_Op <ACE_SYNCH_MUTEX, long> - Session_Container::serial_number_ (0); - - Session_Container::Session_Container (CORBA::ORB_ptr o, - bool static_config_flag, - const Static_Config_EntryPoints_Maps* maps) - : Container (o), - number_ (0), - static_config_flag_ (static_config_flag), - static_entrypts_maps_ (maps), - sa_ (0) - { - } - - Session_Container::~Session_Container () - { - } - - int - Session_Container::init (const char *name, - const CORBA::PolicyList *more_policies - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - char buffer[MAXPATHLEN]; - - if (name == 0) - { - this->number_ = ++Session_Container::serial_number_; - ACE_OS::sprintf (buffer, "CIAO::Session_Container-%ld", - this->number_); - name = buffer; - } - - CORBA::Object_var poa_object = - this->orb_->resolve_initial_references("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - -1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - this->create_component_POA (name, - more_policies, - root_poa.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - this->create_facet_consumer_POA (root_poa.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - return 0; - } - - void - Session_Container::create_component_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root - ACE_ENV_ARG_DECL) - { - // Set up proper poa policies here. Default policies seems to be - // fine for session container. If you add some other default - // policies here, then you need to "add" more_policies below - // instead of simply assigning more_policies to the init policy - // list. - CORBA::PolicyList policies (0); - - if (p != 0) - policies = *p; - - PortableServer::POAManager_var poa_manager = - root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - this->component_poa_ = - root->create_POA (name, - poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - Session_Container::create_facet_consumer_POA ( - PortableServer::POA_ptr root - ACE_ENV_ARG_DECL) - { - PortableServer::POAManager_var poa_manager = - root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - TAO::Utils::PolicyList_Destroyer policies (3); - policies.length (3); - - policies[0] = - root->create_id_assignment_policy (PortableServer::USER_ID - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - policies[1] = - root->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Servant Retention Policy - policies[2] = - root->create_servant_retention_policy (PortableServer::RETAIN - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->facet_cons_poa_ = - root->create_POA ("facet_consumer_poa", - poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_NEW_THROW_EX (this->sa_, - Servant_Activator (this->orb_.in ()), - CORBA::NO_MEMORY ()); - - this->facet_cons_poa_->set_servant_manager ( - this->sa_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::Object_ptr - Session_Container::install_servant (PortableServer::Servant p, - Container::OA_Type t - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid - = tmp->activate_object (p - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Object_var objref - = tmp->id_to_reference (oid.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return objref._retn (); - } - - CORBA::Object_ptr - Session_Container::install_component (PortableServer::Servant p, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::ObjectId_var id = - this->component_poa_->activate_object (p - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Object_var objref - = this->component_poa_->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - oid = id._retn (); - - return objref._retn (); - } - - - //@@ Apparently we need to be cautious when handling the exception - // thrown here. We should make sure that new DnC interfaces - // NodeApplication/NodeApplicationManager etc will cache the new - // exceptions--> rethrow of new exceptions is needed. - // --Tao - Components::CCMHome_ptr - Session_Container::ciao_install_home (const char *exe_dll_name, - const char *exe_entrypt, - const char *sv_dll_name, - const char *sv_entrypt, - const char *ins_name - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::Deployment::ImplEntryPointNotFound, - Components::Deployment::InstallationFailure)) - { - - HomeFactory hcreator = 0; - ServantFactory screator = 0; - - if (this->static_config_flag_ == 0) - { - ACE_DLL executor_dll, servant_dll; - - if (exe_dll_name == 0 || sv_dll_name == 0) - ACE_THROW_RETURN (Components::Deployment::UnknownImplId (), - Components::CCMHome::_nil ()); - - if (executor_dll.open (exe_dll_name, - ACE_DEFAULT_SHLIB_MODE, - 0) != 0 - || servant_dll.open (sv_dll_name, - ACE_DEFAULT_SHLIB_MODE, - 0) != 0) - { - ACE_THROW_RETURN (Components::Deployment::UnknownImplId (), - Components::CCMHome::_nil ()); - } - - if (exe_entrypt == 0 || sv_entrypt == 0) - ACE_THROW_RETURN (Components::Deployment::ImplEntryPointNotFound (), - Components::CCMHome::_nil ()); - - // @@ (OO) Please use a static_cast<> here instead of a C-style - // cast. ANSI C++ casts are the preferred (and modern) - // way of casting in ACE/TAO/CIAO. - hcreator = (HomeFactory) executor_dll.symbol (exe_entrypt); - screator = (ServantFactory) servant_dll.symbol (sv_entrypt); - } - else - { - if (static_entrypts_maps_ == 0 || - static_entrypts_maps_->home_creator_funcptr_map_ == 0 || - static_entrypts_maps_->home_servant_creator_funcptr_map_ == 0) - ACE_THROW_RETURN (Components::Deployment::ImplEntryPointNotFound (), - Components::CCMHome::_nil ()); - - ACE_CString exe_entrypt_str (exe_entrypt); - static_entrypts_maps_->home_creator_funcptr_map_-> - find (exe_entrypt_str, hcreator); - - ACE_CString sv_entrypt_str (sv_entrypt); - static_entrypts_maps_->home_servant_creator_funcptr_map_-> - find (sv_entrypt_str, screator); - } - - if (hcreator == 0 || screator == 0) - ACE_THROW_RETURN (Components::Deployment::ImplEntryPointNotFound (), - Components::CCMHome::_nil ()); - - Components::HomeExecutorBase_var home_executor = hcreator (); - if (CORBA::is_nil (home_executor.in ())) - ACE_THROW_RETURN (Components::Deployment::InstallationFailure (), - Components::CCMHome::_nil ()); - - PortableServer::Servant home_servant = screator (home_executor.in (), - this, - ins_name - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (Components::CCMHome::_nil ()); - - if (home_servant == 0) - ACE_THROW_RETURN (Components::Deployment::InstallationFailure (), - Components::CCMHome::_nil ()); - - PortableServer::ServantBase_var safe (home_servant); - - CORBA::Object_var objref = - this->install_servant (home_servant, - Container::Component - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (Components::CCMHome::_nil ()); - - Components::CCMHome_var homeref = - Components::CCMHome::_narrow (objref.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return homeref._retn (); - - } - - void - Session_Container::ciao_uninstall_home (Components::CCMHome_ptr homeref - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - this->uninstall (homeref, - Container::Component - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - Session_Container::uninstall (CORBA::Object_ptr objref, - Container::OA_Type t - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid = - tmp->reference_to_id (objref - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - tmp->deactivate_object (oid.in () - ACE_ENV_ARG_PARAMETER); - } - - void - Session_Container::uninstall (PortableServer::Servant svt, - Container::OA_Type t - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid - = tmp->servant_to_id (svt - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - tmp->deactivate_object (oid.in () - ACE_ENV_ARG_PARAMETER); - } - - void - Session_Container::uninstall_component (Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - - PortableServer::ObjectId_var id = - this->component_poa_->reference_to_id (objref - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->component_poa_->deactivate_object (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - oid = id._retn (); - } - - CORBA::Object_ptr - Session_Container::generate_reference (const char *obj_id, - const char *repo_id, - Container::OA_Type t - ACE_ENV_ARG_DECL) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - tmp = this->component_poa_.in (); - else - tmp = this->facet_cons_poa_.in (); - - PortableServer::ObjectId_var oid = - PortableServer::string_to_ObjectId (obj_id); - - CORBA::Object_var objref = - tmp->create_reference_with_id (oid.in (), - repo_id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - return objref._retn (); - } - -} diff --git a/TAO/CIAO/ciao/Container_Base.h b/TAO/CIAO/ciao/Container_Base.h deleted file mode 100644 index 8d45d794613..00000000000 --- a/TAO/CIAO/ciao/Container_Base.h +++ /dev/null @@ -1,297 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Container_Base.h - * - * $Id$ - * - * Header file for CIAO's container implementations - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ -//============================================================================= - - -#ifndef CIAO_CONTAINER_BASE_H -#define CIAO_CONTAINER_BASE_H -#include /**/ "ace/pre.h" - -#include "ace/Hash_Map_Manager_T.h" -#include "tao/ORB.h" -#include "tao/PortableServer/PortableServer.h" -#include "tao/PortableServer/Servant_Base.h" -#include "CCM_ContainerC.h" -#include "CCM_DeploymentC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace CIAO -{ - class Servant_Activator; - - /** - * @class Container - * - * @brief Common container interface definition. - * - * Perhaps we can use local interface to define these interfaces as - * we will also get reference counting automatically. - */ - class CIAO_SERVER_Export Container - { - public: - enum OA_Type - { - Component, - Facet_Consumer - }; - - Container (CORBA::ORB_ptr o); - - virtual ~Container (void) = 0; - - /// Get component's POA. - /** - * This operation does *NOT* increase the reference count of the - * POA. Look at the const qualifier in the method. - */ - PortableServer::POA_ptr the_POA (void) const; - - /// Get a reference to the underlying ORB. - CORBA::ORB_ptr the_ORB (void) const; - - /// Initialize the container with a name. - virtual int init (const char *name = 0, - const CORBA::PolicyList *more_policies = 0 - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)) = 0; - - /// Install a new home - virtual Components::CCMHome_ptr ciao_install_home - (const char *exe_dll_name, - const char *exe_entrypt, - const char *sv_dll_name, - const char *sv_entrypt, - const char *ins_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::Deployment::ImplEntryPointNotFound, - Components::Deployment::InstallationFailure)) = 0; - - // Uninstall a servant for component or home. - virtual void ciao_uninstall_home (Components::CCMHome_ptr homeref - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)) = 0; - - // Uninstall a servant for component. - virtual void uninstall_component (::Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)) = 0; - - - protected: - CORBA::ORB_var orb_; - - /// POA within which all the components in this container will be - /// activated. - PortableServer::POA_var component_poa_; - - /// POA within which all the facets and receptacles will be - /// activated. - /** - * Having two POA's allows us to associate different policies that - * are distinct from the component. - */ - PortableServer::POA_var facet_cons_poa_; - }; - - class Session_Container; - - typedef ::Components::HomeExecutorBase_ptr (*HomeFactory) (void); - typedef ::PortableServer::Servant (*ServantFactory) - (::Components::HomeExecutorBase_ptr p, - ::CIAO::Session_Container *c, - const char *ins_name -#if !defined (TAO_HAS_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT) - , CORBA::Environment & -#endif - ); - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - HomeFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> HOMECREATOR_FUNCPTR_MAP; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ServantFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> HOMESERVANTCREATOR_FUNCPTR_MAP; - - struct Static_Config_EntryPoints_Maps - { - /// Map of home creator entry point name and func ptr - HOMECREATOR_FUNCPTR_MAP* home_creator_funcptr_map_; - - /// Map of home servant creator entry point name and func ptr - HOMESERVANTCREATOR_FUNCPTR_MAP* home_servant_creator_funcptr_map_; - }; - - class CIAO_SERVER_Export Session_Container : public Container - { - public: - - // @@ (OO) Does the static_config_flag really need to be an int? - // It appears to be a boolean value. Please use bool - // instead. - Session_Container (CORBA::ORB_ptr o, - bool static_config_flag = false, - const Static_Config_EntryPoints_Maps* static_entrypts_maps =0); - - virtual ~Session_Container (void); - - /// Initialize the container with a name. - virtual int init (const char *name = 0, - const CORBA::PolicyList *more_policies = 0 - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - - ACE_THROW_SPEC ((CORBA::SystemException)); - - /** - * @brief Simply installing a home executor into the component. - * - * This operation install a home executor into the component. It - * requires the name of the DLLs to executor and the servant glue - * code, and the entry points to the respective DLLs. Currently, - * we don't try to manage the lifetime of DLL objects, but we - * should at some later point. - * - * @retval Home objref of the installed home. - */ - virtual Components::CCMHome_ptr ciao_install_home - (const char *exe_dll_name, - const char *exe_entrypt, - const char *sv_dll_name, - const char *sv_entrypt, - const char *ins_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::Deployment::ImplEntryPointNotFound, - Components::Deployment::InstallationFailure)); - - // Uninstall a servant for component or home. - virtual void ciao_uninstall_home (Components::CCMHome_ptr homeref - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Uninstall a servant for component. - virtual void uninstall_component (::Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Install a servant for component or home. - CORBA::Object_ptr install_servant (PortableServer::Servant p, - Container::OA_Type t - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Install a component servant. - CORBA::Object_ptr install_component (PortableServer::Servant p, - PortableServer::ObjectId_out oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Get an object reference to a component or home from the servant. - CORBA::Object_ptr get_objref (PortableServer::Servant p - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Uninstall a servant for component or home. - void uninstall (CORBA::Object_ptr objref, - Container::OA_Type t - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Uninstall a servant for component or home. - void uninstall (PortableServer::Servant svt, - Container::OA_Type t - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Analog of the POA method that creates an object reference from - // an object id string. - CORBA::Object_ptr generate_reference (const char *obj_id, - const char *repo_id, - Container::OA_Type t - ACE_ENV_ARG_DECL); - - /// Return the servant activator factory that activates the - /// servants for facets and consumers. - Servant_Activator *ports_servant_activator (void) const; - - private: - - /// Create POA for the component. - /** - * This is the POA that is returned to the component applications - * if they need one. - */ - void create_component_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root - ACE_ENV_ARG_DECL); - - /// Create POA for the facets and consumers alone. - void create_facet_consumer_POA (PortableServer::POA_ptr root - ACE_ENV_ARG_DECL); - - protected: - long number_; - - static ACE_Atomic_Op <ACE_SYNCH_MUTEX, long> serial_number_; - - // @@ (OO) Does this really need to be an int? It appears to be a - // boolean value. Please use bool instead. - // - // It looks like it can also be declared const, as well. - bool static_config_flag_; - const Static_Config_EntryPoints_Maps* static_entrypts_maps_; - - /// The servant activator factory used to activate facets and - /// consumer servants. - Servant_Activator *sa_; - }; -} - -// Macro for registration of an OBV factory in the generated -// servant class. Similar to the macro for TAO in -// tao/ValueType/ValueFactory.h but here we take advantage of -// the fact that we have access to the current ORB indirectly -// through the context and container. -#define CIAO_REGISTER_OBV_FACTORY(FACTORY, VALUETYPE) \ - { \ - CORBA::ValueFactory factory = new FACTORY; \ - CORBA::ORB_ptr orb = \ - this->context_->_ciao_the_Container ()->the_ORB (); \ - CORBA::ValueFactory prev_factory = \ - orb->register_value_factory ( \ - VALUETYPE::_tao_obv_static_repository_id (), \ - factory); \ - CORBA::remove_ref (prev_factory); \ - CORBA::add_ref (factory); \ - } - -#if defined (__ACE_INLINE__) -# include "Container_Base.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_CONTAINER_BASE_H */ diff --git a/TAO/CIAO/ciao/Container_Base.pidl b/TAO/CIAO/ciao/Container_Base.pidl deleted file mode 100644 index e698ea66b45..00000000000 --- a/TAO/CIAO/ciao/Container_Base.pidl +++ /dev/null @@ -1,33 +0,0 @@ -// $Id$ - -/** - * CIAO's internal container interface definitions. - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CONTAINER_BASE_PIDL) -#define CONTAINER_BASE_PIDL - -#include "CIAO_Component.pidl" -#include <SecurityLevel2.idl> -#include "CIAO_Transaction.pidl" - -// *************** Basic Container interfaces *************** - -module CIAO -{ - typeprefix Components "wustl.edu"; - - local interface Container - { - // Return the POA - PortableServer::POA the_POA (); - }; - - local interface SessionContainer - { - - }; -}; -#endif /* CONTAINER_BASE_PIDL */ diff --git a/TAO/CIAO/ciao/Container_Impl.cpp b/TAO/CIAO/ciao/Container_Impl.cpp deleted file mode 100644 index 30cbdf59b78..00000000000 --- a/TAO/CIAO/ciao/Container_Impl.cpp +++ /dev/null @@ -1,281 +0,0 @@ -// $Id$ -#include "Container_Impl.h" - -#include "ace/Auto_Ptr.h" -#include "ace/OS_NS_string.h" - -#if !defined (__ACE_INLINE__) -# include "Container_Impl.inl" -#endif /* __ACE_INLINE__ */ - - -CIAO::Container_Impl::~Container_Impl () -{ - // @@ remove all home? -} - -PortableServer::POA_ptr -CIAO::Container_Impl::_default_POA (void) -{ - return PortableServer::POA::_duplicate (this->poa_.in ()); -} - -int -CIAO::Container_Impl::init (const ::Components::ConfigValues &options, - Components::Deployment::ComponentInstallation_ptr inst - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->config_ = options; - this->installation_ = - Components::Deployment::ComponentInstallation::_duplicate (inst); - - // @@ Initialize container and create the internal container - // implementation that actually interacts with installed - // homes/components. - - // @@ We will need a container factory here later on when we support - // more kinds of container implementations. - - // @@ Fish out the ComponentServer object reference from <options>. - - ACE_NEW_THROW_EX (this->container_, - CIAO::Session_Container (this->orb_.in (), - this->static_config_flag_, - this->static_entrypts_maps_), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (-1); - - return this->container_->init (0, - 0 - ACE_ENV_ARG_PARAMETER); -} - -::Components::ConfigValues * -CIAO::Container_Impl::configuration (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - Components::ConfigValues *retval; - - ACE_NEW_THROW_EX (retval, - Components::ConfigValues (), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (0); - - *retval = this->config_; - - return retval; -} - -::Components::Deployment::ComponentServer_ptr -CIAO::Container_Impl::get_component_server (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return Components::Deployment::ComponentServer::_duplicate (this->comserv_.in ()); -} - -::Components::CCMHome_ptr -CIAO::Container_Impl::install_home (const char * id, - const char * entrypt, - const Components::ConfigValues & config - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::Deployment::ImplEntryPointNotFound, - Components::Deployment::InstallationFailure, - Components::InvalidConfiguration)) -{ - // use id to locate the softpkg from the ComponentInstallation interface. - // depending on where we want to parse the softpkg descriptor, we - // can either use the <entrypt> directly (if we parse the softpkg in - // Assembly), simply verify that is correct, or even discard this - // value. - - // @@ Here we need to resolve paths to both component executors and - // component servants (that matches the container type) for the - // executor and their entry points before we can install the home. - struct home_installation_info config_info; - this->parse_config_values (id, - config, - config_info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - Components::CCMHome_var newhome - = this->container_->ciao_install_home - (config_info.executor_dll_.in (), - entrypt, - config_info.servant_dll_.in (), - config_info.servant_entrypt_.in (), - "instance_name" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - - this->home_set_.add (newhome.in ()); - } - return newhome._retn (); -} - -void -CIAO::Container_Impl::remove_home (Components::CCMHome_ptr href - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) -{ - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); - - if (this->home_set_.object_in_set (href) == 0) - ACE_THROW (CORBA::BAD_PARAM ()); - - // @@ Finalizing home... how? Removing all the components, but how? - // It looks like the component home will also need to keep a record - // of all the components it creates. - - this->container_->ciao_uninstall_home (href - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // @@ Still need to remove the home if the previous operation fails? - if (this->home_set_.remove (href) == -1) - ACE_THROW (::Components::RemoveFailure ()); -} - -::Components::CCMHomes * -CIAO::Container_Impl::get_homes (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - - Components::CCMHomes_var retval; - - ACE_NEW_THROW_EX (retval.out (), - Components::CCMHomes (), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (0); - - CORBA::ULong len = this->home_set_.size (); - retval->length (len); // resize - -#if 0 - // TAO is broken here. Both <replace>, <get_buffer> and friends are missing. - this->home_set_.copy (len, retval->get_buffer (0)); -#else - for (CORBA::ULong i = 0; i < len; ++i) - { - retval[i] = this->home_set_.at (i); - } -#endif - - return retval._retn (); -} - -void -CIAO::Container_Impl::remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) -{ - // @@ Need to remove all CCMHome - - // ACE_THROW (CORBA::NO_IMPLEMENT ()); - - ACE_DEBUG ((LM_DEBUG, "CIAO::Container_Impl::remove\n")); -} - -void -CIAO::Container_Impl::parse_config_values (const char *id, - const Components::ConfigValues &options, - struct home_installation_info &component_install_info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::Deployment::ImplEntryPointNotFound, - Components::InvalidConfiguration)) -{ - CORBA::String_var servant_uuid; - - for (CORBA::ULong i = 0; i < options.length (); ++i) - { - CORBA::String_var *info = 0; - const char *str_in = 0; - - // @@ The following code need cleaning up. - if (ACE_OS::strcmp (options[i]->name (), "CIAO-servant-UUID") == 0) - info = &servant_uuid; - else if (ACE_OS::strcmp (options[i]->name (), "CIAO-servant-entrypt") == 0) - info = &component_install_info.servant_entrypt_; - else - { - Components::InvalidConfiguration *exc = 0; - ACE_NEW_THROW_EX (exc, - Components::InvalidConfiguration, - CORBA::NO_MEMORY ()); - exc->name = CORBA::string_dup (options[i]->name ()); - exc->reason = Components::UnknownConfigValueName; -#if defined (ACE_HAS_EXCEPTIONS) - auto_ptr<Components::InvalidConfiguration> safety (exc); - exc->_raise (); -#else - ACE_TRY_ENV.exception (exc); -#endif /*ACE_HAS_EXCEPTIONS*/ - } - - if (options[i]->value () >>= str_in) - { - *info = CORBA::string_dup (str_in); -#if 0 - ACE_DEBUG ((LM_DEBUG, "*parse_config_values got (%s) = %s\n", - options[i]->name (), - str_in)); -#endif /* 0 */ - } - else - { - Components::InvalidConfiguration *exc = 0; - ACE_NEW_THROW_EX (exc, - Components::InvalidConfiguration, - CORBA::NO_MEMORY ()); - exc->name = CORBA::string_dup (options[i]->name ()); - exc->reason = Components::UnknownConfigValueName; -#if defined (ACE_HAS_EXCEPTIONS) - auto_ptr<Components::InvalidConfiguration> safety (exc); - exc->_raise (); -#else - ACE_TRY_ENV.exception (exc); -#endif /*ACE_HAS_EXCEPTIONS*/ - } - } - - if (this->static_config_flag_ == 0) - { - component_install_info.executor_dll_ = - this->installation_->get_implementation (id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - component_install_info.servant_dll_ = - this->installation_->get_implementation (servant_uuid.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (component_install_info.executor_dll_.in () == 0 || - component_install_info.servant_dll_.in () == 0 || - component_install_info.servant_entrypt_.in () == 0) - { - Components::InvalidConfiguration *exc = 0; - ACE_NEW_THROW_EX (exc, - Components::InvalidConfiguration, - CORBA::NO_MEMORY ()); - exc->name = CORBA::string_dup ("home_installation_info"); - exc->reason = Components::ConfigValueRequired; -#if defined (ACE_HAS_EXCEPTIONS) - auto_ptr<Components::InvalidConfiguration> safety (exc); - exc->_raise (); -#else - ACE_TRY_ENV.exception (exc); -#endif /*ACE_HAS_EXCEPTIONS*/ - } - } -} diff --git a/TAO/CIAO/ciao/Container_Impl.h b/TAO/CIAO/ciao/Container_Impl.h deleted file mode 100644 index a66a56eec15..00000000000 --- a/TAO/CIAO/ciao/Container_Impl.h +++ /dev/null @@ -1,168 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Container_Impl.h - * - * $Id$ - * - * This file contains implementation for the servant of - * Components::Deployment::Container interface. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ -//============================================================================= - - -#ifndef CIAO_CONTAINER_IMPL_H -#define CIAO_CONTAINER_IMPL_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CCM_DeploymentS.h" -#include "Container_Base.h" -#include "Object_Set_T.h" - -namespace CIAO -{ - - struct home_installation_info - { - CORBA::String_var executor_dll_; - CORBA::String_var servant_dll_; - CORBA::String_var servant_entrypt_; - }; - - /** - * @class Container_Impl - * - * @brief Servant implementation for Components::Deployment::Container - * - * This class implements the Components::Deployment::Container - * interface as defined by the CCM specification. As the interface - * implies, this is actually part of the deployment interface and is - * used to manage the lifecycle of the installed components and - * homes. - */ - class CIAO_SERVER_Export Container_Impl - : public virtual POA_Components::Deployment::Container - { - public: - /// Constructor - Container_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - Components::Deployment::ComponentServer_ptr server, - int static_config_flag =0, - const Static_Config_EntryPoints_Maps* static_entrypts_maps=0); - - /// Destructor - virtual ~Container_Impl (void); - - /// Get the containing POA. This operation does *not* - /// increase the reference count of the POA. - virtual PortableServer::POA_ptr _default_POA (void); - - /// Initialize the container with a name. - int init (const Components::ConfigValues &options, - Components::Deployment::ComponentInstallation_ptr installation - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Components::Deployment::Container defined attributes/operations. - - virtual ::Components::ConfigValues * configuration (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::Deployment::ComponentServer_ptr get_component_server (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::CCMHome_ptr install_home (const char * id, - const char * entrypt, - const Components::ConfigValues & config - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::Deployment::ImplEntryPointNotFound, - Components::Deployment::InstallationFailure, - Components::InvalidConfiguration)); - - virtual void remove_home (Components::CCMHome_ptr href - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)); - - virtual ::Components::CCMHomes * get_homes (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)); - - // ------------------- CIAO Internal Operations ------------------------ - /// Set the cached object reference. - void set_objref (Components::Deployment::Container_ptr o - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - - /// Get the cached object reference. This operation will invoke - /// _this if there's no cached reference available. Notice that - /// this method does *NOT* increase the reference count of the - /// cached reference. - Components::Deployment::Container_ptr get_objref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - -protected: - /// parse ConfigValues - void parse_config_values (const char *exe_id, - const Components::ConfigValues &options, - struct home_installation_info &component_install_info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::Deployment::UnknownImplId, - Components::Deployment::ImplEntryPointNotFound, - Components::InvalidConfiguration)); - - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; - - /// Keep a pointer to the managing POA. - PortableServer::POA_var poa_; - - /// Internal container implementation. - CIAO::Container *container_; - - /// Cached ConfigValues. - Components::ConfigValues config_; - - /// Cached Container reference (of ourselves.) - Components::Deployment::Container_var objref_; - - /// Cached ComponentServer. - Components::Deployment::ComponentServer_var comserv_; - - /// And a reference to the ServerActivator that created us. - Components::Deployment::ComponentInstallation_var installation_; - - /// Synchronize access to the object set. - TAO_SYNCH_MUTEX lock_; - - /// Keep a list of managed CCMHome. - Object_Set<Components::CCMHome, Components::CCMHome_var> home_set_; - - /// Flag to indicate static configuration. - int static_config_flag_; - - /// Reference to CIAO static config entry points map. - const Static_Config_EntryPoints_Maps* static_entrypts_maps_; - }; -} - -#if defined (__ACE_INLINE__) -# include "Container_Impl.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_CONTAINER_IMPL_H */ diff --git a/TAO/CIAO/ciao/Container_Impl.inl b/TAO/CIAO/ciao/Container_Impl.inl deleted file mode 100644 index cd1aea3253a..00000000000 --- a/TAO/CIAO/ciao/Container_Impl.inl +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -CIAO::Container_Impl::Container_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - Components::Deployment::ComponentServer_ptr s, - int static_config_flag, - const Static_Config_EntryPoints_Maps* static_entrypts_maps) - : orb_ (CORBA::ORB::_duplicate (o)), - poa_ (PortableServer::POA::_duplicate (p)), - comserv_ (Components::Deployment::ComponentServer::_duplicate (s)), - static_config_flag_ (static_config_flag), - static_entrypts_maps_ (static_entrypts_maps) -{ -} - -ACE_INLINE void -CIAO::Container_Impl::set_objref (Components::Deployment::Container_ptr o - ACE_ENV_ARG_DECL) -{ - if (!CORBA::is_nil (this->objref_.in ())) - ACE_THROW (CORBA::BAD_INV_ORDER ()); - - this->objref_ = Components::Deployment::Container::_duplicate (o); -} - -ACE_INLINE Components::Deployment::Container_ptr -CIAO::Container_Impl::get_objref (ACE_ENV_SINGLE_ARG_DECL) -{ - if (CORBA::is_nil (this->objref_.in ())) - { - this->objref_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - return this->objref_.in (); -} diff --git a/TAO/CIAO/ciao/Context_Impl_Base.cpp b/TAO/CIAO/ciao/Context_Impl_Base.cpp deleted file mode 100644 index c0ddbce3618..00000000000 --- a/TAO/CIAO/ciao/Context_Impl_Base.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// $Id$ - -#include "Context_Impl_Base.h" - -namespace CIAO -{ - Context_Impl_Base::Context_Impl_Base (void) - { - // Should not be called. - ACE_ASSERT (0); - } - - Context_Impl_Base::Context_Impl_Base (Components::CCMHome_ptr home, - Session_Container * c) - : home_ (Components::CCMHome::_duplicate (home)), - container_ (c) - { - } - - Context_Impl_Base::~Context_Impl_Base (void) - { - } - - // Operations from ::Components::CCMContext. - - Components::Principal_ptr - Context_Impl_Base::get_caller_principal ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), - Components::Principal::_nil ()); - } - - Components::CCMHome_ptr - Context_Impl_Base::get_CCM_home ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return Components::CCMHome::_duplicate (this->home_.in ()); - } - - CORBA::Boolean - Context_Impl_Base::get_rollback_only ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::IllegalState)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), false); - } - - Components::Transaction::UserTransaction_ptr - Context_Impl_Base::get_user_transaction ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::IllegalState)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), - Components::Transaction::UserTransaction::_nil ()); - } - - CORBA::Boolean - Context_Impl_Base::is_caller_in_role ( - const char * /* role */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), false); - } - - void - Context_Impl_Base::set_rollback_only ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::IllegalState)) - { - ACE_THROW (CORBA::NO_IMPLEMENT ()); - } - - // CIAO-specific. - - CIAO::Session_Container * - Context_Impl_Base::_ciao_the_Container (void) const - { - return this->container_; - } -} diff --git a/TAO/CIAO/ciao/Context_Impl_Base.h b/TAO/CIAO/ciao/Context_Impl_Base.h deleted file mode 100644 index fb871c2ca51..00000000000 --- a/TAO/CIAO/ciao/Context_Impl_Base.h +++ /dev/null @@ -1,106 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Context_Impl_Base.h - * - * $Id$ - * - * This file contains the non-template declaration of a base class for - * the template mixin for the generated context class. - * - * @author Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_CONTEXT_IMPL_BASE_H -#define CIAO_CONTEXT_IMPL_BASE_H -#include /**/ "ace/pre.h" - -#include "tao/Objref_VarOut_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CIAO_Server_Export.h" -#include "ciao/CCM_ContainerC.h" - -namespace Components -{ - class CCMHome; - typedef CCMHome *CCMHome_ptr; - - typedef - TAO_Objref_Var_T< - CCMHome - > - CCMHome_var; -} - -namespace CIAO -{ - class Session_Container; - - /** - * @class Context_Impl_Base - * - * @brief Non-template base class for Context_Impl. - * - * Holds the non-template parts of its child class - * Context_Impl. - */ - class CIAO_SERVER_Export Context_Impl_Base - : public virtual Components::CCMContext - { - public: - explicit Context_Impl_Base (void); - - Context_Impl_Base (Components::CCMHome_ptr home, - Session_Container * c); - - virtual ~Context_Impl_Base (void); - - // Operations from ::Components::CCMContext. - virtual Components::Principal_ptr - get_caller_principal (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual Components::CCMHome_ptr - get_CCM_home (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Boolean - get_rollback_only (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::IllegalState)); - - virtual Components::Transaction::UserTransaction_ptr - get_user_transaction (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::IllegalState)); - - virtual CORBA::Boolean - is_caller_in_role (const char *role - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void - set_rollback_only (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::IllegalState)); - - // CIAO-specific. - - CIAO::Session_Container *_ciao_the_Container (void) const; - - protected: - Components::CCMHome_var home_; - Session_Container *container_; - }; -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_CONTEXT_IMPL_BASE_H */ diff --git a/TAO/CIAO/ciao/Context_Impl_T.cpp b/TAO/CIAO/ciao/Context_Impl_T.cpp deleted file mode 100644 index da166b8d174..00000000000 --- a/TAO/CIAO/ciao/Context_Impl_T.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// $Id$ - -#ifndef CIAO_CONTEXT_IMPL_T_C -#define CIAO_CONTEXT_IMPL_T_C - -#include "Context_Impl_T.h" - -namespace CIAO -{ - template <typename BASE_CTX, - typename SVNT, - typename COMP, - typename COMP_VAR> - Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>::Context_Impl ( - Components::CCMHome_ptr home, - Session_Container *c, - SVNT *sv) - : Context_Impl_Base (home, c), - servant_ (sv) - { - } - - template <typename BASE_CTX, - typename SVNT, - typename COMP, - typename COMP_VAR> - Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>::~Context_Impl (void) - { - } - - // Operations from ::Components::SessionContext. - - template <typename BASE_CTX, - typename SVNT, - typename COMP, - typename COMP_VAR> - CORBA::Object_ptr - Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>::get_CCM_object ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::IllegalState)) - { - if (CORBA::is_nil (this->component_.in ())) - { - CORBA::Object_var obj = - this->container_->get_objref (this->servant_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - this->component_ = COMP::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - if (CORBA::is_nil (this->component_.in ())) - { - ACE_THROW_RETURN (CORBA::INTERNAL (), - CORBA::Object::_nil ()); - } - } - - return COMP::_duplicate (this->component_.in ()); - } -} - -#endif /* CIAO_CONTEXT_IMPL_T_C */ diff --git a/TAO/CIAO/ciao/Context_Impl_T.h b/TAO/CIAO/ciao/Context_Impl_T.h deleted file mode 100644 index 2cc2895e23f..00000000000 --- a/TAO/CIAO/ciao/Context_Impl_T.h +++ /dev/null @@ -1,103 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Context_Impl_T.h - * - * $Id$ - * - * This file contains the declaration of a mixin base class for - * the generated context class. - * - * @author Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_CONTEXT_IMPL_T_H -#define CIAO_CONTEXT_IMPL_T_H - -#include /**/ "ace/pre.h" - -#include "Context_Impl_Base.h" -#include "tao/LocalObject.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace CORBA -{ - class SystemException; -} - -namespace SecurityLevel2 -{ - class Credentials; -} - -namespace Components -{ - typedef SecurityLevel2::Credentials Principal; - typedef Principal *Principal_ptr; - - class IllegalState; - - namespace Transaction - { - class UserTransaction; - typedef UserTransaction *UserTransaction_ptr; - } -} - -namespace CIAO -{ - class Session_Container; - - /** - * @class Context_Impl - * - * @brief Mixin base class for generated context. - * - * This class implements operations and contains parameterized - * members common to all generated servants. - */ - template <typename BASE_CTX, - typename SVNT, - typename COMP, - typename COMP_VAR> - class Context_Impl : public virtual BASE_CTX, - public virtual Context_Impl_Base, - public virtual TAO_Local_RefCounted_Object - { - public: - Context_Impl (Components::CCMHome_ptr home, - Session_Container *c, - SVNT *sv); - - virtual ~Context_Impl (void); - - // Operations from ::Components::SessionContext. - - virtual CORBA::Object_ptr - get_CCM_object (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::IllegalState)); - - protected: - SVNT *servant_; - COMP_VAR component_; - }; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Context_Impl_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Context_Impl_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_CONTEXT_IMPL_T_H */ diff --git a/TAO/CIAO/ciao/Cookies.cpp b/TAO/CIAO/ciao/Cookies.cpp deleted file mode 100644 index 9c43c8720e3..00000000000 --- a/TAO/CIAO/ciao/Cookies.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// $Id$ -#include "Cookies.h" - -#if !defined (__ACE_INLINE__) -#include "Cookies.inl" -#endif /* !defined INLINE */ - -ACE_RCSID (ciao, - Cookies, - "$Id$") - -namespace CIAO -{ - Map_Key_Cookie::Map_Key_Cookie (const ACE_Active_Map_Manager_Key &key) - { - this->cookieValue ().length (ACE_Active_Map_Manager_Key::size ()); - key.encode (this->cookieValue ().get_buffer (0)); - } - - Map_Key_Cookie::~Map_Key_Cookie (void) - { - } - - bool - Map_Key_Cookie::insert (ACE_Active_Map_Manager_Key &key) - { - this->cookieValue ().length (ACE_Active_Map_Manager_Key::size ()); - key.encode (this->cookieValue ().get_buffer (0)); - return true; - } - - bool - Map_Key_Cookie::extract (::Components::Cookie *ck, - ACE_Active_Map_Manager_Key &key) - { - Map_Key_Cookie *c = - dynamic_cast <Map_Key_Cookie *> (ck); - - if (c == 0) - return false; - - ::CORBA::OctetSeq *x = c->get_cookie (); - - if (x->length () != ACE_Active_Map_Manager_Key::size ()) - return false; - - key.decode (x->get_buffer ()); - - return true; - } - - ::CORBA::OctetSeq * - Map_Key_Cookie::get_cookie (void) - { - return &this->cookieValue (); - } - - //======================================================== - CORBA::ValueBase * - Map_Key_Cookie_init::create_for_unmarshal (ACE_ENV_SINGLE_ARG_DECL) - { - CORBA::ValueBase *ret_val = 0; - - ACE_NEW_THROW_EX (ret_val, - CIAO::Map_Key_Cookie, - CORBA::NO_MEMORY ()); - - return ret_val; - } - - -} diff --git a/TAO/CIAO/ciao/Cookies.h b/TAO/CIAO/ciao/Cookies.h deleted file mode 100644 index dd4f11407a8..00000000000 --- a/TAO/CIAO/ciao/Cookies.h +++ /dev/null @@ -1,75 +0,0 @@ -// $Id$ - -/** - * @file Cookies.h - * - * A CIAO implementation of Cookie valuetype. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef CIAO_COOKIES_H -#define CIAO_COOKIES_H -#include /**/ "ace/pre.h" - -#include "CCM_BaseC.h" - - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CIAO_Container_Export.h" -#include "CIAO_ValueC.h" -#include "ace/Active_Map_Manager.h" - -namespace CIAO -{ - /** - * @class Map_Key_Cookie - * - * @brief A internal cookie valuetype implementation. - */ - class CIAO_CONTAINER_Export Map_Key_Cookie - : public virtual OBV_Components::Cookie - { - public: - Map_Key_Cookie (void); - - virtual ~Map_Key_Cookie (void); - - /// Initialize a @c Cookie with an @c ACE_Active_Map_Manager_Key - Map_Key_Cookie (const ACE_Active_Map_Manager_Key &key); - - /// Insert the @c ACE_Active_Map_Manager_Key - bool insert (ACE_Active_Map_Manager_Key &key); - - /// Operation on the valuetype - CORBA::OctetSeq * get_cookie (void); - - /// Extract the @c ACE_Active_Map_Manager_Key - static bool extract (::Components::Cookie *c, - ACE_Active_Map_Manager_Key &key); - }; - - /** - * @class Map_Key_Cookie_init - * - * @brief Valuefactory implementation for Cookies. - */ - class CIAO_CONTAINER_Export Map_Key_Cookie_init : - public virtual ::Components::Cookie_init - { - public: - virtual ~Map_Key_Cookie_init (void); - - virtual CORBA::ValueBase *create_for_unmarshal (ACE_ENV_SINGLE_ARG_DECL); - }; -} - -#if defined (__ACE_INLINE__) -#include "Cookies.inl" -#endif /* !defined INLINE */ - -#include /**/ "ace/post.h" -#endif /* CIAO_COOKIES_H */ diff --git a/TAO/CIAO/ciao/Cookies.inl b/TAO/CIAO/ciao/Cookies.inl deleted file mode 100644 index e4d89f595c7..00000000000 --- a/TAO/CIAO/ciao/Cookies.inl +++ /dev/null @@ -1,16 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -namespace CIAO -{ - ACE_INLINE - Map_Key_Cookie::Map_Key_Cookie (void) - { - } - - // ======================================== - ACE_INLINE - Map_Key_Cookie_init::~Map_Key_Cookie_init () - { - } -} diff --git a/TAO/CIAO/ciao/CosPersistentState.idl b/TAO/CIAO/ciao/CosPersistentState.idl deleted file mode 100644 index 64f127539e2..00000000000 --- a/TAO/CIAO/ciao/CosPersistentState.idl +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ - -/** - * @@ This is just a temporary file. Since TAO does not have - * CosPersistentState at all, we use this file to define - * types necessary to get ComponentBase.idl to compile. - * - * Compile with - * tao_idl -Gv CosPersistentState.idl - */ - -#if !defined (CIAO_COSPERSISTENTSTATE_PIDL) -#define CIAO_COSPERSISTENTSTATE_PIDL - -module CosPersistentState { - local interface CatalogBase - { - }; - - typedef sequence<octet> _TypeId; - typedef string Pid; -}; -#endif /* CIAO_COSPERSISTENTSTATE_PIDL */ diff --git a/TAO/CIAO/ciao/Deployment.idl b/TAO/CIAO/ciao/Deployment.idl new file mode 100644 index 00000000000..20cd4534632 --- /dev/null +++ b/TAO/CIAO/ciao/Deployment.idl @@ -0,0 +1,174 @@ +// $Id$ +#include "Deployment_Data.idl" + +module Deployment { + + exception ResourceNotAvailable { + string name; + string resourceType; + string propertyName; + string elementName; + string resourceName; + }; + + exception PlanError { + string name; + string reason; + }; + + exception InvalidProperty { + string name; + string reason; + }; + + exception NameExists { + }; + + exception PackageError { + string source; + string reason; + }; + + exception NoSuchName { + }; + + exception LastConfiguration { + }; + + exception InvalidReference { + }; + + interface ApplicationManager { + Application startLaunch (in Properties configProperty, out Connections providedReference, in boolean start) + raises (ResourceNotAvailable, StartError, InvalidProperty); + void destroyApplication (in Application app) + raises (StopError); + }; + + typedef sequence < Application > Applications; + + interface DomainApplicationManager + { + DeploymentPlan getPlan (); + void startLaunch (in Properties configProperty, in boolean start) + raises (ResourceNotAvailable, StartError, InvalidProperty); + void finishLaunch (in boolean start) + raises (StartError, InvalidConnection); + void start () + raises (StartError); + void destroyApplication () + raises (StopError); + void destroyManager () + raises (StopError); + }; + + typedef sequence < DomainApplicationManager > DomainApplicationManagers; + + interface ExecutionManager { + DomainApplicationManager preparePlan (in DeploymentPlan plan, in boolean commitResources) + raises (ResourceNotAvailable, PlanError, StartError); + DomainApplicationManagers getManagers (); + void destroyManager (in DomainApplicationManager manager) + raises (StopError); + }; + + interface TargetManager { + Domain getAllResources (); + Domain getAvailableResources (); + void commitResources (in DeploymentPlan plan) + raises (ResourceNotAvailable, PlanError); + void releaseResources (in DeploymentPlan argname); + void updateDomain (in ::CORBA::StringSeq elements, in Domain domainSubset, in DomainUpdateKind updateKind); + }; + + interface Logger { + }; + + interface NodeApplicationManager : + ApplicationManager + { + }; + + interface NodeManager { + void joinDomain (in Domain ciao_domain, in TargetManager manager, in Logger log); + void leaveDomain (); + NodeApplicationManager preparePlan (in DeploymentPlan plan) + raises (StartError, PlanError); + void destroyManager (in NodeApplicationManager appManager) + raises (StopError, InvalidReference); + }; + + interface RepositoryManager { + void installPackage (in string installationName, in string location) + raises (NameExists, PackageError); + void createPackage (in string installationName, in PackageConfiguration package, in string baseLocation, in boolean replace) + raises (NameExists, PackageError); + PackageConfiguration findPackageByName (in string name) + raises (NoSuchName); + PackageConfiguration findPackageByUUID (in string UUID) + raises (NoSuchName); + ::CORBA::StringSeq findNamesByType (in string type); + ::CORBA::StringSeq getAllNames (); + ::CORBA::StringSeq getAllTypes (); + void deletePackage (in string installationName) + raises (NoSuchName); + }; + + +//***************************************new_RepositoryManager ONWARDS***************************************** + + + typedef sequence<octet> Artifact; + typedef sequence<octet> Package; + + exception NoPlan { + }; + + enum Platform { + Win32, + Unix, + Linux, + Solaris, + Vxworks, + UNDEF + }; + + struct Implementation + { + Platform the_platform; + string name; + Artifact the_implementation; + }; + + typedef sequence<Implementation> Implementations; + + interface new_RepositoryManager + { + void installPackage (in string installationName, in Package the_package, in boolean replace) + raises (NameExists, PackageError); + + DeploymentPlan retrievePlan (in string packageName) + raises (NoPlan); + + Package findPackageByName (in string name) + raises (NoSuchName); + + Implementation findImplementationByName (in string implementation_name, in string package_name) + raises (NoSuchName); + + Package findPackageByUUID (in string UUID) + raises (NoSuchName); + + Implementation findImplementationByUUID (in string UUID) + raises (NoSuchName); + + + //::CORBA::StringSeq findNamesByType (in string type); + //::CORBA::StringSeq getAllTypes (); + + ::CORBA::StringSeq getAllPackageNames (); + + void deletePackage (in string installationName) + raises (NoSuchName); + }; +}; diff --git a/TAO/CIAO/ciao/Deployment_Base.idl b/TAO/CIAO/ciao/Deployment_Base.idl new file mode 100644 index 00000000000..7a9e9219ef9 --- /dev/null +++ b/TAO/CIAO/ciao/Deployment_Base.idl @@ -0,0 +1,81 @@ +//$Id$ +#include <orb.idl> +#include "tao/ULongSeq.pidl" +#include "Deployment_Core.idl" + +module Deployment { + + enum SatisfierPropertyKind { + Quantity, + Capacity, + Minimum, + Maximum, + _Attribute, + Selection + }; + + struct SatisfierProperty { + string name; + SatisfierPropertyKind kind; + any value; + }; + + typedef sequence < SatisfierProperty > SatisfierProperties; + + struct SharedResource { + string name; + ::CORBA::StringSeq resourceType; + ::CORBA::ULongSeq nodeRef; + SatisfierProperties property; + }; + + typedef sequence < SharedResource > SharedResources; + + struct Resource { + string name; + ::CORBA::StringSeq resourceType; + SatisfierProperties property; + }; + + typedef sequence < Resource > Resources; + + struct Node { + string name; + string label; + ::CORBA::ULongSeq sharedResourceRef; + ::CORBA::ULongSeq connectionRef; + Resources resource; + }; + + typedef sequence < Node > Nodes; + + struct Interconnect { + string name; + string label; + ::CORBA::ULongSeq connectionRef; + ::CORBA::ULongSeq connectRef; + Resources resource; + }; + + typedef sequence < Interconnect > Interconnects; + + struct Bridge { + string name; + string label; + ::CORBA::ULongSeq connectRef; + Resources resource; + }; + + typedef sequence < Bridge > Bridges; + + struct Domain { + string UUID; + string label; + SharedResources sharedResource; + Nodes node; + Interconnects interconnect; + Bridges bridge; + Properties infoProperty; + }; + +}; diff --git a/TAO/CIAO/ciao/Deployment_Core.idl b/TAO/CIAO/ciao/Deployment_Core.idl new file mode 100644 index 00000000000..326b594318a --- /dev/null +++ b/TAO/CIAO/ciao/Deployment_Core.idl @@ -0,0 +1,216 @@ +// $Id$ + +#if !defined (DEPLOYMENT_CORE_IDL) +#define DEPLOYMENT_CORE_IDL + +#include "CCM_Component.idl" + +// *************** Packaging and Deployment *************** +module Deployment +{ + // Typeprefix Components "omg.org"; + // OMG threw these things away, didn't it. + + exception UnknownImplId {}; + exception InvalidLocation {}; + exception InstallationFailure {/*Do we still need a reason? --Tao*/}; + exception ImplEntryPointNotFound {}; + + //Below are from the OMG Deployment.idl + + exception StartError + { + string name; + string reason; + }; + + exception StopError { + string name; + string reason; + }; + + exception InvalidConnection + { + string name; + string reason; + }; + + //==============property================== + struct Property + { + string name; + any value; + }; + + typedef sequence < Property > Properties; + + //============connection================== + + typedef sequence < Object > Endpoints; + //typedef Object Endpoint; + + enum CCMComponentPortKind + { + Facet, + SimplexReceptacle, + MultiplexReceptacle, + EventEmitter, + EventPublisher, + EventConsumer + }; + + // To avoid the connection info in the plan being passed to the + // local node and to make the implementation not very cumbersome + // I changed the connection struct to include some extra informations. + struct Connection + { + string instanceName; + string portName; + CCMComponentPortKind kind; + + // the endpoints member is change to endpoint. + // Since we will not have more than 1 objref in there. + Object endpoint; + }; + + typedef sequence < Connection > Connections; + + //======================================= + struct ComponentImplementationInfo + { + string component_instance_name; + string executor_dll; + string executor_entrypt; + string servant_dll; + string servant_entrypt; + Properties component_config; + // Properties home_config; //ignored for now. + }; + + typedef sequence <ComponentImplementationInfo> ComponentImplementationInfos; + + // ContainerImplementationInfo contains a list of components to be installed and + // policy configuration for the container which hosts these components + struct ContainerImplementationInfo + { + ComponentImplementationInfos impl_infos; + Properties container_config; + }; + + typedef sequence <ContainerImplementationInfo> NodeImplementationInfo; + + //================================== + interface Application + { + void finishLaunch (in Connections providedReference, in boolean start) + raises (StartError, InvalidConnection); + void start () + raises (StartError); + }; + + struct Component_Info + { + string component_instance_name; + Components::CCMObject component_ref; + }; + + typedef sequence < Component_Info > ComponentInfos; + + // @@ (OO) You're altering an OMG defined interface below. In + // order to avoid confusion, it is probably better to create + // another NodeApplication interface in the CIAO namespace + // that inherits from Deployment::NodeApplication. You'd + // then use the CIAO::NodeApplication in your + // implementation. + // + // Alternatively, you should at least place a CIAO-specific + // typeprefix within your altered NodeApplication interface + // to prevent interoperability issues. + + interface NodeApplication; // Forward decl. + typedef sequence<NodeApplication> NodeApplications; + + interface Container + { + readonly attribute ::Deployment::Properties properties; + + /// Get the NodeApplication which created us + NodeApplication get_node_application (); + + /// Initialize the container with properties. + long init (in ::Deployment::Properties properties); + + //@@ The properties will contain + //1 component instance name as the key. + //2 dll/so name of the exec + //3 entry point of the exec + //4 dll/so name of the svnt + //5 entry point of the svnt + //6 Poosible other configuration for container/home/component + + /// Install all homes and components + Deployment::ComponentInfos install (in ContainerImplementationInfo container_impl_info) + raises (UnknownImplId, + ImplEntryPointNotFound, + InstallationFailure, + ::Components::InvalidConfiguration); + + /// Remove all homes and components + void remove () + raises (::Components::RemoveFailure); + }; + + typedef sequence<Container> Containers; + + interface NodeApplication : Application + { + readonly attribute ::Deployment::Properties properties; + + /// @@ Initialize the nodeapplication, so it will know what + /// components it will create and home many of them are + /// there. However the real create action will take place when + /// start launch is called on NodeApplicationManager. + long init (); + + /// @@ This operation will be called by NodeApplicationManager + /// client to really start to create homes and components. + ComponentInfos install (in NodeImplementationInfo node_impl_info) + raises (UnknownImplId, + ImplEntryPointNotFound, + InstallationFailure, + ::Components::InvalidConfiguration, + ::Components::RemoveFailure); + + ///@@ We know that Dployment::NodeApplicationManager will be returned, + /// however to avoid the size of the shared object of CIAO_Server. + /// we return an Object. + Object get_node_application_manager (); + + Container create_container (in ::Deployment::Properties properties) + raises (::Components::CreateFailure, + ::Components::InvalidConfiguration); + + void remove_container (in Container cref) + raises (::Components::RemoveFailure); + + Containers get_containers (); + + /// Remove all containers, components and component homes. + /// Shuts down the ORB of the NodeApplication to terminate the process. + oneway void remove (); + + /// CIAO specific extensions. This will enforce the component to + /// be activated (preactivate, activate, postactivated) before the assembly + /// is established + void ciao_preactivate () + raises (StartError); + + void ciao_postactivate () + raises (StartError); + + void ciao_passivate () + raises (StopError); + }; + +}; +#endif /* DEPLOYMENT_CORE_IDL */ diff --git a/TAO/CIAO/ciao/Deployment_Data.idl b/TAO/CIAO/ciao/Deployment_Data.idl new file mode 100644 index 00000000000..e56e2a1bf4e --- /dev/null +++ b/TAO/CIAO/ciao/Deployment_Data.idl @@ -0,0 +1,347 @@ +// $Id$ + +#include "Deployment_Base.idl" + +module Deployment { + + struct ComponentPortDescription { + string name; + string specificType; + ::CORBA::StringSeq supportedType; + boolean provider; + boolean exclusiveProvider; + boolean exclusiveUser; + boolean optional; + CCMComponentPortKind kind; + }; + + typedef sequence < ComponentPortDescription > ComponentPortDescriptions; + + struct ComponentPropertyDescription { + string name; + CORBA::TypeCode type; + }; + + typedef sequence < ComponentPropertyDescription > ComponentPropertyDescriptions; + + struct ComponentInterfaceDescription { + string label; + string UUID; + string specificType; + ::CORBA::StringSeq supportedType; + ::CORBA::StringSeq idlFile; + Properties configProperty; + ComponentPortDescriptions port; + ComponentPropertyDescriptions property; + Properties infoProperty; + }; + + struct Requirement { + string resourceType; + string name; + Properties property; + }; + + typedef sequence < Requirement > Requirements; + + struct MonolithicDeploymentDescription { + string name; + ::CORBA::StringSeq source; + ::CORBA::ULongSeq artifactRef; + Properties execParameter; + Requirements deployRequirement; + }; + + typedef sequence < MonolithicDeploymentDescription > MonolithicDeploymentDescriptions; + + enum ResourceUsageKind { + None, + InstanceUsesResource, + ResourceUsesInstance, + PortUsesResource, + ResourceUsesPort + }; + + struct InstanceResourceDeploymentDescription { + ResourceUsageKind resourceUsage; + string requirementName; + string resourceName; + any resourceValue; + }; + + typedef sequence < InstanceResourceDeploymentDescription > InstanceResourceDeploymentDescriptions; + + struct InstanceDeploymentDescription { + string name; + string node; + ::CORBA::StringSeq source; + unsigned long implementationRef; + Properties configProperty; + InstanceResourceDeploymentDescriptions deployedResource; + InstanceResourceDeploymentDescriptions deployedSharedResource; + }; + + typedef sequence < InstanceDeploymentDescription > InstanceDeploymentDescriptions; + + struct ComponentExternalPortEndpoint { + string portName; + }; + + typedef sequence < ComponentExternalPortEndpoint > ComponentExternalPortEndpoints; + + struct PlanSubcomponentPortEndpoint { + string portName; + boolean provider; + CCMComponentPortKind kind; + unsigned long instanceRef; + }; + + typedef sequence < PlanSubcomponentPortEndpoint > PlanSubcomponentPortEndpoints; + + struct ExternalReferenceEndpoint { + string location; + }; + + typedef sequence < ExternalReferenceEndpoint > ExternalReferenceEndpoints; + + struct ConnectionResourceDeploymentDescription { + string targetName; + string requirementName; + string resourceName; + any resourceValue; + }; + + typedef sequence < ConnectionResourceDeploymentDescription > ConnectionResourceDeploymentDescriptions; + + struct PlanConnectionDescription { + string name; + ::CORBA::StringSeq source; + Requirements deployRequirement; + ComponentExternalPortEndpoints externalEndpoint; + PlanSubcomponentPortEndpoints internalEndpoint; + ExternalReferenceEndpoints externalReference; + ConnectionResourceDeploymentDescriptions deployedResource; + }; + + typedef sequence < PlanConnectionDescription > PlanConnectionDescriptions; + + struct PlanSubcomponentPropertyReference { + string propertyName; + unsigned long instanceRef; + }; + + typedef sequence < PlanSubcomponentPropertyReference > PlanSubcomponentPropertyReferences; + + struct PlanPropertyMapping { + string name; + ::CORBA::StringSeq source; + string externalName; + PlanSubcomponentPropertyReferences delegatesTo; + }; + + typedef sequence < PlanPropertyMapping > PlanPropertyMappings; + + struct ImplementationDependency { + string requiredType; + }; + + typedef sequence < ImplementationDependency > ImplementationDependencies; + + struct ResourceDeploymentDescription { + string requirementName; + string resourceName; + any resourceValue; + }; + + typedef sequence < ResourceDeploymentDescription > ResourceDeploymentDescriptions; + + struct ArtifactDeploymentDescription { + string name; + ::CORBA::StringSeq location; + string node; + ::CORBA::StringSeq source; + Properties execParameter; + Requirements deployRequirement; + ResourceDeploymentDescriptions deployedResource; + }; + + typedef sequence < ArtifactDeploymentDescription > ArtifactDeploymentDescriptions; + + struct DeploymentPlan { + string label; + string UUID; + ComponentInterfaceDescription realizes; + MonolithicDeploymentDescriptions implementation; + InstanceDeploymentDescriptions instance; + PlanConnectionDescriptions connection; + PlanPropertyMappings externalProperty; + ImplementationDependencies dependsOn; + ArtifactDeploymentDescriptions artifact; + Properties infoProperty; + }; + + enum DomainUpdateKind { + Add, + Delete, + UpdateAll, + UpdateAvailable + }; + + struct PackageConfiguration; + + typedef sequence < PackageConfiguration > PackageConfigurations; + + struct ComponentPackageDescription; + + typedef sequence < ComponentPackageDescription > ComponentPackageDescriptions; + + struct ComponentPackageReference { + string requiredUUID; + string requiredName; + string requiredType; + }; + + typedef sequence < ComponentPackageReference > ComponentPackageReferences; + + struct SubcomponentInstantiationDescription { + string name; + ComponentPackageDescriptions package; + Properties configProperty; + Requirements selectRequirement; + ComponentPackageReferences reference; + }; + + typedef sequence < SubcomponentInstantiationDescription > SubcomponentInstantiationDescriptions; + + struct SubcomponentPortEndpoint { + string portName; + unsigned long instanceRef; + }; + + typedef sequence < SubcomponentPortEndpoint > SubcomponentPortEndpoints; + + struct AssemblyConnectionDescription { + string name; + Requirements deployRequirement; + ComponentExternalPortEndpoints externalEndpoint; + SubcomponentPortEndpoints internalEndpoint; + ExternalReferenceEndpoints externalReference; + }; + + typedef sequence < AssemblyConnectionDescription > AssemblyConnectionDescriptions; + + struct SubcomponentPropertyReference { + string propertyName; + unsigned long instanceRef; + }; + + typedef sequence < SubcomponentPropertyReference > SubcomponentPropertyReferences; + + struct AssemblyPropertyMapping { + string name; + string externalName; + SubcomponentPropertyReferences delegatesTo; + }; + + typedef sequence < AssemblyPropertyMapping > AssemblyPropertyMappings; + + struct ComponentAssemblyDescription { + SubcomponentInstantiationDescriptions instance; + AssemblyConnectionDescriptions connection; + AssemblyPropertyMappings externalProperty; + }; + + typedef sequence < ComponentAssemblyDescription > ComponentAssemblyDescriptions; + + struct NamedImplementationArtifact; + + typedef sequence < NamedImplementationArtifact > NamedImplementationArtifacts; + + struct ImplementationArtifactDescription { + string label; + string UUID; + ::CORBA::StringSeq location; + Properties execParameter; + Requirements deployRequirement; + NamedImplementationArtifacts dependsOn; + Properties infoProperty; + }; + + struct NamedImplementationArtifact { + string name; + ImplementationArtifactDescription referencedArtifact; + }; + + typedef sequence < ResourceUsageKind > ResourceUsageKinds; + + struct ImplementationRequirement { + ResourceUsageKinds resourceUsage; + string resourcePort; + string componentPort; + string resourceType; + string name; + Properties property; + }; + + typedef sequence < ImplementationRequirement > ImplementationRequirements; + + struct MonolithicImplementationDescription { + Properties execParameter; + NamedImplementationArtifacts primaryArtifact; + ImplementationRequirements deployRequirement; + }; + + typedef sequence < MonolithicImplementationDescription > MonolithicImplementationDescriptions; + + struct Capability { + string name; + ::CORBA::StringSeq resourceType; + SatisfierProperties property; + }; + + typedef sequence < Capability > Capabilities; + + struct ComponentImplementationDescription { + string label; + string UUID; + ComponentInterfaceDescription implements; + ComponentAssemblyDescriptions assemblyImpl; + MonolithicImplementationDescriptions monolithicImpl; + Properties configProperty; + Capabilities capability; + ImplementationDependencies dependsOn; + Properties infoProperty; + }; + + struct PackagedComponentImplementation { + string name; + ComponentImplementationDescription referencedImplementation; + }; + + typedef sequence < PackagedComponentImplementation > PackagedComponentImplementations; + + struct ComponentPackageDescription { + string label; + string UUID; + ComponentInterfaceDescription realizes; + Properties configProperty; + PackagedComponentImplementations implementation; + Properties infoProperty; + }; + + struct PackageConfiguration { + string label; + string UUID; + PackageConfigurations specializedConfig; + ComponentPackageDescriptions basePackage; + ComponentPackageReferences reference; + Requirements selectRequirement; + Properties configProperty; + }; + + struct RequirementSatisfier { + string name; + ::CORBA::StringSeq resourceType; + SatisfierProperties property; + }; +}; diff --git a/TAO/CIAO/ciao/Deployment_stub_export.h b/TAO/CIAO/ciao/Deployment_stub_export.h new file mode 100644 index 00000000000..12985a68b5b --- /dev/null +++ b/TAO/CIAO/ciao/Deployment_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s Deployment_stub +// ------------------------------ +#ifndef DEPLOYMENT_STUB_EXPORT_H +#define DEPLOYMENT_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DEPLOYMENT_STUB_HAS_DLL) +# define DEPLOYMENT_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DEPLOYMENT_STUB_HAS_DLL */ + +#if !defined (DEPLOYMENT_STUB_HAS_DLL) +# define DEPLOYMENT_STUB_HAS_DLL 1 +#endif /* ! DEPLOYMENT_STUB_HAS_DLL */ + +#if defined (DEPLOYMENT_STUB_HAS_DLL) && (DEPLOYMENT_STUB_HAS_DLL == 1) +# if defined (DEPLOYMENT_STUB_BUILD_DLL) +# define Deployment_stub_Export ACE_Proper_Export_Flag +# define DEPLOYMENT_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DEPLOYMENT_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DEPLOYMENT_STUB_BUILD_DLL */ +# define Deployment_stub_Export ACE_Proper_Import_Flag +# define DEPLOYMENT_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DEPLOYMENT_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DEPLOYMENT_STUB_BUILD_DLL */ +#else /* DEPLOYMENT_STUB_HAS_DLL == 1 */ +# define Deployment_stub_Export +# define DEPLOYMENT_STUB_SINGLETON_DECLARATION(T) +# define DEPLOYMENT_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DEPLOYMENT_STUB_HAS_DLL == 1 */ + +// Set DEPLOYMENT_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DEPLOYMENT_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define DEPLOYMENT_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DEPLOYMENT_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DEPLOYMENT_STUB_NTRACE */ + +#if (DEPLOYMENT_STUB_NTRACE == 1) +# define DEPLOYMENT_STUB_TRACE(X) +#else /* (DEPLOYMENT_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DEPLOYMENT_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DEPLOYMENT_STUB_NTRACE == 1) */ + +#endif /* DEPLOYMENT_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/ciao/Deployment_svnt_export.h b/TAO/CIAO/ciao/Deployment_svnt_export.h new file mode 100644 index 00000000000..e403dbf0c41 --- /dev/null +++ b/TAO/CIAO/ciao/Deployment_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s Deployment_svnt +// ------------------------------ +#ifndef DEPLOYMENT_SVNT_EXPORT_H +#define DEPLOYMENT_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DEPLOYMENT_SVNT_HAS_DLL) +# define DEPLOYMENT_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DEPLOYMENT_SVNT_HAS_DLL */ + +#if !defined (DEPLOYMENT_SVNT_HAS_DLL) +# define DEPLOYMENT_SVNT_HAS_DLL 1 +#endif /* ! DEPLOYMENT_SVNT_HAS_DLL */ + +#if defined (DEPLOYMENT_SVNT_HAS_DLL) && (DEPLOYMENT_SVNT_HAS_DLL == 1) +# if defined (DEPLOYMENT_SVNT_BUILD_DLL) +# define Deployment_svnt_Export ACE_Proper_Export_Flag +# define DEPLOYMENT_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DEPLOYMENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DEPLOYMENT_SVNT_BUILD_DLL */ +# define Deployment_svnt_Export ACE_Proper_Import_Flag +# define DEPLOYMENT_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DEPLOYMENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DEPLOYMENT_SVNT_BUILD_DLL */ +#else /* DEPLOYMENT_SVNT_HAS_DLL == 1 */ +# define Deployment_svnt_Export +# define DEPLOYMENT_SVNT_SINGLETON_DECLARATION(T) +# define DEPLOYMENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DEPLOYMENT_SVNT_HAS_DLL == 1 */ + +// Set DEPLOYMENT_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DEPLOYMENT_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define DEPLOYMENT_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DEPLOYMENT_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DEPLOYMENT_SVNT_NTRACE */ + +#if (DEPLOYMENT_SVNT_NTRACE == 1) +# define DEPLOYMENT_SVNT_TRACE(X) +#else /* (DEPLOYMENT_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DEPLOYMENT_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DEPLOYMENT_SVNT_NTRACE == 1) */ + +#endif /* DEPLOYMENT_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/ciao/Dynamic_Component_Activator.cpp b/TAO/CIAO/ciao/Dynamic_Component_Activator.cpp new file mode 100644 index 00000000000..3cd903e7d9d --- /dev/null +++ b/TAO/CIAO/ciao/Dynamic_Component_Activator.cpp @@ -0,0 +1,71 @@ +#include "Dynamic_Component_Activator.h" +#include "CIAO_common.h" +#include "ace/Log_Msg.h" +#include "ace/OS_NS_string.h" + +ACE_RCSID (ciao, + Dynamic_Component_Activator, + "$Id$") + +namespace CIAO +{ + Dynamic_Component_Activator::Dynamic_Component_Activator (CORBA::ORB_ptr o) + : orb_ (CORBA::ORB::_duplicate (o)) + { + } + + Dynamic_Component_Activator::~Dynamic_Component_Activator (void) + { + } + + PortableServer::Servant + Dynamic_Component_Activator::incarnate (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::ForwardRequest)) + { + // @@Jai, where i sth emutex used at all? + Dynamic_Component_Servant_Base* servant = 0; + PortableServer::ObjectId new_oid (oid); + + if (this->servant_map_.find (oid, servant) == 0) + { + return servant->create (new_oid); + } + + return 0; + } + + void + Dynamic_Component_Activator::etherealize ( + const PortableServer::ObjectId &, + PortableServer::POA_ptr , + PortableServer::Servant , + CORBA::Boolean , + CORBA::Boolean + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + } + + void Dynamic_Component_Activator::add_servant_map + (PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant) + { + this->servant_map_.bind (oid, servant); + } + + void Dynamic_Component_Activator::delete_servant_map + (PortableServer::ObjectId &oid) + { + Dynamic_Component_Servant_Base* servant = 0; + if (this->servant_map_.unbind (oid, servant) != 0) + { + ACE_DEBUG ((LM_DEBUG, "Invalid object reference\n")); + return; + } + + return; + } +} diff --git a/TAO/CIAO/ciao/Servant_Activator.h b/TAO/CIAO/ciao/Dynamic_Component_Activator.h index 27ed074b1b7..1e9a023f38c 100644 --- a/TAO/CIAO/ciao/Servant_Activator.h +++ b/TAO/CIAO/ciao/Dynamic_Component_Activator.h @@ -2,29 +2,35 @@ //============================================================================= /** - * @file Servant_Activator.h + * @file Dynamic_Component_Activator.h * * $Id$ * - * @authors Balachandran Natarajan <bala@dre.vanderbilt.edu> + * @authors Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu> + * Balachandran Natarajan <bala@dre.vanderbilt.edu> */ //============================================================================= -#ifndef CIAO_SERVANT_ACTIVATOR_H -#define CIAO_SERVANT_ACTIVATOR_H +#ifndef CIAO_DYNAMIC_SWAPPING_ACTIVATOR_H +#define CIAO_DYNAMIC_SWAPPING_ACTIVATOR_H #include /**/ "ace/pre.h" #include "ace/Array_Base.h" #include "ciao/CIAO_Server_Export.h" +#include "ciao/CCM_ContainerC.h" +#include "ciao/Deployment_CoreC.h" + +#include "tao/PortableServer/Key_Adapters.h" +#include "ace/Hash_Map_Manager_T.h" +#include "Dynamic_Component_Servant_Base.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/PortableServer/PortableServer.h" -#include "tao/PortableServer/ServantActivatorC.h" -#include "tao/PortableServer/ForwardRequestC.h" #include "tao/LocalObject.h" +#include "tao/PortableServer/ServantActivatorC.h" #if defined(_MSC_VER) #pragma warning(push) @@ -33,29 +39,23 @@ namespace CIAO { - class Port_Activator; + class Dynamic_Component_Servant_Base; /** - * @class Servant_Activator + * @class Dynamic_Component_Activator * * @brief Activator that is registered with the POA for facet and * consumer servants. * - * This class acts like a factory in some sense. This factory is - * registered with the POA with RETAIN policy. When the factory gets - * a call back as part of the upcall, this factory looks at the - * list of port activators registered, uses the OID to pick the - * right one (yes a linear algorithm is used), calls activate () on - * it which returns the servant for *that* port. */ - class CIAO_SERVER_Export Servant_Activator + class CIAO_SERVER_Export Dynamic_Component_Activator : public virtual PortableServer::ServantActivator , public virtual TAO_Local_RefCounted_Object { public: - Servant_Activator (CORBA::ORB_ptr o); + Dynamic_Component_Activator (CORBA::ORB_ptr o); - virtual ~Servant_Activator (void); + virtual ~Dynamic_Component_Activator (void); /// Template methods overridden to get callbacks. /** @@ -78,25 +78,27 @@ namespace CIAO ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - /// Local helper methods - bool register_port_activator (Port_Activator *pa); + void add_servant_map (PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant); + + void delete_servant_map (PortableServer::ObjectId &oid); private: /// Pointer to our ORB CORBA::ORB_var orb_; - /// @@ This should be changed at some point of time so that we - /// don't land up with a linear algorithm - typedef ACE_Array_Base<Port_Activator *> Port_Activators; - - /// Array of port activators - Port_Activators pa_; - - /// Running index of the slot that has been just filled in. - size_t slot_index_; - + // @@ Jai, why are there two mutexes here?Can you get one of them + //out of the way? /// Mutex that synchronizes access to the array. ACE_SYNCH_MUTEX mutex_; + + ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, + Dynamic_Component_Servant_Base *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + ACE_SYNCH_MUTEX> + servant_map_; + }; } @@ -105,4 +107,4 @@ namespace CIAO #endif /* _MSC_VER */ #include /**/ "ace/post.h" -#endif /*CIAO_SERVANT_ACTIVATOR_H*/ +#endif /*CIAO_DYNAMIC_SWAPPING_ACTIVATOR_H*/ diff --git a/TAO/CIAO/ciao/Dynamic_Component_Servant_Base.cpp b/TAO/CIAO/ciao/Dynamic_Component_Servant_Base.cpp new file mode 100644 index 00000000000..e7a0daceadd --- /dev/null +++ b/TAO/CIAO/ciao/Dynamic_Component_Servant_Base.cpp @@ -0,0 +1,26 @@ +#include "Dynamic_Component_Servant_Base.h" +#include "CIAO_common.h" +#include "ace/Log_Msg.h" +#include "ace/OS_NS_string.h" + +ACE_RCSID (ciao, + Dynamic_Component_Servant_Base, + "$Id$") + +namespace CIAO +{ + Dynamic_Component_Servant_Base::Dynamic_Component_Servant_Base (void) + { + ACE_ASSERT (0); + } + + Dynamic_Component_Servant_Base::Dynamic_Component_Servant_Base + (Session_Container * c) + : container_ (c) + { + } + + Dynamic_Component_Servant_Base::~Dynamic_Component_Servant_Base (void) + { + } +} diff --git a/TAO/CIAO/ciao/Dynamic_Component_Servant_Base.h b/TAO/CIAO/ciao/Dynamic_Component_Servant_Base.h new file mode 100644 index 00000000000..db1a89fd6f6 --- /dev/null +++ b/TAO/CIAO/ciao/Dynamic_Component_Servant_Base.h @@ -0,0 +1,56 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Dynamic_Component_Servant_Base.h + * + * $Id$ + * + */ +//============================================================================= + + +#ifndef CIAO_DYNAMIC_COMPONENT_SERVANT_BASE_H +#define CIAO_DYNAMIC_COMPONENT_SERVANT_BASE_H + +#include /**/ "ace/pre.h" + +// @@ Jai, why is this includion necessary. Looks heavy weight to me. +#include "CCM_ComponentS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/PortableServer.h" +#include "CIAO_Server_Export.h" + +namespace CIAO +{ + class Session_Container; + class CIAO_SERVER_Export Dynamic_Component_Servant_Base + { + public: + explicit Dynamic_Component_Servant_Base (void); + + Dynamic_Component_Servant_Base (Session_Container *c); + + virtual ~Dynamic_Component_Servant_Base (void); + + virtual PortableServer::Servant + create (PortableServer::ObjectId &oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0; + + virtual void destroy (PortableServer::ObjectId &oid) = 0; + + virtual void update_destroy_count () = 0; + + protected: + Session_Container *container_; + }; + +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_DYNAMIC_COMPONENT_SERVANT_BASE_H */ diff --git a/TAO/CIAO/ciao/Dynamic_Component_Servant_T.cpp b/TAO/CIAO/ciao/Dynamic_Component_Servant_T.cpp new file mode 100644 index 00000000000..f4e2263cbd6 --- /dev/null +++ b/TAO/CIAO/ciao/Dynamic_Component_Servant_T.cpp @@ -0,0 +1,124 @@ +// $Id$ + +#ifndef CIAO_DYNAMIC_COMPONENT_SERVANT_T_C +#define CIAO_DYNAMIC_COMPONENT_SERVANT_T_C + +#include "Dynamic_Component_Servant_T.h" + +namespace CIAO +{ + template <typename COMP_SVNT, + typename COMP_EXEC, + typename COMP_EXEC_VAR, + typename EXEC, + typename EXEC_VAR, + typename COMP> + Dynamic_Component_Servant<COMP_SVNT, COMP_EXEC, COMP_EXEC_VAR, + EXEC, EXEC_VAR, COMP> + ::Dynamic_Component_Servant + (Components::EnterpriseComponent_ptr ec, + Components::CCMHome_ptr home, + const char* ins_name, + Home_Servant_Impl_Base *home_servant, + Session_Container *c) + : Dynamic_Component_Servant_Base (c) + , executor_ (Components::EnterpriseComponent::_duplicate (ec)) + , ins_name_ (ins_name) + , home_servant_ (home_servant) + , home_ (Components::CCMHome::_duplicate (home)) + , component_removed_ (false) + { + } + + template <typename COMP_SVNT, + typename COMP_EXEC, + typename COMP_EXEC_VAR, + typename EXEC, + typename EXEC_VAR, + typename COMP> + void Dynamic_Component_Servant<COMP_SVNT, COMP_EXEC, COMP_EXEC_VAR, + EXEC, EXEC_VAR, COMP>::update_destroy_count () + { + component_removed_ = true; + } + + template <typename COMP_SVNT, + typename COMP_EXEC, + typename COMP_EXEC_VAR, + typename EXEC, + typename EXEC_VAR, + typename COMP> + Dynamic_Component_Servant<COMP_SVNT, COMP_EXEC, COMP_EXEC_VAR, + EXEC, EXEC_VAR, COMP>::~Dynamic_Component_Servant (void) + { + } + + template <typename COMP_SVNT, + typename COMP_EXEC, + typename COMP_EXEC_VAR, + typename EXEC, + typename EXEC_VAR, + typename COMP> + void Dynamic_Component_Servant + <COMP_SVNT, COMP_EXEC, COMP_EXEC_VAR, + EXEC, EXEC_VAR, COMP>::destroy (PortableServer::ObjectId &oid) + { + // @@Jai, here is a logical problem. You find a servant from a map + // having a list of servants and you turn on a bit. What is the + // granularity of the bit? Looks like its too coarse. Do you see + // what I am saying? + COMP_SVNT *servant = 0; + if (this->servant_map_.find (oid, servant) == 0) + { + servant->remove (); + component_removed_ = true; + } + } + + template <typename COMP_SVNT, + typename COMP_EXEC, + typename COMP_EXEC_VAR, + typename EXEC, + typename EXEC_VAR, + typename COMP> + PortableServer::Servant Dynamic_Component_Servant + <COMP_SVNT, COMP_EXEC, COMP_EXEC_VAR, + EXEC, EXEC_VAR, COMP>::create (PortableServer::ObjectId &oid + ACE_ENV_ARG_DECL) + { + CIAO::Swap_Exec_var swap_exec = + CIAO::Swap_Exec::_narrow (this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::EnterpriseComponent_var ciao_ec = + swap_exec->incarnate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + COMP_EXEC_VAR ciao_comp = + COMP_EXEC::_narrow (ciao_ec.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + /// @@ Jai, should you be using ACE_NEW_THROW_EX here? + COMP_SVNT *svt = new COMP_SVNT(ciao_comp.in (), this->home_.in (), + this->ins_name_.in (), + this->home_servant_, + this->container_); + + // @@Jai, see the problem with a coarse grained stuff here. + if (component_removed_ == true) + { + // svt->ciao_preactivate (); + // svt->ciao_activate (); + // svt->ciao_postactivate (); + component_removed_ = false; + } + + PortableServer::ServantBase_var safe (svt); + this->servant_map_.bind (oid, svt); + return safe._retn (); + } +} + +#endif /* CIAO_DYNAMIC_COMPONENT_SERVANT_T_C */ diff --git a/TAO/CIAO/ciao/Dynamic_Component_Servant_T.h b/TAO/CIAO/ciao/Dynamic_Component_Servant_T.h new file mode 100644 index 00000000000..bfefd7ccd41 --- /dev/null +++ b/TAO/CIAO/ciao/Dynamic_Component_Servant_T.h @@ -0,0 +1,89 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Dynamic_Component_Servant_T.h + * + * $Id$ + * + * This file contains the declaration of a mixin base class for + * the generated home servant class. + * + */ +//============================================================================= + + +#ifndef CIAO_DYNAMIC_COMPONENT_SERVANT_T_H +#define CIAO_DYNAMIC_COMPONENT_SERVANT_T_H + +#include /**/ "ace/pre.h" + +#include "Dynamic_Component_Servant_Base.h" +#include "SwapExecC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/Key_Adapters.h" +#include "ace/Hash_Map_Manager_T.h" + +namespace CIAO +{ + template <typename COMP_SVNT, typename COMP_EXEC, + typename COMP_EXEC_VAR, typename EXEC, typename EXEC_VAR, + typename COMP> + class Dynamic_Component_Servant + : public virtual Dynamic_Component_Servant_Base + { + public: + // @@Jai, please add documentation for these methods. + Dynamic_Component_Servant (Components::EnterpriseComponent_ptr ec, + Components::CCMHome_ptr home, + const char* ins_name, + Home_Servant_Impl_Base *home_servant, + Session_Container *c); + + virtual ~Dynamic_Component_Servant (void); + + virtual PortableServer::Servant + create (PortableServer::ObjectId &oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + virtual void destroy (PortableServer::ObjectId &oid); + + virtual void update_destroy_count (void); + + protected: + Components::EnterpriseComponent_var executor_; + + CORBA::String_var ins_name_; + + Home_Servant_Impl_Base *home_servant_; + + Components::CCMHome_var home_; + + // @@ Jai, please document why this is there. + ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, + COMP_SVNT *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + ACE_SYNCH_MUTEX> + servant_map_; + + // @@ Jai, please explain what this flag means? + bool component_removed_; + }; +} + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Dynamic_Component_Servant_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Dynamic_Component_Servant_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_DYNAMIC_COMPONENT_SERVANT_T_H */ diff --git a/TAO/CIAO/ciao/HomeRegistrar.idl b/TAO/CIAO/ciao/HomeRegistrar.idl deleted file mode 100644 index 42176c1d571..00000000000 --- a/TAO/CIAO/ciao/HomeRegistrar.idl +++ /dev/null @@ -1,38 +0,0 @@ -// $Id$ - -/** - * @file HomeRegistrar.idl - * - * This file define the interface supported by CIAO's HomeFinder - * service. It is basically an extension of Components::HomeFinder - * interface by supporting CIAO specific home - */ - -#include "CCM_Component.idl" - -module CIAO -{ - exception AlreadyBound - { - // Equivalent to CosNaming::NamingContext::AlreadyBound exception. - }; - - exception InvalidName - { - // Equivalent to CosNaming::NamingContext::InvalidName exception. - }; - - exception HomeRegisterFailure - { - // Equivalent to CosNaming::NamingContext::InvalidName exception. - }; - - interface HomeRegistrar : Components::HomeFinder - { - void register_home (in CORBA::RepositoryId home_repo_id, - in CORBA::RepositoryId comp_repo_id, - in string home_name, - in Object objref) - raises (AlreadyBound, InvalidName, HomeRegisterFailure); - }; -}; diff --git a/TAO/CIAO/ciao/HomeRegistrar_i.cpp b/TAO/CIAO/ciao/HomeRegistrar_i.cpp deleted file mode 100644 index 5fb7b3f0a0c..00000000000 --- a/TAO/CIAO/ciao/HomeRegistrar_i.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// $Id$ - -#include "HomeRegistrar_i.h" - -#if !defined (__ACE_INLINE__) -#include "HomeRegistrar_i.inl" -#endif /* !defined INLINE */ - -CIAO::HomeRegistrar_Impl::HomeRegistrar_Impl (CosNaming::NamingContext_ptr ns) - : ns_ (CosNaming::NamingContext::_duplicate (ns)) -{ -} - -CIAO::HomeRegistrar_Impl::~HomeRegistrar_Impl () -{ -} - -::Components::CCMHome_ptr -CIAO::HomeRegistrar_Impl::find_home_impl (const char *name - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::HomeNotFound)) -{ - Components::CCMHome_var ahome; - - ACE_TRY - { - CosNaming::Name aname; - aname.length (1); - aname[0].id = CORBA::string_dup (name); - - CORBA::Object_var obj = this->ns_->resolve (aname - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ahome = Components::CCMHome::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_TRY_THROW (Components::HomeNotFound ()); - } - ACE_ENDTRY; - ACE_CHECK_RETURN (0); - - if (CORBA::is_nil (ahome.in ())) - ACE_THROW_RETURN (Components::HomeNotFound (), 0); - return ahome._retn (); -} - -void -CIAO::HomeRegistrar_Impl::register_home (const char * home_repo_id, - const char * comp_repo_id, - const char * home_name, - CORBA::Object_ptr objref - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - CIAO::AlreadyBound, - CIAO::InvalidName, - CIAO::HomeRegisterFailure)) -{ - if (CORBA::is_nil (objref)) - ACE_THROW (CORBA::BAD_PARAM ()); - - ACE_TRY - { - CosNaming::Name aname; - aname.length (1); - aname[0].id = CORBA::string_dup (home_repo_id); - - this->ns_->bind (aname, objref ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - aname[0].id = CORBA::string_dup (comp_repo_id); - - this->ns_->bind (aname, objref ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - aname[0].id = CORBA::string_dup (home_name); - - this->ns_->bind (aname, objref ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex) - { - ACE_TRY_THROW (CIAO::AlreadyBound ()); - } - ACE_CATCH (CosNaming::NamingContext::InvalidName, ex) - { - ACE_TRY_THROW (CIAO::InvalidName ()); - } - ACE_CATCHANY - { - ACE_TRY_THROW (CIAO::HomeRegisterFailure ()); - } - ACE_ENDTRY; -} diff --git a/TAO/CIAO/ciao/HomeRegistrar_i.h b/TAO/CIAO/ciao/HomeRegistrar_i.h deleted file mode 100644 index 00602f9f474..00000000000 --- a/TAO/CIAO/ciao/HomeRegistrar_i.h +++ /dev/null @@ -1,81 +0,0 @@ -// $Id$ - -/** - * @file HomeRegistrar_i.h - * - * A CIAO HomeFinder implementation that also support CIAO's home - * registration operation. - * - * @sa HomeRegistrar.idl - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef CIAO_HOMEREGISTRAR_I_H -#define CIAO_HOMEREGISTRAR_I_H -#include /**/ "ace/pre.h" - -#include "HomeRegistrarS.h" -#include <CosNamingC.h> - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace CIAO -{ - class CIAO_SERVER_Export HomeRegistrar_Impl - : public virtual POA_CIAO::HomeRegistrar - { - public: - /** - * @brief We require a NamingContext to hold the names. - */ - HomeRegistrar_Impl (CosNaming::NamingContext_ptr ns); - - /** - * @brief Default destructor. - */ - ~HomeRegistrar_Impl (); - - virtual ::Components::CCMHome_ptr find_home_by_component_type (const char * comp_repid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::HomeNotFound)); - - virtual ::Components::CCMHome_ptr find_home_by_home_type (const char * home_repid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::HomeNotFound)); - - virtual ::Components::CCMHome_ptr find_home_by_name (const char * home_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::HomeNotFound)); - - virtual void register_home (const char * home_repo_id, - const char * comp_repo_id, - const char * home_name, - CORBA::Object_ptr objref - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - CIAO::AlreadyBound, - CIAO::InvalidName, - CIAO::HomeRegisterFailure)); - - Components::CCMHome_ptr find_home_impl (const char *name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::HomeNotFound)); - - protected: - CosNaming::NamingContext_var ns_; - }; -} - -#if defined (__ACE_INLINE__) -#include "HomeRegistrar_i.inl" -#endif /* !defined INLINE */ - -#include /**/ "ace/post.h" -#endif /* CIAO_HOMEREGISTRAR_I_H */ diff --git a/TAO/CIAO/ciao/HomeRegistrar_i.inl b/TAO/CIAO/ciao/HomeRegistrar_i.inl deleted file mode 100644 index 94b373d29e9..00000000000 --- a/TAO/CIAO/ciao/HomeRegistrar_i.inl +++ /dev/null @@ -1,31 +0,0 @@ -// $Id$ - -::Components::CCMHome_ptr -CIAO::HomeRegistrar_Impl::find_home_by_component_type (const char * comp_repid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::HomeNotFound)) -{ - return this->find_home_impl (comp_repid - ACE_ENV_ARG_PARAMETER); -} - -::Components::CCMHome_ptr -CIAO::HomeRegistrar_Impl::find_home_by_home_type (const char * home_repid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::HomeNotFound)) -{ - return this->find_home_impl (home_repid - ACE_ENV_ARG_PARAMETER); -} - -::Components::CCMHome_ptr -CIAO::HomeRegistrar_Impl::find_home_by_name (const char * home_name - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::HomeNotFound)) -{ - return this->find_home_impl (home_name - ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/CIAO/ciao/NodeApp_CB_Impl.cpp b/TAO/CIAO/ciao/NodeApp_CB_Impl.cpp new file mode 100644 index 00000000000..24578aa664c --- /dev/null +++ b/TAO/CIAO/ciao/NodeApp_CB_Impl.cpp @@ -0,0 +1,70 @@ +// $Id$ +#include "NodeApp_CB_Impl.h" + +CIAO::NodeApplication_Callback_Impl:: +NodeApplication_Callback_Impl (CORBA::ORB_ptr o, + PortableServer::POA_ptr p, + Deployment::NodeApplicationManager_ptr s, + const Deployment::Properties &properties) + ACE_THROW_SPEC ((CORBA::SystemException)) + : orb_ (CORBA::ORB::_duplicate (o)), + poa_ (PortableServer::POA::_duplicate (p)), + nam_ (Deployment::NodeApplicationManager::_duplicate (s)) +{ + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + //@@ Note: this properties is useless unless + // we have some specific properties for the callback obj. + Deployment::Properties * tmp = 0; + ACE_NEW_THROW_EX (tmp, + Deployment::Properties (properties), + CORBA::NO_MEMORY ()); + ACE_TRY_CHECK; + this->properties_ = tmp; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "NodeApp_CB_Impl::Constructor\t\n"); + ACE_RE_THROW; + } + ACE_ENDTRY; + ACE_CHECK; +} + +CIAO::NodeApplication_Callback_Impl::~NodeApplication_Callback_Impl () +{ +} + +PortableServer::POA_ptr +CIAO::NodeApplication_Callback_Impl::_default_POA (void) +{ + return PortableServer::POA::_duplicate (this->poa_.in ()); +} + +Deployment::NodeApplicationManager_ptr +CIAO::NodeApplication_Callback_Impl::register_node_application ( + Deployment::NodeApplication_ptr na, + Deployment::Properties_out properties + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + properties = this->properties_._retn (); + + this->nodeapp_ = Deployment::NodeApplication::_duplicate (na); + return Deployment::NodeApplicationManager::_duplicate (this->nam_.in ()); +} + +Deployment::NodeApplication_ptr +CIAO::NodeApplication_Callback_Impl::get_nodeapp_ref (void) +{ + // @@ (OO) How are you relinquishing ownership here? Since you're + // duplicating the reference you actually maintain + // ownership. Is the below comment wrong, or is the code + // wrong? + + // Relinquish the ownership of the nodeapplication reference. + //This method should only be called from the NodeApplicationManager. + return Deployment::NodeApplication::_duplicate (this->nodeapp_.in ()); +} diff --git a/TAO/CIAO/ciao/NodeApp_CB_Impl.h b/TAO/CIAO/ciao/NodeApp_CB_Impl.h new file mode 100644 index 00000000000..e14899f38ff --- /dev/null +++ b/TAO/CIAO/ciao/NodeApp_CB_Impl.h @@ -0,0 +1,87 @@ +// -*- C++ -*- +// $Id$ +//============================================================================= +/** + * @file NodeApp_CB_Impl.h + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + * Tao Lu <lu@dre.vanderbilt.edu> + * + //===========================================================================*/ + + +#ifndef NODEAPPLICATION_CALLBACK_IMPL_H +#define NODEAPPLICATION_CALLBACK_IMPL_H +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "NodeApplication_CallBackS.h" + +namespace CIAO +{ + // Forward declaration. + // class NodeApplicationManager; + + /** + * @class NodeApplication_Callback_Impl + * + * @brief A call back interface for NodeApplication + * @Note Here is no need to be thread safe since for every nodeapplication + * we will have an unique callback object. --Tao + */ + class Deployment_svnt_Export NodeApplication_Callback_Impl + : public virtual POA_CIAO::NodeApplication_Callback + { + public: + friend class NodeApplicationManager_Impl; + + /// Constructor. + NodeApplication_Callback_Impl (CORBA::ORB_ptr o, + PortableServer::POA_ptr p, + Deployment::NodeApplicationManager_ptr s, + const Deployment::Properties &properties) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // @@ (OO) Since this class is reference counted, please make this + // destructor protected to enforce proper memory managment + // through the reference counting mechanism (i.e. to + // disallow calling operator delete() on an instance of + // this class. + /// Destructor. + ~NodeApplication_Callback_Impl (); + + /// Get the containing POA. This operation does *not* increase + /// the reference count of the POA. + virtual PortableServer::POA_ptr _default_POA (void); + + /// Record the NodeApplication reference returned by the newly + /// spawned NodeApplication and give it back a reference to + /// NodeApplicationManager + Deployment::NodeApplicationManager_ptr + register_node_application (Deployment::NodeApplication_ptr na, + Deployment::Properties_out properties + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + Deployment::NodeApplication_ptr get_nodeapp_ref (void); + + CORBA::ORB_var orb_; + + PortableServer::POA_var poa_; + + Deployment::NodeApplicationManager_var nam_; + + Deployment::NodeApplication_var nodeapp_; + + Deployment::Properties_var properties_; + }; +} + +#include /**/ "ace/post.h" +#endif /* NODEAPPLICATION_CALLBACK_IMPL_H */ diff --git a/TAO/CIAO/ciao/NodeApplication_CallBack.idl b/TAO/CIAO/ciao/NodeApplication_CallBack.idl new file mode 100644 index 00000000000..9c4f1d14775 --- /dev/null +++ b/TAO/CIAO/ciao/NodeApplication_CallBack.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * This IDL file is used to combine the NodeApplication + * interface with the NodeApplicationManager interface. + * + * NodeApplicationManager will be spwan NodeApplication. + * The call back object will be used to get the objectref of + * NodeApplication. + */ + +#include "Deployment.idl" + +module CIAO +{ + interface NodeApplication_Callback + { + Deployment::NodeApplicationManager + register_node_application (in Deployment::NodeApplication na, + out Deployment::Properties properties); + }; +}; diff --git a/TAO/CIAO/ciao/NodeApplication_Impl.cpp b/TAO/CIAO/ciao/NodeApplication_Impl.cpp new file mode 100644 index 00000000000..63078657f51 --- /dev/null +++ b/TAO/CIAO/ciao/NodeApplication_Impl.cpp @@ -0,0 +1,395 @@ +//$Id$ + +#include "NodeApplication_Impl.h" +#include "ace/SString.h" +#include "Container_Impl.h" + +#if !defined (__ACE_INLINE__) +# include "NodeApplication_Impl.inl" +#endif /* __ACE_INLINE__ */ + +CIAO::NodeApplication_Impl::~NodeApplication_Impl (void) +{ +} + +CORBA::Long +CIAO::NodeApplication_Impl::init (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + //@@TODO initialize this NodeApplication properties + return 0; +} + +CORBA::Long +CIAO::NodeApplication_Impl::create_all_containers ( + const ::Deployment::NodeImplementationInfo & node_impl_info + ACE_ENV_ARG_DECL_NOT_USED + ) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Create all the containers here based on the input node_impl_info. + const CORBA::ULong len = node_impl_info.length (); + + for (CORBA::ULong i = 0; i < len; ++i) + { + // The factory method <create_container> will intialize the container + // servant with properties, so we don't need to call <init> on the + // container object reference. + // Also, the factory method will add the container object reference + // to the set for us. + ::Deployment::Container_var cref = + this->create_container (node_impl_info[i].container_config); + } + + return 0; +} + +void +CIAO::NodeApplication_Impl::finishLaunch ( + const Deployment::Connections & providedReference, + CORBA::Boolean start + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError, + Deployment::InvalidConnection)) +{ + ACE_UNUSED_ARG (start); + + ACE_TRY + { + const CORBA::ULong length = providedReference.length (); + + // For every connection struct we finish the connection. + for (CORBA::ULong i = 0; i < length; ++i) + { + ACE_CString name = providedReference[i].instanceName.in (); + Components::CCMObject_ptr comp; + + if (this->component_map_.find (name, comp) != 0) + { + ACE_TRY_THROW (Deployment::InvalidConnection ()); + } + + Components::EventConsumerBase_var consumer; + //Since we know CCMObject inherits from navigation/event/receptacle, no need + //to narrow here. + switch (providedReference[i].kind) + { + case Deployment::SimplexReceptacle: + case Deployment::MultiplexReceptacle: + comp->connect (providedReference[i].portName.in (), + providedReference[i].endpoint.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + break; + + // @@ (GD) A place holder where the Event Channel connections + // should be set up. + case Deployment::EventEmitter: + consumer = Components::EventConsumerBase:: + _narrow (providedReference[i].endpoint.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (CORBA::is_nil (consumer.in ())) + { + ACE_THROW (Deployment::InvalidConnection ()); + } + + comp->connect_consumer (providedReference[i].portName.in (), + consumer.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + break; + + case Deployment::EventPublisher: + consumer = Components::EventConsumerBase:: + _narrow (providedReference[i].endpoint.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + if (CORBA::is_nil (consumer.in ())) + ACE_THROW (Deployment::InvalidConnection ()); + + comp->subscribe (providedReference[i].portName.in (), + consumer.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + break; + + default: + ACE_TRY_THROW (Deployment::InvalidConnection ()); + } + } + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "NodeApplication_Impl::finishLaunch\t\n"); + ACE_RE_THROW; + } + + ACE_ENDTRY; +} + +void +CIAO::NodeApplication_Impl::ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)) +{ + Component_Iterator end = this->component_map_.end (); + for (Component_Iterator iter (this->component_map_.begin ()); + iter != end; + ++iter) + { + ((*iter).int_id_)->ciao_preactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } +} + +void +CIAO::NodeApplication_Impl::start (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)) +{ + Component_Iterator end = this->component_map_.end (); + for (Component_Iterator iter (this->component_map_.begin ()); + iter != end; + ++iter) + { + ((*iter).int_id_)->ciao_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } +} + +void +CIAO::NodeApplication_Impl::ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)) +{ + Component_Iterator end = this->component_map_.end (); + for (Component_Iterator iter (this->component_map_.begin ()); + iter != end; + ++iter) + { + ((*iter).int_id_)->ciao_postactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } +} + +void +CIAO::NodeApplication_Impl::ciao_passivate (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StopError)) +{ + Component_Iterator end = this->component_map_.end (); + for (Component_Iterator iter (this->component_map_.begin ()); + iter != end; + ++iter) + { + ((*iter).int_id_)->ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } +} + +Deployment::ComponentInfos * +CIAO::NodeApplication_Impl::install ( + const ::Deployment::NodeImplementationInfo & node_impl_info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::UnknownImplId, + Deployment::ImplEntryPointNotFound, + Deployment::InstallationFailure, + Components::InvalidConfiguration)) +{ + Deployment::ComponentInfos_var retv; + ACE_TRY + { + ACE_NEW_THROW_EX (retv, + Deployment::ComponentInfos, + CORBA::NO_MEMORY ()); + ACE_TRY_CHECK; + + retv->length (0UL); + + // Call create_all_containers to create all the necessary containers.. + (void) this->create_all_containers (node_impl_info); + + // For each container, invoke <install> operation, this will return + // the ComponentInfo for components installed in each container. + // Merge all the returned ComponentInfo, which will be used + // as the return value of this method. + const CORBA::ULong num_containers = node_impl_info.length (); + for (CORBA::ULong i = 0; i < num_containers; ++i) + { + Deployment::ComponentInfos_var comp_infos = + this->container_set_.at(i)->install (node_impl_info[i] + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Append the return sequence to the *big* return sequence + CORBA::ULong curr_len = retv->length (); + retv->length (curr_len + comp_infos->length ()); + + for (CORBA::ULong j = curr_len; j < retv->length (); j++) + retv[j] = comp_infos[j-curr_len]; + } + + // @@ Maybe we can optimize this. We can come up with a decision later. + // Cache a copy of the component object references for all the components + // installed on this NodeApplication. I know we can delegates these to the + // undelying containers, but in that case, we should loop all the containers + // to find the component object reference. - Gan + const CORBA::ULong comp_len = retv->length (); + for (CORBA::ULong len = 0; + len < comp_len; + ++len) + { + //Since we know the type ahead of time...narrow is omitted here. + if (this->component_map_. + bind (retv[len].component_instance_name.in(), + Components::CCMObject::_duplicate (retv[len].component_ref.in()))) + ACE_THROW_RETURN (Deployment::InstallationFailure (), 0); + } + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "CIAO_NodeApplication::install error\t\n"); + ACE_RE_THROW; + } + ACE_ENDTRY; + ACE_CHECK_RETURN (0); + + return retv._retn (); +} + +void +CIAO::NodeApplication_Impl::remove (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // For each container, invoke <remove> operation to remove home and components. + const CORBA::ULong set_size = this->container_set_.size (); + for (CORBA::ULong i = 0; i < set_size; ++i) + { + this->container_set_.at(i)->remove (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + + // Remove all containers + // Maybe we should also deactivate container object reference. + this->container_set_.remove_all (); + + if (CIAO::debug_level () > 1) + ACE_DEBUG ((LM_DEBUG, "Removed all containers from this NodeApplication!\n")); + + this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); +} + + +// Create a container interface, which will be hosted in this NodeApplication. +::Deployment::Container_ptr +CIAO::NodeApplication_Impl::create_container (const ::Deployment::Properties &properties + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::CreateFailure, + ::Components::InvalidConfiguration)) +{ + if (CIAO::debug_level () > 1) + ACE_DEBUG ((LM_DEBUG, "ENTERING: NodeApplication_Impl::create_container()\n")); + + CIAO::Container_Impl *container_servant = 0; + + ACE_NEW_THROW_EX (container_servant, + CIAO::Container_Impl (this->orb_.in (), + this->poa_.in (), + this->get_objref ()), + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (0); + + PortableServer::ServantBase_var safe_servant (container_servant); + + // @TODO: Need to decide a "component_installation" equivalent data + // structure to pass to the container, which will be used to + // suggest how to install the components. Each such data stucture + // should be correspond to one <process_collocation> tag in the XML + // file to describe the deployment plan. + container_servant->init (properties + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + PortableServer::ObjectId_var oid + = this->poa_->activate_object (container_servant + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Object_var obj + = this->poa_->id_to_reference (oid.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Deployment::Container_var ci + = ::Deployment::Container::_narrow (obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + // Cached the objref in its servant. + container_servant->set_objref (ci.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + { + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); + + this->container_set_.add (ci.in ()); + } + + if (CIAO::debug_level () > 1) + ACE_DEBUG ((LM_DEBUG, + "LEAVING: NodeApplication_Impl::create_container()\n")); + return ci._retn (); +} + +// Remove a container interface. +void +CIAO::NodeApplication_Impl::remove_container (::Deployment::Container_ptr cref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::RemoveFailure)) +{ + ACE_DEBUG ((LM_DEBUG, "ENTERING: NodeApplication_Impl::remove_container()\n")); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); + + if (this->container_set_.object_in_set (cref) == 0) + { + ACE_THROW (Components::RemoveFailure()); + } + + cref->remove (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + // @@ Deactivate object. + PortableServer::ObjectId_var oid + = this->poa_->reference_to_id (cref + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->poa_->deactivate_object (oid.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + // Should we remove the server still, even if the previous call failed. + + if (this->container_set_.remove (cref) == -1) + { + ACE_THROW (::Components::RemoveFailure ()); + } + + ACE_DEBUG ((LM_DEBUG, "LEAVING: NodeApplication_Impl::remove_container()\n")); +} + +// Get containers +::Deployment::Containers * +CIAO::NodeApplication_Impl::get_containers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return 0; +} diff --git a/TAO/CIAO/ciao/NodeApplication_Impl.h b/TAO/CIAO/ciao/NodeApplication_Impl.h new file mode 100644 index 00000000000..133ac3a697e --- /dev/null +++ b/TAO/CIAO/ciao/NodeApplication_Impl.h @@ -0,0 +1,238 @@ +//$Id$ +/**======================================================== + * + * @file NodeApplication_Impl.h + * + * @Brief This file contains the implementation of + * the NodeApplication interface. + * + * @author Tao Lu <lu@dre.vanderbilt.edu> + * @author Gan Deng <dengg@dre.vanderbilt.edu> + *========================================================*/ + +#ifndef NODEAPPLICATION_IMPL_H +#define NODEAPPLICATION_IMPL_H +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Container_Base.h" +#include "Deployment_CoreS.h" +#include "Server_init.h" +#include "CIAO_common.h" +#include "Object_Set_T.h" +#include "tao/ORB.h" +#include "ace/Synch.h" +#include "ace/Synch_Traits.h" +#include "ace/SString.h" +#include "ace/Hash_Map_Manager_T.h" + +using CIAO::Utility::write_IOR; + +/** + * + * @class NodeApplication_Impl + * + * @brief This class implements the NodeApplication interface. + * This interface is semantically very simillar to container + * in the old DnC spec. However this class will also be used + * as a Server for hosting home/component. This way we reduce the + * complexity of the framework by omitting the componentserver layer. + * + * @@TODO add configuration capabilities. Threading is one of them. + * + * @@Assumptions: + * 1. Now the implementation is not thread safe. + * // @@Gan, the above assumption is _really_ bad. Could you please + * use the lock in the imeplementation to do some simple + * prootections. + **/ + +namespace CIAO +{ + // @@ Gan, as we discussed before can you please wrap this + // implementation in a namespace Node_Application or whatever to + // signify that it belongs to another software piece of CIAO? + class CIAO_SERVER_Export NodeApplication_Impl + : public virtual POA_Deployment::NodeApplication + { + public: + /// Default constructor. + NodeApplication_Impl (CORBA::ORB_ptr o, + PortableServer::POA_ptr p); + + /// Default destructor. + virtual ~NodeApplication_Impl (void); + + /** + * @method finishLaunch + * + * @brief This operation dose 2 things. + * 1. Get the external connction (facet and Event source) + * and connect them to the local receptacle/event sink. + * 2. If the start augment is true, start the Components. + * @Note: + * The connection containes the object ref of the provided object + * reference (facet/event consumer) of components from other NodeApplications. + * However the name field stores the name of the port on the local component. + */ + virtual void + finishLaunch (const Deployment::Connections & providedReference, + CORBA::Boolean start + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError, + Deployment::InvalidConnection)); + + /** + * @method start + */ + virtual void + start (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)); + + /*------------- CIAO specific IDL operations (idl)---------- + * + *-----------------------------------------------------------*/ + + /** + * @method ciao_preactivate + */ + virtual void + ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)); + + /** + * @method ciao_postactivate + */ + virtual void + ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)); + + /** + * @method ciao_passivate + */ + virtual void + ciao_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StopError)); + + /// Initialize the NodeApplication + virtual CORBA::Long init (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Start install homes and components. + virtual ::Deployment::ComponentInfos * + install (const ::Deployment::NodeImplementationInfo & node_impl_info + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Deployment::UnknownImplId, + ::Deployment::ImplEntryPointNotFound, + ::Deployment::InstallationFailure, + ::Components::InvalidConfiguration)); + + /// Get the object reference of the NodeApplicationManager. + /// This might come in handy later. + virtual ::CORBA::Object_ptr + get_node_application_manager (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Access the readonly attribute. + virtual ::Deployment::Properties * + properties (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Remove everything inside including all components and homes. + virtual void remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Create a container interface, which will be hosted in this NodeApplication. + virtual ::Deployment::Container_ptr + create_container (const ::Deployment::Properties &properties + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::CreateFailure, + ::Components::InvalidConfiguration)); + + /// Remove a container interface. + virtual void remove_container (::Deployment::Container_ptr cref + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::RemoveFailure)); + + /// Get all container object refs + virtual ::Deployment::Containers * get_containers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /*------------- CIAO specific helper functions (C++)--------- + * + *-----------------------------------------------------------*/ + + /// Get the containing POA. This operation does *not* + /// increase the reference count of the POA. + virtual PortableServer::POA_ptr _default_POA (void); + + /// Return the cached object reference of this NodeApplication object. + /// This operation does *NOT* increase the reference count. + ::Deployment::NodeApplication_ptr + get_objref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); + + protected: + /// Create and initialize all the containers + virtual CORBA::Long create_all_containers ( + const ::Deployment::NodeImplementationInfo & node_impl_info + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// To store all created Component object. + // @@Gan/Jai, as we discussed before this is simply a BAD + //idea. These need to moved into the container. + // @@ Jai/Gan, how about using CCMObject_var instead of + //CCMObject_ptr's? + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + Components::CCMObject_ptr, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> CCMComponent_Map; + typedef CCMComponent_Map::iterator Component_Iterator; + CCMComponent_Map component_map_; + + /// Synchronize access to the object set. + TAO_SYNCH_MUTEX lock_; + + /// Keep a list of managed Container objects. + Object_Set<Deployment::Container, Deployment::Container_var> container_set_; + /// Keep a pointer to the managing ORB serving this servant. + CORBA::ORB_var orb_; + + /// Keep a pointer to the managing POA. + // @@Gan/Jai, which POA is this? Same as the component POA or a + // different one. My sense is that its different. Could you please + //document it? + PortableServer::POA_var poa_; + + /// Cached properties + Deployment::Properties properties_; + + /// And a reference to the NodeApplicationManager that created us. + ::CORBA::Object_var node_app_manager_; + + /// Cache the object reference (of ourselves). + ::Deployment::NodeApplication_var objref_; + }; +} + +#if defined (__ACE_INLINE__) +# include "NodeApplication_Impl.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" +#endif /* NODEAPPLICATION_IMPL_H */ diff --git a/TAO/CIAO/ciao/NodeApplication_Impl.inl b/TAO/CIAO/ciao/NodeApplication_Impl.inl new file mode 100644 index 00000000000..d0a30e2b401 --- /dev/null +++ b/TAO/CIAO/ciao/NodeApplication_Impl.inl @@ -0,0 +1,77 @@ +/* -*- C++ -*- */ +// $Id$ + +ACE_INLINE +CIAO::NodeApplication_Impl:: +NodeApplication_Impl (CORBA::ORB_ptr o, + PortableServer::POA_ptr p) + + : orb_ (CORBA::ORB::_duplicate (o)), + poa_ (PortableServer::POA::_duplicate (p)) +{ +} + +// Access the readonly attribute +ACE_INLINE +Deployment::Properties * +CIAO::NodeApplication_Impl::properties (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + Deployment::Properties * tmp; + + ACE_NEW_THROW_EX (tmp, + Deployment::Properties (this->properties_), + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (0); + + return tmp; +} + +ACE_INLINE +PortableServer::POA_ptr +CIAO::NodeApplication_Impl::_default_POA (void) +{ + return PortableServer::POA::_duplicate (this->poa_.in ()); +} + + +ACE_INLINE +CORBA::Object_ptr +CIAO::NodeApplication_Impl::get_node_application_manager ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return ::CORBA::Object::_duplicate (this->node_app_manager_.in ()); +} + +/* +ACE_INLINE void +CIAO::NodeApplication_Impl:: +set_objref (Components::Deployment::ServerActivator_ptr act, + const Components::ConfigValues &config, + Components::Deployment::ComponentServer_ptr cs + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (!CORBA::is_nil (this->node_app_manager_.in ()) || + !CORBA::is_nil (this->objref_.in ())) + ACE_THROW (CORBA::BAD_INV_ORDER ()); + + this->config_ = new Components::ConfigValues (config); + this->activator_ = Components::Deployment::ServerActivator::_duplicate (act); + this->objref_ = Components::Deployment::ComponentServer::_duplicate (cs); +} +*/ + +ACE_INLINE ::Deployment::NodeApplication_ptr +CIAO::NodeApplication_Impl:: +get_objref (ACE_ENV_SINGLE_ARG_DECL) +{ + if (CORBA::is_nil (this->objref_.in ())) + { + this->objref_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + } + + return this->objref_.in (); +} diff --git a/TAO/CIAO/ciao/Object_Set_T.cpp b/TAO/CIAO/ciao/Object_Set_T.cpp deleted file mode 100644 index 043f2f0e9f0..00000000000 --- a/TAO/CIAO/ciao/Object_Set_T.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// $Id$ - -#ifndef CIAO_OBJECT_SET_T_C -#define CIAO_OBJECT_SET_T_C - -#include "Object_Set_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "Object_Set_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ciao, Object_Set_T, "$Id$") - -template <class T, class T_var> -CIAO::Object_Set<T, T_var>::Object_Set (CORBA::ULong init_capacity, - CORBA::ULong step) - : capacity_ (init_capacity), - size_ (0), - step_ (step) -{ - this->buffer_ = new T_var [this->capacity_]; -} - -template <class T, class T_var> -CIAO::Object_Set<T, T_var>::~Object_Set () -{ - delete[] this->buffer_; -} - -template <class T, class T_var> void -CIAO::Object_Set<T, T_var>::release () -{ - CORBA::ULong i = 0; - - for (; i < this->size_; ++i) - { - this->buffer_[i] = T::_nil (); - } -} - -template <class T, class T_var> CORBA::Long -CIAO::Object_Set<T, T_var>::add (T *objref) -{ - if (this->size_ == this->capacity_) - this->grow (); - - this->buffer_[this->size_] = T::_duplicate (objref); - return this->size_++; -} - -template<class T, class T_var> CORBA::Long -CIAO::Object_Set<T, T_var>::remove (T *objref) -{ - if (CORBA::is_nil (objref)) - return -1; - - CORBA::ULong i = 0; - - for (; i < this->size_; ++i) - if (objref->_is_equivalent (this->buffer_[i].in ())) // _is_equivalent could be unreliable? - { - --this->size_; - if (i != this->size_) - this->buffer_[i] = this->buffer_[this->size_]; - - this->buffer_[this->size_] = T::_nil (); - return 0; - } - return -1; // not found. -} - -template <class T, class T_var> void -CIAO::Object_Set<T, T_var>::grow (void) -{ - this->capacity_ += this->step_; - - T_var *newbuf = new T_var [this->capacity_]; - - CORBA::ULong i = 0; - for (; i < this->size_; ++i) - newbuf[i] = this->buffer_[i]; // this will hijack the object ownership - - delete[] this->buffer_; - - this->buffer_ = newbuf; -} - -template <class T, class T_var> CORBA::ULong -CIAO::Object_Set<T, T_var>::copy (CORBA::ULong len, - T **buf) -{ - if (buf == 0) - return 0; - - if (len > this->size_) - len = this->size_; - - CORBA::ULong i = 0; - for (; i < len; ++i) - buf[i] = T::_duplicate (this->buffer_[i].in ()); - - return len; -} - -template <class T, class T_var> int -CIAO::Object_Set<T, T_var>::object_in_set (T *objref) -{ - if (CORBA::is_nil (objref)) // Don't count nil objref - return 0; - - CORBA::ULong i = 0; - - for (; i < this->size_; ++i) - if (objref->_is_equivalent (this->buffer_[i].in ())) // _is_equivalent could be unreliable? - return -1; - - return 0; -} -#endif /* CIAO_OBJECT_SET_T_C */ diff --git a/TAO/CIAO/ciao/Object_Set_T.h b/TAO/CIAO/ciao/Object_Set_T.h deleted file mode 100644 index d5421dd442d..00000000000 --- a/TAO/CIAO/ciao/Object_Set_T.h +++ /dev/null @@ -1,127 +0,0 @@ -// $Id$ - -/** - * @file Object_Set_T.h - * - * Helper template classes for maintaining and managing object - * reference sets. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef CIAO_OBJECT_SET_T_H -#define CIAO_OBJECT_SET_T_H -#include /**/ "ace/pre.h" - -#include "tao/ORB_Constants.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace CIAO -{ - /** - * @class Object_Set - * - * @brief A helper template class for maintaining and managing a set - * of object reference. - * - * This class provides a naive implementation of an object reference - * set. It is naive because it simply keeps object references in an - * objref_var array without checking for duplication. More - * importantly, it takes O(n) to to look for an object reference and - * return it. What we really need is a thread-safe hash_set<> like - * class here. Since this is mostly used only during setup/assemble - * time for a CIAO application, i.e., not on critical path, this - * class serves as a place holder for later, more efficient - * implementation. - */ - template <class T, class T_var> - class Object_Set - { - public: - /** - * Default contructor that also allows initializing the initial - * capacity of the set and the increment step. - */ - Object_Set (CORBA::ULong init_capacity = 10, - CORBA::ULong step = 10); - - /// Default destructor. - ~Object_Set (void); - - /// Adding a new object reference to the set. Return -1 if error - /// occurred. - CORBA::Long add (T *objref); - - /// Removing an object from the set. Return -1 if error occurred. - CORBA::Long remove (T *objref); - - /// Access the underlying T_var array directly. This is added to - /// get around a bug in TAO's sequence of object C++ mapping. - T_var &at (CORBA::ULong index); - - /** - * Get a copy of the object reference set into the incoming array - * @c buffer with capacity of @c size. @c buffer is usually - * allocated using a sequence's @c allocbuf method. Notice that - * caller is responsible to release the object references in - * buffer. - * - * @retval actual number of objrefs copied into @c buffer. - */ - CORBA::ULong copy (CORBA::ULong size, - T **buffer); - - /** - * Check if an object is in the set. Return 0 if false. - */ - int object_in_set (T *objref); - - /// Query the current size the set contains. - CORBA::ULong size (void) const; - - /// Query the current capacity the set. - CORBA::ULong capacity (void) const; - - /** - * Release all object references. - */ - void release (void); - - protected: - /// Grow the internal array holding the object references. - void grow (void); - - /// Pointer to the dynamically allocated buffer that holds the - /// object references. - T_var *buffer_; - - /// Maximun capacity of this->buffer_; - CORBA::ULong capacity_; - - /// Current size in the set. - CORBA::ULong size_; - - /// How many more slots to add each time we expand the capacity of - /// this set. - CORBA::ULong step_; - }; - -} - -#if defined (__ACE_INLINE__) -#include "Object_Set_T.inl" -#endif /* !defined INLINE */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Object_Set_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Object_Set_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* CIAO_OBJECT_SET_T_H */ diff --git a/TAO/CIAO/ciao/Object_Set_T.inl b/TAO/CIAO/ciao/Object_Set_T.inl deleted file mode 100644 index cd9b8e1ab45..00000000000 --- a/TAO/CIAO/ciao/Object_Set_T.inl +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -template <class T, class T_var> ACE_INLINE CORBA::ULong -CIAO::Object_Set<T, T_var>::size (void) const -{ - return this->size_; -} - -template <class T, class T_var> ACE_INLINE CORBA::ULong -CIAO::Object_Set<T, T_var>::capacity (void) const -{ - return this->capacity_; -} - -template <class T, class T_var> ACE_INLINE T_var & -CIAO::Object_Set<T, T_var>::at (CORBA::ULong index) -{ - return this->buffer_[index]; -} diff --git a/TAO/CIAO/ciao/Port_Activator.cpp b/TAO/CIAO/ciao/Port_Activator.cpp deleted file mode 100644 index c9686a23ef3..00000000000 --- a/TAO/CIAO/ciao/Port_Activator.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "Port_Activator.h" - -ACE_RCSID (ciao, - Servant_Activator, - "$Id$") - -namespace CIAO -{ - Port_Activator::Port_Activator (const char *oid, - const char *name, - Type t) - : oid_ (oid) - , name_ (name) - , t_ (t) - { - } - - Port_Activator::~Port_Activator (void) - { - } - - const char* - Port_Activator::name (void) const - { - // @@ TODO, need to be inlined. - return this->oid_.in (); - } -} diff --git a/TAO/CIAO/ciao/Port_Activator.h b/TAO/CIAO/ciao/Port_Activator.h deleted file mode 100644 index dbe8f184a93..00000000000 --- a/TAO/CIAO/ciao/Port_Activator.h +++ /dev/null @@ -1,83 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file Port_Activator.h - * - * $Id$ - * - * @authors Bala Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_PORT_ACTIVATOR_H -#define CIAO_PORT_ACTIVATOR_H -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciao/CIAO_Server_Export.h" - -#include "tao/PortableServer/PortableServer.h" - -namespace CIAO -{ - /** - * @class Port_Activator - * - * @brief Base class for port activations - * - * This is a ABC for the Port_Activator_T <> template class where - * the bulk of the work is done. This class is simply a place holder - * so that we could use the pointer to this class to achieve - * polymorphism for facet and consumer servant activations. - * - */ - class CIAO_SERVER_Export Port_Activator - { - public: - enum Type - { - Facet, - Sink - }; - - Port_Activator (const char *oid, - const char *name, - Type t); - - virtual ~Port_Activator (void); - - /// Return the name of port that this activator encapulates. - const char* name (void) const; - - /// Activate the servant reponsible for this port. - /** - * There are intentionally no exception specifications. It is the - * caller's responsibility to handle CORBA and C++ - * specifications. - */ - virtual PortableServer::Servant activate ( - const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL) = 0; - - protected: - /// The object ID that is used to activate the servant within the - /// POA. - CORBA::String_var oid_; - - /// Name of the port - CORBA::String_var name_; - - /// What type of port is it, a conumer or facet. - Type t_; - }; -} - - - -#include /**/ "ace/post.h" -#endif /*CIAO_PORT_ACTIVATOR_H*/ diff --git a/TAO/CIAO/ciao/Port_Activator_T.cpp b/TAO/CIAO/ciao/Port_Activator_T.cpp deleted file mode 100644 index 257ea137204..00000000000 --- a/TAO/CIAO/ciao/Port_Activator_T.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// $Id$ -#ifndef CIAO_PORT_ACTIVATOR_T_CPP -#define CIAO_PORT_ACTIVATOR_T_CPP - -#include "Port_Activator_T.h" -#include "tao/CORBA_String.h" -#include "ace/OS_NS_string.h" - -namespace CIAO -{ - template <typename SERV, - typename EXEC, - typename CONTEXT, - typename COMP_SERV> - Port_Activator_T<SERV, EXEC, CONTEXT, COMP_SERV>::Port_Activator_T ( - const char *oid, - const char *name, - Port_Activator::Type t, - EXEC *e, - CONTEXT *c, - COMP_SERV *cc) - : Port_Activator (oid, name, t) - , executor_ (e) - , context_ (c) - , comp_serv_ (cc) - { - } - - template <typename SERV, - typename EXEC, - typename CONTEXT, - typename COMP_SERV> - PortableServer::Servant - Port_Activator_T<SERV, EXEC, CONTEXT, COMP_SERV>::activate ( - const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL) - { - CORBA::String_var str = - PortableServer::ObjectId_to_string (oid); - - // An additional check, may not be necessary. Being on the safe - // side. - if (ACE_OS::strcmp (this->oid_.in (), - str.in ()) == 0) - { - if (this->executor_ == 0 && - this->t_ == Port_Activator::Facet) - { - CORBA::Object_var tmp = - this->comp_serv_->get_facet_executor (this->name_); - - this->executor_ = EXEC::_narrow (tmp.in ()); - } - - SERVANT *s = 0; - - ACE_NEW_THROW_EX (s, - SERVANT (this->executor_, - this->context_), - CORBA::NO_MEMORY ()); - return s; - } - - ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), - 0); - } -} - -#endif /*SERVANT_ACTIVATOR_T_CPP*/ diff --git a/TAO/CIAO/ciao/Port_Activator_T.h b/TAO/CIAO/ciao/Port_Activator_T.h deleted file mode 100644 index c5f179e01d6..00000000000 --- a/TAO/CIAO/ciao/Port_Activator_T.h +++ /dev/null @@ -1,80 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Port_Activator_T.h - * - * $Id$ - * - * @authors Bala Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_PORT_ACTIVATOR_T_H -#define CIAO_PORT_ACTIVATOR_T_H -#include /**/ "ace/pre.h" - -#include "ciao/Port_Activator.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - - -namespace CIAO -{ - /** - * @class Port_Activator_T - * - * @brief Concrete class that implements the strategy for creating - * the right type of servant for the ports in question. - * - * This class is parametrized by the servant type for the port, the - * executor type for the port, the context for the component and the - * component servant which instantiated this class within the - * container. - */ - template <typename SERV, - typename EXEC, - typename CONTEXT, - typename COMP_SERV> - class Port_Activator_T : public virtual Port_Activator - { - public: - typedef SERV SERVANT; - - Port_Activator_T (const char *oid, - const char *name, - Port_Activator::Type t, - EXEC *e, - CONTEXT *c, - COMP_SERV *cs); - - /// Template method from the base class, please see the base class - /// documentation for details. - PortableServer::Servant activate ( - const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL); - - private: - /// The executor - EXEC *executor_; - - /// Context classes - CONTEXT *context_; - - /// COmponent servant which created <this> - COMP_SERV *comp_serv_; - }; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Port_Activator_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Port_Activator_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /*CIAO_SERVANT_ACTIVATOR_T_H*/ diff --git a/TAO/CIAO/ciao/README b/TAO/CIAO/ciao/README deleted file mode 100644 index b806bbc084c..00000000000 --- a/TAO/CIAO/ciao/README +++ /dev/null @@ -1,13 +0,0 @@ -$Id$ - -This directory contains the Core CCM IDL defintions which get split -into different libraries. - -1. CIAO - CIAO CCM client-side interface library. Component-aware clients - need to link to this library. - -2. CIAO_Container - CIAO CCM container interface definitions. This library - is needed by all compoment implementation. - -3. CIAO_Server - CIAO CCM interface definitions for component servers and - deployment framework. diff --git a/TAO/CIAO/ciao/Servant_Activator.cpp b/TAO/CIAO/ciao/Servant_Activator.cpp deleted file mode 100644 index 03899555bfd..00000000000 --- a/TAO/CIAO/ciao/Servant_Activator.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include "Servant_Activator.h" -#include "CIAO_common.h" -#include "Port_Activator.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (ciao, - Servant_Activator, - "$Id$") - -namespace CIAO -{ - Servant_Activator::Servant_Activator (CORBA::ORB_ptr o) - : orb_ (CORBA::ORB::_duplicate (o)) - // @@ TODO, avoid this magic number - , pa_ (64) - , slot_index_ (0) - { - } - - Servant_Activator::~Servant_Activator (void) - { - { - ACE_GUARD (TAO_SYNCH_MUTEX, - guard, - this->mutex_); - - const unsigned int sz = this->slot_index_; - - for (unsigned int t = 0; t != sz; ++t) - { - Port_Activator *&tmp = this->pa_[t]; - - delete tmp; - } - } - } - - PortableServer::Servant - Servant_Activator::incarnate (const PortableServer::ObjectId &oid, - PortableServer::POA_ptr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::ForwardRequest)) - { - CORBA::String_var str = - PortableServer::ObjectId_to_string (oid); - - if (CIAO::debug_level () > 10) - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - Servant_Activator::incarnate, " - "activating port name [%s] \n", - str.in ())); - - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, - guard, - this->mutex_, - 0); - - const unsigned int sz = this->slot_index_; - - Port_Activator *tmp = 0; - - for (unsigned int t = 0; t != sz; ++t) - { - if (this->pa_.get (tmp, t) == -1) - ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), - 0); - - if (tmp == 0) - { - if (CIAO::debug_level () > 10) - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - Servant_Activator::incarnate ()," - " value from the array is null \n")); - continue; - } - if (ACE_OS::strcmp (tmp->name (), - str.in ()) == 0) - // We should try avoiding making outbound calls with the - // lock held. Oh well, let us get some sense of sanity in - // CIAO to do think about these. - return this->pa_[t]->activate (oid - ACE_ENV_ARG_PARAMETER); - } - } - ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), - 0); - } - - void - Servant_Activator::etherealize (const PortableServer::ObjectId &, - PortableServer::POA_ptr , - PortableServer::Servant , - CORBA::Boolean , - CORBA::Boolean - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - /// Need to investigate what needs to be handled here.. - } - - bool - Servant_Activator::register_port_activator (Port_Activator *pa) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, - guard, - this->mutex_, - false); - - // @@ TODO, need to implement a better algorithm here. - // - if (this->slot_index_ >= this->pa_.size ()) - this->pa_.size ((this->slot_index_ + 1)); - - if (this->pa_.set (pa, this->slot_index_) == 0) - { - ++this->slot_index_; - - if (CIAO::debug_level () > 10) - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - Servant_Activator::register_port_activator," - " the slot_index_ is [%d] \n", - this->slot_index_)); - - return true; - } - - return false; - } -} diff --git a/TAO/CIAO/ciao/Servant_Impl_Base.cpp b/TAO/CIAO/ciao/Servant_Impl_Base.cpp deleted file mode 100644 index b88525ad10d..00000000000 --- a/TAO/CIAO/ciao/Servant_Impl_Base.cpp +++ /dev/null @@ -1,503 +0,0 @@ -// $Id$ - -#include "Servant_Impl_Base.h" -#include "StandardConfigurator_Impl.h" -#include "Container_Base.h" -#include "ace/UUID.h" - -namespace CIAO -{ - Servant_Impl_Base::Servant_Impl_Base (void) - { - ACE_ASSERT (0); - } - - Servant_Impl_Base::Servant_Impl_Base (Components::CCMHome_ptr home, - Home_Servant_Impl_Base *home_servant, - Session_Container * c) - : home_ (Components::CCMHome::_duplicate (home)), - home_servant_ (home_servant), - container_ (c) - { - } - - Servant_Impl_Base::~Servant_Impl_Base (void) - { - } - - // Operations for CCMObject interface. - - ::Components::PrimaryKeyBase * - Servant_Impl_Base::get_primary_key ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - ::Components::NoKeyAvailable)) - { - ACE_THROW_RETURN (::Components::NoKeyAvailable (), 0); - - return 0; - } - - CORBA::IRObject_ptr - Servant_Impl_Base::get_component_def ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), - CORBA::IRObject::_nil ()); - } - - void - Servant_Impl_Base::configuration_complete ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidConfiguration)) - { - // CIAO to-do - } - - void - Servant_Impl_Base::remove ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) - { - // CIAO to-do - } - - ::Components::ConnectionDescriptions * - Servant_Impl_Base::get_connections ( - const char * /* name */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ComponentPortDescription * - Servant_Impl_Base::get_all_ports ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - OBV_Components::ComponentPortDescription *cps = 0; - ACE_NEW_RETURN (cps, - OBV_Components::ComponentPortDescription, - 0); - ::Components::ComponentPortDescription_var retv = cps; - - ::Components::FacetDescriptions_var facets_desc = - this->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::ReceptacleDescriptions_var receptacle_desc = - this->get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::ConsumerDescriptions_var consumer_desc = - this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::EmitterDescriptions_var emitter_desc = - this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::Components::PublisherDescriptions_var publisher_desc = - this->get_all_publishers (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - retv->facets (facets_desc.in ()); - retv->receptacles (receptacle_desc.in ()); - retv->consumers (consumer_desc.in ()); - retv->emitters (emitter_desc.in ()); - retv->publishers (publisher_desc.in ()); - - return retv._retn (); - } - - CORBA::Object_ptr - Servant_Impl_Base::provide_facet ( - const char *name - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - if (name == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - CORBA::Object::_nil ()); - } - - CORBA::Object_ptr retval = this->lookup_facet (name); - - if (CORBA::is_nil (retval)) - { - ACE_THROW_RETURN (Components::InvalidName (), - CORBA::Object::_nil ()); - } - - return retval; - } - - Components::FacetDescriptions * - Servant_Impl_Base::get_named_facets ( - const ::Components::NameList & names - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - Components::FacetDescriptions *retval = 0; - ACE_NEW_RETURN (retval, - ::Components::FacetDescriptions, - 0); - Components::FacetDescriptions_var safe_retval = retval; - CORBA::ULong len = names.length (); - safe_retval->length (len); - ::Components::FacetDescription *tmp = 0; - - for (CORBA::ULong i = 0; i < len; ++i) - { - tmp = this->lookup_facet_description (names[i].in ()); - - if (tmp == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - 0); - } - - safe_retval[i] = tmp; - } - - return safe_retval._retn (); - } - - ::Components::FacetDescriptions * - Servant_Impl_Base::get_all_facets ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::FacetDescriptions *tmp = 0; - ACE_NEW_RETURN (tmp, - ::Components::FacetDescriptions, - 0); - - ::Components::FacetDescriptions_var retval = tmp; - - retval->length (this->facet_table_.current_size ()); - CORBA::ULong i = 0; - - for (FacetTable::iterator iter = this->facet_table_.begin (); - iter != this->facet_table_.end (); - ++iter, ++i) - { - FacetTable::ENTRY & entry = *iter; - retval[i] = entry.int_id_; - } - - return retval._retn (); - } - - ::Components::ConsumerDescriptions * - Servant_Impl_Base::get_all_consumers ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::ConsumerDescriptions *tmp = 0; - ACE_NEW_RETURN (tmp, - ::Components::ConsumerDescriptions, - 0); - - ::Components::ConsumerDescriptions_var retval = tmp; - - retval->length (this->consumer_table_.current_size ()); - CORBA::ULong i = 0; - - for (ConsumerTable::iterator iter = this->consumer_table_.begin (); - iter != this->consumer_table_.end (); - ++iter, ++i) - { - ConsumerTable::ENTRY & entry = *iter; - retval[i] = entry.int_id_; - } - - return retval._retn (); - } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::get_consumer ( - const char *sink_name - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - if (sink_name == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - Components::EventConsumerBase::_nil ()); - } - - Components::EventConsumerBase_ptr retval = - this->lookup_consumer (sink_name); - - if (CORBA::is_nil (retval)) - { - ACE_THROW_RETURN (Components::InvalidName (), - Components::EventConsumerBase::_nil ()); - } - - return retval; - } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::disconnect_consumer ( - const char * /* source_name */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName, - Components::NoConnection)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ConsumerDescriptions * - Servant_Impl_Base::get_named_consumers ( - const ::Components::NameList & names - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - Components::ConsumerDescriptions *retval = 0; - ACE_NEW_RETURN (retval, - ::Components::ConsumerDescriptions, - 0); - Components::ConsumerDescriptions_var safe_retval = retval; - CORBA::ULong len = names.length (); - safe_retval->length (len); - ::Components::ConsumerDescription *tmp = 0; - - for (CORBA::ULong i = 0; i < len; ++i) - { - tmp = this->lookup_consumer_description (names[i].in ()); - - if (tmp == 0) - { - ACE_THROW_RETURN (Components::InvalidName (), - 0); - } - - safe_retval[i] = tmp; - } - - return safe_retval._retn (); - } - - ::Components::EmitterDescriptions * - Servant_Impl_Base::get_all_emitters ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::EmitterDescriptions * - Servant_Impl_Base::get_named_emitters ( - const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ReceptacleDescriptions * - Servant_Impl_Base::get_all_receptacles ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::ReceptacleDescriptions * - Servant_Impl_Base::get_named_receptacles ( - const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::PublisherDescriptions * - Servant_Impl_Base::get_all_publishers ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - ::Components::PublisherDescriptions * - Servant_Impl_Base::get_named_publishers ( - const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)) - { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); - } - - /// Protected operations. - - void - Servant_Impl_Base::add_facet (const char *port_name, - CORBA::Object_ptr port_ref) - { - ::Components::FacetDescription *fd = 0; - ACE_NEW (fd, - OBV_Components::FacetDescription); - ::Components::FacetDescription_var safe = fd; - - fd->name (port_name); - fd->type_id (port_ref->_interface_repository_id ()); - fd->facet_ref (port_ref); - - if (this->facet_table_.bind (port_name, fd) == 0) - { - safe._retn (); - } - } - - CORBA::Object_ptr - Servant_Impl_Base::lookup_facet (const char *port_name) - { - ::Components::FacetDescription_var fd; - - if (this->facet_table_.find (port_name, fd) != 0) - { - return CORBA::Object::_nil (); - } - - return CORBA::Object::_duplicate (fd.in ()->facet_ref ()); - } - - ::Components::FacetDescription * - Servant_Impl_Base::lookup_facet_description (const char *port_name) - { - ::Components::FacetDescription_var fd; - - if (this->facet_table_.find (port_name, fd) != 0) - { - return 0; - } - - return fd._retn (); - } - - void - Servant_Impl_Base::add_consumer ( - const char *port_name, - ::Components::EventConsumerBase_ptr port_ref - ) - { - ::Components::ConsumerDescription *cd = 0; - ACE_NEW (cd, - OBV_Components::ConsumerDescription); - ::Components::ConsumerDescription_var safe = cd; - - cd->name (port_name); - cd->type_id (port_ref->_interface_repository_id ()); - cd->consumer (port_ref); - - if (this->consumer_table_.bind (port_name, cd) == 0) - { - safe._retn (); - } - } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::lookup_consumer (const char *port_name) - { - ::Components::ConsumerDescription_var cd; - - if (this->consumer_table_.find (port_name, cd) != 0) - { - return ::Components::EventConsumerBase::_nil (); - } - - return - ::Components::EventConsumerBase::_duplicate (cd.in ()->consumer ()); - } - - ::Components::ConsumerDescription * - Servant_Impl_Base::lookup_consumer_description ( - const char *port_name - ) - { - ::Components::ConsumerDescription_var cd; - - if (this->consumer_table_.find (port_name, cd) != 0) - { - return 0; - } - - return cd._retn (); - } - - ACE_CString - Servant_Impl_Base::gen_UUID (void) - { - ACE_Utils::UUID* uuid = - ACE_Utils::UUID_GENERATOR::instance ()->generateUUID (); - - const ACE_CString *tmp = uuid->to_string (); - ACE_CString retval = *tmp; - delete uuid; - - return retval; - } - - Components::StandardConfigurator* - Servant_Impl_Base::get_standard_configurator ( - ACE_ENV_SINGLE_ARG_DECL) - { - // Create the configurator servant. - StandardConfigurator_Impl *config_impl = 0; - - ACE_NEW_THROW_EX (config_impl, - StandardConfigurator_Impl (this), - CORBA::NO_MEMORY ()); - - - Components::StandardConfigurator_var configurator = - config_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (Components::StandardConfigurator::_nil ()); - - return configurator._retn (); - } - - PortableServer::POA_ptr - Servant_Impl_Base::_default_POA ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - return - PortableServer::POA::_duplicate (container_->the_POA ()); - } -} diff --git a/TAO/CIAO/ciao/Servant_Impl_Base.h b/TAO/CIAO/ciao/Servant_Impl_Base.h deleted file mode 100644 index ccec2bfd839..00000000000 --- a/TAO/CIAO/ciao/Servant_Impl_Base.h +++ /dev/null @@ -1,224 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Impl_Base.h - * - * $Id$ - * - * This file contains the non-template declaration of a base class for - * the template mixin for the generated servant class. - * - * @author Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_SERVANT_IMPL_BASE_H -#define CIAO_SERVANT_IMPL_BASE_H - -#include /**/ "ace/pre.h" - -#include "ace/Hash_Map_Manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CCM_EventC.h" -#include "CIAO_Server_Export.h" -#include "CCM_ComponentS.h" -#include "CCM_ContainerS.h" -#include "Home_Servant_Impl_Base.h" -#include "Servant_Activator.h" - -namespace CIAO -{ - class Session_Container; - - /** - * @class Servant_Impl_Base - * - * @brief Non-template base class for Servant_Impl. - * - * Holds the non-template parts of its child class - * Servant_Impl. - */ - class CIAO_SERVER_Export Servant_Impl_Base - : public virtual POA_Components::CCMObject - { - public: - explicit Servant_Impl_Base (void); - - Servant_Impl_Base (Components::CCMHome_ptr home, - Home_Servant_Impl_Base *home_servant, - Session_Container * c); - - virtual ~Servant_Impl_Base (void); - - /// Operations for CCMObject interface. - - virtual ::Components::PrimaryKeyBase * - get_primary_key (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::NoKeyAvailable)); - - virtual CORBA::IRObject_ptr - get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void - configuration_complete (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidConfiguration)); - - virtual void - remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)); - - virtual ::Components::ConnectionDescriptions * - get_connections (const char *name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::ComponentPortDescription * - get_all_ports (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Object_ptr - provide_facet (const char *name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::FacetDescriptions * - get_named_facets (const ::Components::NameList & names - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::FacetDescriptions * - get_all_facets (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::ConsumerDescriptions * - get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::EventConsumerBase_ptr - get_consumer (const char *sink_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::EventConsumerBase_ptr - disconnect_consumer (const char *source_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName, - Components::NoConnection)); - - virtual ::Components::ConsumerDescriptions * - get_named_consumers (const ::Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::EmitterDescriptions * - get_all_emitters (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::EmitterDescriptions * - get_named_emitters (const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::ReceptacleDescriptions * - get_all_receptacles (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::ReceptacleDescriptions * - get_named_receptacles (const ::Components::NameList & /* names */ - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - virtual ::Components::PublisherDescriptions * - get_all_publishers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::PublisherDescriptions * - get_named_publishers (const ::Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidName)); - - /// Operation to set attributes on the component. - virtual void set_attributes (const Components::ConfigValues &descr - ACE_ENV_ARG_DECL) = 0; - - // Creates and returns the StandardConfigurator for the component. - virtual Components::StandardConfigurator *get_standard_configurator ( - ACE_ENV_SINGLE_ARG_DECL - ); - - /// Override that returns the (passed-in) default POA of our member - /// component's container, to ensure that we get registered - /// to that POA when _this() is called. - virtual PortableServer::POA_ptr _default_POA ( - ACE_ENV_SINGLE_ARG_DECL - ); - - protected: - void add_facet (const char *port_name, - CORBA::Object_ptr port_ref); - - CORBA::Object_ptr lookup_facet (const char *port_name); - - ::Components::FacetDescription *lookup_facet_description ( - const char *port_name - ); - - void add_consumer (const char *port_name, - ::Components::EventConsumerBase_ptr port_ref); - - ::Components::EventConsumerBase_ptr lookup_consumer ( - const char *port_name - ); - - ::Components::ConsumerDescription *lookup_consumer_description ( - const char *port_name - ); - - // Used to create unique object IDs for port object references. - static ACE_CString gen_UUID (void); - - protected: - typedef ACE_Hash_Map_Manager_Ex<const char *, - ::Components::FacetDescription_var, - ACE_Hash<const char *>, - ACE_Equal_To<const char *>, - ACE_Null_Mutex> - FacetTable; - - typedef ACE_Hash_Map_Manager_Ex<const char *, - ::Components::ConsumerDescription_var, - ACE_Hash<const char *>, - ACE_Equal_To<const char *>, - ACE_Null_Mutex> - ConsumerTable; - - FacetTable facet_table_; - ConsumerTable consumer_table_; - Components::CCMHome_var home_; - Home_Servant_Impl_Base *home_servant_; - Session_Container * container_; - }; -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_SERVANT_IMPL_T_H */ diff --git a/TAO/CIAO/ciao/Servant_Impl_T.cpp b/TAO/CIAO/ciao/Servant_Impl_T.cpp deleted file mode 100644 index 02fb9ae2729..00000000000 --- a/TAO/CIAO/ciao/Servant_Impl_T.cpp +++ /dev/null @@ -1,228 +0,0 @@ -// $Id$ - -#ifndef CIAO_SERVANT_IMPL_T_C -#define CIAO_SERVANT_IMPL_T_C - -#include "Servant_Impl_T.h" - -namespace CIAO -{ - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::Servant_Impl ( - EXEC * exe, - Components::CCMHome_ptr home, - Home_Servant_Impl_Base *home_servant, - Session_Container * c - ) - : Servant_Impl_Base (home, home_servant, c), - executor_ (EXEC::_duplicate (exe)) - { - } - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::~Servant_Impl (void) - { - ACE_TRY_NEW_ENV - { - ::Components::SessionComponent_var scom = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - if (! ::CORBA::is_nil (scom.in ())) - { - scom->ccm_remove (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - this->context_->_remove_ref (); - } - - // Operations for CCMObject interface. - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - CORBA::Boolean - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::same_component ( - CORBA::Object_ptr object_ref - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - if (::CORBA::is_nil (object_ref)) - { - ACE_THROW_RETURN (::CORBA::BAD_PARAM (), 0); - } - - ::CORBA::Object_var the_other = - object_ref->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ::CORBA::Object_var me = - this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return me->_is_equivalent (the_other.in () - ACE_ENV_ARG_PARAMETER); - } - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - ::Components::CCMHome_ptr - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::get_ccm_home ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return this->context_->get_CCM_home (ACE_ENV_SINGLE_ARG_PARAMETER); - } - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - CORBA::Object_ptr - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::_get_component ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionContext_var sc = - ::Components::SessionContext::_narrow ( - this->context_ - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK_RETURN (::CORBA::Object::_nil ()); - - if (! ::CORBA::is_nil (sc.in ())) - { - return sc->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); - } - - ::Components::EntityContext_var ec = - ::Components::EntityContext::_narrow ( - this->context_ - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK_RETURN (::CORBA::Object::_nil ()); - - if (! ::CORBA::is_nil (ec.in ())) - { - return ec->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); - } - - ACE_THROW_RETURN (CORBA::INTERNAL (), - ::CORBA::Object::_nil ()); - } - - // CIAO-specific operations. - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::ciao_preactivate ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; - - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ciao_preactivate (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::ciao_activate ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; - - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::ciao_postactivate ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; - - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ciao_postactivate (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, CONTEXT>::_ciao_passivate ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; - - if (! ::CORBA::is_nil (temp.in ())) - { - temp->ccm_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); - } - } -} - -#endif /* CIAO_SERVANT_IMPL_T_C */ diff --git a/TAO/CIAO/ciao/Servant_Impl_T.h b/TAO/CIAO/ciao/Servant_Impl_T.h deleted file mode 100644 index 5b76e6c986d..00000000000 --- a/TAO/CIAO/ciao/Servant_Impl_T.h +++ /dev/null @@ -1,107 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Impl_T.h - * - * $Id$ - * - * This file contains the declaration of a mixin base class for - * the generated servant class. - * - * @authors Boris Kolpackov <boris@dre.vanderbilt.edu> - * Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_SERVANT_IMPL_T_H -#define CIAO_SERVANT_IMPL_T_H - -#include /**/ "ace/pre.h" - -#include "Servant_Impl_Base.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace CIAO -{ - class Session_Container; - - /** - * @class Servant_Impl - * - * @brief Mixin base class for generated servant. - * - * This class implements navigation and other operations - * common to all generated servants. - */ - template <typename BASE_SKEL, - typename EXEC, - typename EXEC_VAR, - typename CONTEXT> - class Servant_Impl : public virtual BASE_SKEL, - public virtual Servant_Impl_Base - { - public: - Servant_Impl (EXEC * exe, - Components::CCMHome_ptr home, - Home_Servant_Impl_Base *home_servant, - Session_Container * c); - - virtual ~Servant_Impl (void); - - // Operations for CCMObject interface. - - virtual CORBA::Boolean - same_component (CORBA::Object_ptr object_ref - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::Components::CCMHome_ptr - get_ccm_home (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Object_ptr - _get_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // CIAO-specific operations. - - void - ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void - ciao_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void - ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// @@NOTE: The busted operation. - void - _ciao_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - protected: - EXEC_VAR executor_; - - CONTEXT * context_; - }; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Servant_Impl_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Servant_Impl_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_SERVANT_IMPL_T_H */ diff --git a/TAO/CIAO/ciao/ServerActivator_Impl.cpp b/TAO/CIAO/ciao/ServerActivator_Impl.cpp deleted file mode 100644 index 1fe34709998..00000000000 --- a/TAO/CIAO/ciao/ServerActivator_Impl.cpp +++ /dev/null @@ -1,463 +0,0 @@ -// $Id$ - -#include "ServerActivator_Impl.h" -#include "ace/Process.h" -#include "ace/Read_Buffer.h" -#include "ace/OS_NS_stdio.h" -#include "CIAO_common.h" - -#if !defined (__ACE_INLINE__) -# include "ServerActivator_Impl.inl" -#endif /* __ACE_INLINE__ */ - -CIAO::Activator_Callback_Impl::Activator_Callback_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - Components::Deployment::ServerActivator_ptr s, - const Components::ConfigValues &config ) - : orb_ (CORBA::ORB::_duplicate (o)), - poa_ (PortableServer::POA::_duplicate (p)), - activator_ (s) -{ - this->config_ = new Components::ConfigValues (config); -} - -CIAO::Activator_Callback_Impl::~Activator_Callback_Impl () -{ -} - -PortableServer::POA_ptr -CIAO::Activator_Callback_Impl::_default_POA (void) -{ - return PortableServer::POA::_duplicate (this->poa_.in ()); -} - -Components::Deployment::ServerActivator_ptr -CIAO::Activator_Callback_Impl::register_component_server (Components::Deployment::ComponentServer_ptr svr, - Components::ConfigValues_out config - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - config = this->config_._retn (); - - this->server_ = Components::Deployment::ComponentServer::_duplicate (svr); - return Components::Deployment::ServerActivator::_duplicate (this->activator_); -} - -Components::Deployment::ComponentServer_ptr -CIAO::Activator_Callback_Impl::get_server_ref (void) -{ - // Relinquish the ownership of the server reference. This method - // should only be called from the ServerActivator. - return this->server_._retn (); -} - -CIAO::ServerActivator_Impl::~ServerActivator_Impl () -{ - // @@ remove all ComponentServer's? -} - -PortableServer::POA_ptr -CIAO::ServerActivator_Impl::_default_POA (void) -{ - return PortableServer::POA::_duplicate (this->poa_.in ()); -} - -int -CIAO::ServerActivator_Impl::init (const char *server_location, - CORBA::ULong spawn_delay, - const char *installation_ior, - const char *default_svcconf, - const char *svc_conf_map, - const char *extra_flags - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - if (server_location == 0) - ACE_THROW_RETURN (CORBA::BAD_PARAM (), -1); - - if (spawn_delay != 0) - this->spawn_delay_ = spawn_delay; - - // Initialize svc.conf map - if (this->init_svcconf_map (svc_conf_map) != 0) - ACE_THROW_RETURN (CORBA::BAD_PARAM (), -1); - - if (default_svcconf != 0) - this->default_svcconf_file_ = default_svcconf; - - if (extra_flags != 0) - this->extra_flags_ = extra_flags; - - this->server_path_ = CORBA::string_dup (server_location); - - this->installation_ior_ = CORBA::string_dup (installation_ior); - - PortableServer::POAManager_var mgr - = this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - CORBA::PolicyList policies (0); - - // Create a separate POA for callback objects. - this->callback_poa_ = - this->poa_->create_POA ("callback_poa", - mgr.in (), - policies - ACE_ENV_ARG_PARAMETER); - - ACE_CHECK_RETURN (-1); - - // Activate the ServerActivator Object. - PortableServer::ObjectId_var oid - = this->poa_->activate_object (this - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - CORBA::Object_var obj = this->poa_->id_to_reference (oid.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - // And cache the object reference. - this->objref_ = Components::Deployment::ServerActivator::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - this->ior_ = this->orb_->object_to_string (this->objref_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - return 0; -} - -int -CIAO::ServerActivator_Impl::init_svcconf_map (const char *filename) -{ - // It's fine if no svcconf map filename is provided. User assumes - // it's okay to use the default. - if (filename == 0) - return 0; - - FILE *inf = ACE_OS::fopen (filename, "r"); - - if (inf != NULL) - { - ACE_Read_Buffer ior_buffer (inf); - char *data = 0; - - while ((data = ior_buffer.read ('\n')) != 0) - { - ACE_CString aline (data); - - // Each entry line is a comma delimited (hint, pathname) tuple. - ssize_t delpos = aline.find (','); - - // Skip over comments (lines that start with '#' or invalid entries - // (lines without delimitor.) - if (aline[0] == '#' || delpos == ACE_CString::npos) - continue; - - ACE_CString hint = aline.substring (0, delpos); - ACE_CString svcconf_name = aline.substring (delpos+1); - - switch (this->svc_conf_map_.bind (hint, svcconf_name)) - { - case 0: - // All is fine. - // Debug info: - if (CIAO::debug_level () > 10) - ACE_DEBUG ((LM_DEBUG, - "Bound svc.conf hint \"%s\" successfully\n", - hint.c_str ())); - break; - - case 1: - if (CIAO::debug_level () > 10) - ACE_DEBUG ((LM_DEBUG, - "Duplication svc.conf hint \"%s\" found - ignore\n", - hint.c_str ())); - break; - - case -1: - default: - // Unrecoverable error!! - ACE_ERROR_RETURN ((LM_DEBUG, - "Fail to bind svc.conf hint \"%s\" - abort\n", - hint.c_str ()), - -1); - } - } - } - else - ACE_ERROR_RETURN ((LM_ERROR, - "Fail to open svcconf map data file: %s.\n", - filename), - -1); - - return 0; -} - -const char * -CIAO::ServerActivator_Impl::lookup_svcconf_pathname (const char *hint) const -{ - // Change this function to change the strategy of applying svc.conf files. - - if (hint == 0) - { - if (this->default_svcconf_file_.length () > 0) - return this->default_svcconf_file_.c_str (); - else - return 0; - } - - SVCCONF_MAP::ENTRY *entry; - if (this->svc_conf_map_.find (hint, entry) == 0) - return entry->int_id_.c_str (); - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to find matching svc.conf file from hint: %s\n", - hint), - 0); -} - -void -CIAO::ServerActivator_Impl::parse_config_value (const Components::ConfigValues &options, - CompServ_Config_Info &config_info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidConfiguration)) -{ - for (CORBA::ULong l = 0; l < options.length (); ++l) - { - if (ACE_OS::strcmp (options[l]->name (), "CIAO-svcconf-id") == 0) - { - const char *str_in = 0; - if (options[l]->value () >>= str_in) - config_info.svcconf_hint_ = CORBA::string_dup (str_in); - ACE_CHECK; - } - else if (ACE_OS::strcmp (options[l]->name (), "CIAO-rtcad-filename") == 0) - { - const char *str_in = 0; - if (options[l]->value () >>= str_in) - config_info.rtcad_filename_ = CORBA::string_dup (str_in); - ACE_CHECK; - } - else - { - Components::InvalidConfiguration *exc = 0; - - ACE_NEW_THROW_EX (exc, - Components::InvalidConfiguration, - CORBA::NO_MEMORY ()); - - exc->name = CORBA::string_dup (options[l]->name ()); - exc->reason = Components::InvalidConfigValueType; -#if defined (ACE_HAS_EXCEPTIONS) - auto_ptr<Components::InvalidConfiguration> safety (exc); - - // Direct throw because we don't have the ACE_TRY_ENV. - exc->_raise (); -#else - // We can not use ACE_THROW here. - ACE_TRY_ENV.exception (exc); -#endif - } - } -} - - -Components::Deployment::ComponentServer_ptr -CIAO::ServerActivator_Impl::create_component_server (const Components::ConfigValues & config - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CreateFailure, - Components::InvalidConfiguration)) -{ - CompServ_Config_Info config_info; - this->parse_config_value (config, - config_info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (CIAO::debug_level () > 10) - ACE_DEBUG ((LM_DEBUG, "CIAO::ServerActivator_Impl::create_component_server\n")); - - Components::Deployment::ComponentServer_var retval; - - // @@ Need to figure out a way to pass the config data over to the - // ComponentServer. One option will be to convert it (again) into - // an XML document and psss it along in the command line. - - // @@ Create a new callback servant. - CIAO::Activator_Callback_Impl *callback_servant = 0; - ACE_NEW_THROW_EX (callback_servant, - CIAO::Activator_Callback_Impl (this->orb_.in (), - this->callback_poa_.in (), - this->objref_.in (), - config), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (0); - - PortableServer::ServantBase_var servant_var (callback_servant); - PortableServer::ObjectId_var cb_id - = this->callback_poa_->activate_object (callback_servant - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ACE_Process component_server; - ACE_Process_Options options; - - ACE_TRY - { - CORBA::Object_var cb_obj = - this->callback_poa_->id_to_reference (cb_id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CIAO::Activator_Callback_var cb = - CIAO::Activator_Callback::_narrow (cb_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var cb_ior = - this->orb_->object_to_string (cb.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - const char *svcconf_path = - this->lookup_svcconf_pathname (config_info.svcconf_hint_.in ()); - - // spawn the new ComponentServer. - ACE_CString additional_options; - - if (svcconf_path != 0) - { - if (CIAO::debug_level () > 10) - ACE_DEBUG((LM_DEBUG, "Using svcconf file: %s\n", - svcconf_path)); - additional_options += ACE_CString (" -ORBSvcConf "); - additional_options += ACE_CString (svcconf_path); - } - - if (config_info.rtcad_filename_.in () != 0) - { - ACE_DEBUG((LM_DEBUG, "Using RTCAD file: %s\n", - config_info.rtcad_filename_.in ())); - additional_options += ACE_CString (" -r "); - additional_options += ACE_CString (config_info.rtcad_filename_.in ()); - } - - additional_options += " "; - additional_options += this->extra_flags_; - - options.command_line ("%s -k %s -ORBInitRef ComponentInstallation=%s " - "%s", - this->server_path_.in (), - cb_ior.in (), - this->installation_ior_.in (), - additional_options.c_str ()); - - options.avoid_zombies (1); - - if (component_server.spawn (options) == -1) - { - ACE_DEBUG ((LM_ERROR, "Fail to spawn a ComponentServer process\n")); - ACE_TRY_THROW (Components::CreateFailure ()); - } - - // wait for server to pass back its object reference. with a timeout value. - // using perform_work and stuff. - - int looping = 1; - - ACE_Time_Value timeout (this->spawn_delay_, 0); - - while (looping) - { - this->orb_->perform_work (timeout - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - retval = callback_servant->get_server_ref (); - - if (timeout == ACE_Time_Value::zero || !CORBA::is_nil (retval.in ())) - looping = 0; - } - - if (CORBA::is_nil (retval.in ())) - { - ACE_DEBUG ((LM_ERROR, "Fail to acquire the ComponentServer object\n")); - ACE_TRY_THROW (Components::CreateFailure ()); - } - - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - - // Add the server reference to this->cs_set_; - this->cs_set_.add (retval.in ()); - } - } - ACE_CATCHANY - { - this->callback_poa_->deactivate_object (cb_id.in ()); - ACE_TRY_CHECK; - - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (0); - - this->callback_poa_->deactivate_object (cb_id.in ()); - ACE_CHECK_RETURN (0); - - return retval._retn (); -} - -void -CIAO::ServerActivator_Impl::remove_component_server (Components::Deployment::ComponentServer_ptr server - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) -{ - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); - - if (this->cs_set_.object_in_set (server) == 0) - ACE_THROW (Components::RemoveFailure ()); - - server->remove (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // Should we remove the server still even if the previous call failed. - - if (this->cs_set_.remove (server) == -1) - ACE_THROW (Components::RemoveFailure ()); -} - -Components::Deployment::ComponentServers * -CIAO::ServerActivator_Impl::get_component_servers (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - - Components::Deployment::ComponentServers_var retval; - - ACE_NEW_THROW_EX (retval.out (), - Components::Deployment::ComponentServers (), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (0); - - CORBA::ULong len = this->cs_set_.size (); - retval->length (len); // resize - -#if 0 - // TAO is broken here. Both <replace>, <get_buffer> and friends are missing. - this->cs_set_.copy (len, retval->get_buffer (0)); -#else - for (CORBA::ULong i = 0; i < len; ++i) - { - retval[i] = this->cs_set_.at (i); - } -#endif - - return retval._retn (); -} diff --git a/TAO/CIAO/ciao/ServerActivator_Impl.h b/TAO/CIAO/ciao/ServerActivator_Impl.h deleted file mode 100644 index 3aeace7dada..00000000000 --- a/TAO/CIAO/ciao/ServerActivator_Impl.h +++ /dev/null @@ -1,265 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServerActivator_Impl.h - * - * $Id$ - * - * This file contains implementation for the servant of - * Components::Deployment::ServerActivator interface. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ -//============================================================================= - - -#ifndef CIAO_SERVERACTIVATOR_IMPL_H -#define CIAO_SERVERACTIVATOR_IMPL_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CCM_DeploymentS.h" -#include "CIAO_ServersS.h" -#include "Object_Set_T.h" - -#include "ace/Hash_Map_Manager_T.h" -#include "ace/SString.h" - - -namespace CIAO -{ - /** - * @class Activator_Callback - * - * @brief A call back interface for ComponentServer. - * - * Notice that this implementation is *NOT* thread-safe. - */ - class CIAO_SERVER_Export Activator_Callback_Impl - : public virtual POA_CIAO::Activator_Callback - { - public: - friend class ServerActivator_Impl; - - /// Constructor. - Activator_Callback_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - Components::Deployment::ServerActivator_ptr s, - const Components::ConfigValues &cofig); - - /// Destructor. - ~Activator_Callback_Impl (); - - /// Get the containing POA. This operation does *not* - /// increase the reference count of the POA. - virtual PortableServer::POA_ptr _default_POA (void); - - /// Record the ComponentServer reference returned by the newly - /// spawned ComponentServer and give it back a reference to ServerActivator. - Components::Deployment::ServerActivator_ptr - register_component_server (Components::Deployment::ComponentServer_ptr svr, - Components::ConfigValues_out config - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - protected: - Components::Deployment::ComponentServer_ptr get_server_ref (void); - - CORBA::ORB_var orb_; - - PortableServer::POA_var poa_; - - /// This servant only lives as long as a call to the - /// create_component_server method in ServerActivator, so there's - /// no need to duplicate the object reference here. - Components::Deployment::ServerActivator_ptr activator_; - - Components::Deployment::ComponentServer_var server_; - - Components::ConfigValues_var config_; - }; - - /** - * @class ServerActivator_Impl - * - * @brief Servant implementation for Components::Deployment::ServerActivator - * - * This class implements the Components::Deployment::ServerActivator - * interface as defined by the CCM spcification. As the interface - * implies, this is actually part of the deployment interface and is - * used to manage the lifecycle of containers running on the server. - */ - class CIAO_SERVER_Export ServerActivator_Impl - : public virtual POA_Components::Deployment::ServerActivator - { - public: - /// Constructor - ServerActivator_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p); - - /// Destructor - virtual ~ServerActivator_Impl (void); - - /// Get the containing POA. This operation does *not* - /// increase the reference count of the POA. - virtual PortableServer::POA_ptr _default_POA (void); - - /** - * Initialize the ServerActivator. The currently implementation - * of ServerActivator can only activate CIAO's own - * ComponentServer processes. You should specify the location - * (pathname) of the ComponentServer and the delay - * ServerActivator should wait (in second) for ComponentServer to - * call back. - * - * @param server_location A null-termiated char * string pointing - * to the pathname of a ComponentServer executable. - - * @param delay instructs how long (in second) a ServerActivator - * should wait for a newly spawned ComponentServer to pass back - * its IOR. - * - * @param installation_ior A null-terminated char * string - * pointing to the stringified IOR of a ComponentInstallation that - * ComponentServer can use to location component implementation DLL. - * - * @param default_svcconf A null-terminated char * string pointing - * to the pathname of the default svcconf file a ComponentServer - * should use (specified using -ORBSvcConfFile) if no hint is given. - * - * @param svcconf_map_file A null-terminated char * string - * pointing to the pathname of a (hint, svcconf pathname) map. - */ - int init (const char *server_location, - CORBA::ULong delay, - const char *installation_ior, - const char *default_svcconf, - const char *svcconf_map_file, - const char *extra_cmdline_flags - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Components::Deployment::ServerActivator defined attributes/operations. - - virtual Components::Deployment::ComponentServer_ptr - create_component_server (const Components::ConfigValues & config - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CreateFailure, - Components::InvalidConfiguration)); - - virtual void remove_component_server (Components::Deployment::ComponentServer_ptr server - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)); - - virtual Components::Deployment::ComponentServers * - get_component_servers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the cached ServerActivator object reference. Do not - /// release this object reference, or put it into an var. - Components::Deployment::ServerActivator_ptr - _ciao_get_objref (void); - - const char *_ciao_get_ior (void); - - protected: - /** - * Contains the information extracted from - * create_component_server's ConfigValue argument that - * ServerActivation cares. - */ - typedef struct CS_config - { - // ConfigValue::name: CIAO-svcconf-id - CORBA::String_var svcconf_hint_; - - // ConfigValue::Name: CIAO-rtcad-filename - CORBA::String_var rtcad_filename_; - } CompServ_Config_Info; - - /** - * Initialize svc_conf_map_ with the supplied filename. - */ - int init_svcconf_map (const char *map_file); - - /** - * Returns the pathname to the effective svc.conf file based on - * "hint." It may return the default svc.conf file when there's - * no hint (hint == 0) and we do have a default svc.conf path. - */ - const char *lookup_svcconf_pathname (const char *hint) const; - - /** - * Parse the ConfigValue arguement of the function - * create_component_server and extractg the information into - */ - void parse_config_value (const Components::ConfigValues &options, - CompServ_Config_Info &config_info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::InvalidConfiguration)); - - - protected: - /// location of the ComponentServer. - CORBA::String_var server_path_; - - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; - - /// Keep a pointer to the managing POA. - PortableServer::POA_var poa_; - - /// Child poa that uses active object map. - PortableServer::POA_var callback_poa_; - - /// Cached the IOR string to ComponentInstallation Interface - CORBA::String_var installation_ior_; - - /// Specify the time in second ServerActivator will wait for a - /// child ComponentServer to callback. Default is 5 second. - CORBA::ULong spawn_delay_; - - /// Cache a object reference to this servant. - Components::Deployment::ServerActivator_var objref_; - - /// Cache the ior of the previous reference - CORBA::String_var ior_; - - /// Synchronize access to the object set. - TAO_SYNCH_MUTEX lock_; - - /// Default svc.conf filename. - ACE_CString default_svcconf_file_; - - /// Extra command line flags - ACE_CString extra_flags_; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ACE_CString, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> SVCCONF_MAP; - - /// Map of (canonical svc.conf id, svc.conf) mapping - SVCCONF_MAP svc_conf_map_; - - /// Keep a list of managed ComponentServer objects. - Object_Set<Components::Deployment::ComponentServer, Components::Deployment::ComponentServer_var> cs_set_; - }; -} - -#if defined (__ACE_INLINE__) -# include "ServerActivator_Impl.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_SERVERACTIVATOR_IMPL_H */ diff --git a/TAO/CIAO/ciao/ServerActivator_Impl.inl b/TAO/CIAO/ciao/ServerActivator_Impl.inl deleted file mode 100644 index 845900c53db..00000000000 --- a/TAO/CIAO/ciao/ServerActivator_Impl.inl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -CIAO::ServerActivator_Impl::ServerActivator_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p) - : orb_ (CORBA::ORB::_duplicate (o)), - poa_ (PortableServer::POA::_duplicate (p)), - spawn_delay_ (5) -{ -} - -ACE_INLINE ::Components::Deployment::ServerActivator_ptr -CIAO::ServerActivator_Impl::_ciao_get_objref () -{ - return this->objref_.in (); -} - -ACE_INLINE const char * -CIAO::ServerActivator_Impl::_ciao_get_ior () -{ - return this->ior_.in (); -} diff --git a/TAO/CIAO/ciao/ServerResources.idl b/TAO/CIAO/ciao/ServerResources.idl new file mode 100644 index 00000000000..3e90b2dfedf --- /dev/null +++ b/TAO/CIAO/ciao/ServerResources.idl @@ -0,0 +1,237 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO/tests/Param_Test +// +// = FILENAME +// ServerResrouces.idl +// +// = DESCRIPTION +// A collection of IDL data types for +// +// = AUTHORS +// Nanbor Wang +// +// ============================================================================ + +#if !defined (CIAO_SERVERRESOURCES_IDL) +#define CIAO_SERVERRESOURCES_IDL + +#include <orb.idl> + +module CIAO +{ + module DAnCE + { + /** + * @brief A single command line argument corresponds to a string as + * in the case of "argv". + */ + typedef string CommandlineArg; + /** + * @brief A list of command line arguments which a + * NodeApplicationManager will use to start up the NodeApplication + * this list is associated to. The command line arguments will be + * appended to the command line in order. + */ + typedef sequence<CommandlineArg> CommandlineArgs; + + /** + * @brief A string containing the filename of the svc.conf file the + * NodeApplication uses. The current approach of specifying + * svc.conf filename directly some harder problems such as + * distribution of svc.conf files and the relative/absolute path to + * the svc.conf file (the ServerResrouces xml document will have to + * assume the svc.conf file will be available at specific location.) + */ + typedef string SvcconfURI; + + /** + * @breif enumeration of ORB Resource Types (ORT) supported in RT + * extension. + */ + enum ORBResourceType + { + ORT_THREADPOOL, + ORT_THREADPOOLWITHLANES, + ORT_CONNECTIONBANDS + }; + + typedef short Priority; + + /** + * @brief Define a threadpool resource that an ORB must provide + */ + struct ORS_Threadpool + { + string Id; + unsigned long stacksize; + unsigned long static_threads; + unsigned long dynamic_threads; + Priority default_priority; + boolean allow_request_buffering; + unsigned long max_buffered_requests; + unsigned long max_request_buffer_size; + }; + + /** + * @brief Defines the configuration of a threadpool lane. We need + * to redefine it here to avoid dependency to RTCORBA library. + */ + struct ORS_ThreadpoolLane + { + Priority lane_priority; + unsigned long static_threads; + unsigned long dynamic_threads; + }; + + /** + * @brief Defines a set of threadpool lanes. We need + * to redefine it here to avoid dependency to RTCORBA library. + */ + typedef sequence<ORS_ThreadpoolLane> ORS_ThreadpoolLanes; + + /** + * @brief Defines a Threadpool with Lanes resource that an ORB + * must provide. + */ + struct ORS_ThreadpoolWithLanes + { + string Id; + unsigned long stacksize; + ORS_ThreadpoolLanes threadpool_lanes; + boolean allow_borrowing; + boolean allow_request_buffering; + unsigned long max_buffered_requests; + unsigned long max_request_buffer_size; + }; + + /** + * @brief Define a priority band for BandedConnection policies. + */ + struct ORS_PriorityBand + { + Priority low; + Priority high; + }; + /** + * @brief Define a list of priority bands for BandedConnection + * policies. + */ + typedef sequence<ORS_PriorityBand> ORS_PriorityBands; + + /** + * @brief Define the information needed to create a + * BandedConnection policy. This info can be referred to via its + * name (Id). + */ + struct ORS_ConnectionBands + { + string Id; + ORS_PriorityBands bands; + }; + + /** + * @brief Collection of resources managed by the NodeApplication + * ORB. + */ + struct ORBResource + { + sequence<ORS_Threadpool> threadpool_list; + + sequence<ORS_ThreadpoolWithLanes> threadpool_with_lanes_list; + + sequence<ORS_ConnectionBands> connection_bands_list; + }; + + typedef sequence<ORBResource, 1> ORBResources; + + // ================================================================= + + /** + * @brief PolicyType supported by DAnCE extension. Again, we are + * redefining these value to avoid dependencies to various ORB + * modules such as RTCORBA. + */ + const CORBA::PolicyType PRIORITY_MODEL_POLICY_TYPE = 40; + const CORBA::PolicyType THREADPOOL_POLICY_TYPE = 41; + const CORBA::PolicyType PRIORITY_BANDED_CONNECTION_POLICY_TYPE = 45; + + enum PriorityModel + { + CLIENT_PROPAGATED, + SERVER_DECLARED + }; + + /** + * @brief Defines data required for creating a PriorityModel Policy + */ + struct PriorityModelPolicyDef + { + PriorityModel priority_model; + Priority server_priority; + }; + + /** + * @brief Define data required for creating a Threadpool policy + */ + struct ThreadpoolPolicyDef + { + string Id; // Threadpool name defined in + // ORBResource + }; + + /** + * @brief Define data required for creating a PriorityBandedConnection + * policy + */ + struct PriorityBandedConnectionPolicyDef + { + string Id; // PriorityBands name defined in + // ORBResource + }; + + union PolicyDef switch (CORBA::PolicyType) + { + case 40: PriorityModelPolicyDef PriorityModelDef; + case 41: ThreadpoolPolicyDef ThreadpoolDef; + case 45: PriorityBandedConnectionPolicyDef PriorityBandedConnectionDef; + }; + + /** + * @brief Define a set of policy definitions. + */ + typedef sequence<PolicyDef> PolicyDefs; + + /** + * @brief A policy set is named. + */ + struct PolicySet + { + string Id; // Name of this policy set + PolicyDefs policies; + }; + + /** + * @brief A list of all policy sets. + */ + typedef sequence<PolicySet> PolicySets; + + struct ORBConfigs + { + ORBResources orb_resources; + PolicySets policy_set; + }; + + struct ServerResource + { + CommandlineArgs args; + SvcconfURI svcconf; + ORBConfigs orb_config; + }; + }; +}; + +#endif /* CIAO_SERVERRESOURCES_IDL */ diff --git a/TAO/CIAO/ciao/Server_init.cpp b/TAO/CIAO/ciao/Server_init.cpp deleted file mode 100644 index 43eaabcd598..00000000000 --- a/TAO/CIAO/ciao/Server_init.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// $Id$ - -#include "Server_init.h" -#include "CIAO_common.h" -#include "CCM_ComponentC.h" -#include "Cookies.h" - -#include "ace/OS_NS_stdio.h" - -int -CIAO::Server_init (CORBA::ORB_ptr o) -{ - CIAO_REGISTER_VALUE_FACTORY (o, CIAO::Map_Key_Cookie_init, - Components::Cookie); - CIAO_REGISTER_VALUE_FACTORY (o, CIAO::Map_Key_Cookie_init, - CIAO::Cookie); - CIAO_REGISTER_VALUE_FACTORY (o, Components::PortDescription_init, - Components::PortDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::FacetDescription_init, - Components::FacetDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ConnectionDescription_init, - Components::ConnectionDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ReceptacleDescription_init, - Components::ReceptacleDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ConsumerDescription_init, - Components::ConsumerDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::EmitterDescription_init, - Components::EmitterDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::SubscriberDescription_init, - Components::SubscriberDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::PublisherDescription_init, - Components::PublisherDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ConfigValue_init, - Components::ConfigValue); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ComponentPortDescription_init, - Components::ComponentPortDescription); - return 0; -} - -int -CIAO::Utility::write_IOR (const char *pathname, - const char *ior) -{ - FILE* ior_output_file_ = - ACE_OS::fopen (pathname, "w"); - - if (ior_output_file_) - { - ACE_OS::fprintf (ior_output_file_, - "%s", - ior); - ACE_OS::fclose (ior_output_file_); - return 0; - } - - return -1; -} diff --git a/TAO/CIAO/ciao/Server_init.h b/TAO/CIAO/ciao/Server_init.h deleted file mode 100644 index d2cbfcc04f5..00000000000 --- a/TAO/CIAO/ciao/Server_init.h +++ /dev/null @@ -1,50 +0,0 @@ -// $Id$ - -/** - * @file Server_init.h - * - * Initializing CIAO Server side ORB, if they need to. - * I'm also puting some utilities functions here. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef CIAO_SERVER_INIT_H -#define CIAO_SERVER_INIT_H -#include /**/ "ace/pre.h" - -#include "CIAO_Server_Export.h" - -#if !defined ACE_LACKS_PRAGMA_ONCE -#pragma once -#endif /* ! ACE_LACKS_PRAGMA_ONCE */ - -namespace CORBA -{ - class ORB; - typedef ORB *ORB_ptr; -} - -namespace CIAO -{ - /** - * The initialize routine for any server that need to access - * component. This routine now simply registers various valuetype - * factories defined in CIAO_Component.pidl. Currently, this method - * should be call right after ORB initialization but we should try - * to register these stuff automatically. - */ - CIAO_SERVER_Export int Server_init (CORBA::ORB_ptr o); - - namespace Utility - { - /// Write a string (usually a stringified IOR) to a file - /// designated by the @c pathname. The file named will always get - /// overwritten. - CIAO_SERVER_Export int write_IOR (const char *pathname, - const char *IOR); - } -} - -#include /**/ "ace/post.h" -#endif /* CIAO_SERVER_INIT_H */ diff --git a/TAO/CIAO/ciao/StandardConfigurator_Impl.cpp b/TAO/CIAO/ciao/StandardConfigurator_Impl.cpp deleted file mode 100644 index ae39266cf6b..00000000000 --- a/TAO/CIAO/ciao/StandardConfigurator_Impl.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// StandardConfigurator.cpp,v 1.0 2004/14/04 08:47:46 white Exp - -#include "StandardConfigurator_Impl.h" -#include "Servant_Impl_Base.h" - -ACE_RCSID (ciao, - StandardConfigurator_Impl, - "$Id$") - - -namespace CIAO -{ - StandardConfigurator_Impl::StandardConfigurator_Impl ( - Servant_Impl_Base* servant) - : component_ (servant) - { - } - - StandardConfigurator_Impl::~StandardConfigurator_Impl () - { - } - - void - StandardConfigurator_Impl::set_configuration ( - const Components::ConfigValues &descr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - this->component_->set_attributes (descr - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - StandardConfigurator_Impl::configure ( - Components::CCMObject_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::WrongComponentType)) - { - - } -} diff --git a/TAO/CIAO/ciao/StandardConfigurator_Impl.h b/TAO/CIAO/ciao/StandardConfigurator_Impl.h deleted file mode 100644 index c8a884164d7..00000000000 --- a/TAO/CIAO/ciao/StandardConfigurator_Impl.h +++ /dev/null @@ -1,78 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file StandardConfigurator_Impl.h - * - * $Id$:StandardConfigurator_Impl.h,v 1.0 2004/08/12 20:00:00 jules - * - * This file contains implementation for the servant of - * Components::StandardConfigurator interface. - * - * @author Jules White <jules@dre.vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_STANDARDCONFIGURATOR_IMPL_H -#define CIAO_STANDARDCONFIGURATOR_IMPL_H -# include /**/ "ace/pre.h" - -#include "CCM_ComponentS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CIAO_Server_Export.h" -#include "Servant_Impl_Base.h" - -namespace CIAO -{ - - - /** - * @class StandardConfigurator_Impl - * - * @brief Servant implementation for Components::StandardConfigurator - * - * This class implements the Components::StandardConfigurator - * interface as defined by the CCM spcification. This class aids - * in setting the initial values of component attributes that are - * defined in the meta data. - */ - class CIAO_SERVER_Export StandardConfigurator_Impl - : public virtual POA_Components::StandardConfigurator - { - public: - /// Constructor - StandardConfigurator_Impl (Servant_Impl_Base* toconfigure); - - /// Destructor - virtual ~StandardConfigurator_Impl (void); - - - /// This method will call set_attributes on the component that is - /// being configured, i.e, the template method from - /// StandardConfigurator interface. - virtual void set_configuration ( - const Components::ConfigValues & descr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void configure ( - Components::CCMObject_ptr comp - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::WrongComponentType)); - - private: - /// The component whose attributes are going to be configured via - /// set_attributes - Servant_Impl_Base* component_; - }; - -} - -#include /**/ "ace/post.h" -#endif /* CIAO_STANDARDCONFIGURATOR_IMPL_H */ diff --git a/TAO/CIAO/ciao/SwapExec.idl b/TAO/CIAO/ciao/SwapExec.idl new file mode 100644 index 00000000000..1a6d00c3575 --- /dev/null +++ b/TAO/CIAO/ciao/SwapExec.idl @@ -0,0 +1,13 @@ +// $Id$ + +#include "CCM_Container.idl" + + +module CIAO +{ + local interface Swap_Exec : ::Components::EnterpriseComponent + { + Components::EnterpriseComponent incarnate (); + Components::EnterpriseComponent etherealize (); + }; +}; diff --git a/TAO/CIAO/ciao/Swapping_Container.cpp b/TAO/CIAO/ciao/Swapping_Container.cpp new file mode 100644 index 00000000000..d8884ef371d --- /dev/null +++ b/TAO/CIAO/ciao/Swapping_Container.cpp @@ -0,0 +1,302 @@ +// $Id$ + +#include "Container_Base.h" +#include "Swapping_Container.h" +#include "ace/DLL.h" +#include "tao/Utils/PolicyList_Destroyer.h" +#include "ace/OS_NS_stdio.h" + +#if !defined (__ACE_INLINE__) +# include "Swapping_Container.inl" +#endif /* __ACE_INLINE__ */ + +namespace CIAO +{ + + ACE_Atomic_Op <ACE_SYNCH_MUTEX, long> + Swapping_Container::serial_number_ (0); + + Swapping_Container::Swapping_Container (CORBA::ORB_ptr o, + Container_Impl *container_impl) + : Session_Container (o, container_impl), + number_ (0) + { + } + + Swapping_Container::~Swapping_Container () + { + } + + PortableServer::POA_ptr + Swapping_Container::the_home_servant_POA (void) const + { + return this->home_servant_poa_.in (); + } + + CORBA::Object_ptr + Swapping_Container::get_home_objref (PortableServer::Servant p + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->the_home_servant_POA ()->servant_to_reference (p + ACE_ENV_ARG_PARAMETER); + } + + void + Swapping_Container::deactivate_facet (const PortableServer::ObjectId &oid + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->the_facet_cons_POA ()->deactivate_object (oid + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + int + Swapping_Container::init (const char *name, + const CORBA::PolicyList *more_policies + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + char buffer[MAXPATHLEN]; + + if (name == 0) + { + this->number_ = ++Swapping_Container::serial_number_; + ACE_OS::sprintf (buffer, "CIAO::Swapping_Container-%ld", + this->number_); + name = buffer; + } + + CORBA::Object_var poa_object = + this->orb_->resolve_initial_references("RootPOA" + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + if (CORBA::is_nil (poa_object.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + -1); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + + this->create_servant_POA (name, + more_policies, + root_poa.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + + + this->create_home_servant_POA ("home servant POA", + more_policies, + root_poa.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + this->create_connections_POA (root_poa.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + + return 0; + } + + void + Swapping_Container::add_servant_map + (PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant) + { + this->dsa_->add_servant_map (oid, servant); + } + + void + Swapping_Container::delete_servant_map + (PortableServer::ObjectId &oid) + { + this->dsa_->delete_servant_map (oid); + } + + void + Swapping_Container::create_home_servant_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root + ACE_ENV_ARG_DECL) + { + CORBA::PolicyList policies (0); + + if (p != 0) + policies = *p; + + PortableServer::POAManager_var poa_manager = + root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + + this->home_servant_poa_ = + root->create_POA (name, + poa_manager.in (), + policies + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + void + Swapping_Container::create_connections_POA ( + PortableServer::POA_ptr root + ACE_ENV_ARG_DECL) + { + PortableServer::POAManager_var poa_manager = + root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + TAO::Utils::PolicyList_Destroyer policies (3); + policies.length (3); + + policies[0] = + root->create_id_assignment_policy (PortableServer::USER_ID + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + policies[1] = + root->create_request_processing_policy + (PortableServer::USE_SERVANT_MANAGER + ACE_ENV_ARG_PARAMETER); + + ACE_CHECK; + + // Servant Retention Policy + policies[2] = + root->create_servant_retention_policy (PortableServer::RETAIN + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->facet_cons_poa_ = + root->create_POA ("facet_consumer_poa", + poa_manager.in (), + policies + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + ACE_NEW_THROW_EX (this->sa_, + Servant_Activator (this->orb_.in ()), + CORBA::NO_MEMORY ()); + + this->facet_cons_poa_->set_servant_manager ( + this->sa_ + ACE_ENV_ARG_PARAMETER); + + ACE_CHECK; + } + + void + Swapping_Container::create_servant_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root + ACE_ENV_ARG_DECL) + { + // @@ Jai, see how this method more or less does things (like + // setting policies) like create_connections_POA (). Could you + // please refactor them into a seperate method? + CORBA::PolicyList policies (0); + + if (p != 0) + policies = *p; + + PortableServer::POAManager_var poa_manager = + root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + CORBA::ULong policy_length = policies.length (); + policies.length (policy_length + 1); + policies[policy_length] = + root->create_id_assignment_policy (PortableServer::USER_ID + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + policy_length = policies.length (); + policies.length (policy_length + 1); + policies[policy_length] = + root->create_request_processing_policy ( + PortableServer::USE_SERVANT_MANAGER + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + policy_length = policies.length (); + policies.length (policy_length + 1); + policies[policy_length] = + root->create_servant_retention_policy (PortableServer::RETAIN + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->component_poa_ = + root->create_POA (name, + poa_manager.in (), + policies + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + ACE_NEW_THROW_EX (this->dsa_, + Dynamic_Component_Activator (this->orb_.in ()), + CORBA::NO_MEMORY ()); + + this->component_poa_->set_servant_manager ( + this->dsa_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + } + + void + Swapping_Container::ciao_uninstall_home (Components::CCMHome_ptr homeref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + PortableServer::POA_ptr tmp = this->home_servant_poa_.in (); + PortableServer::ObjectId_var oid = + tmp->reference_to_id (homeref + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + tmp->deactivate_object (oid.in () + ACE_ENV_ARG_PARAMETER); + } + + CORBA::Object_ptr + Swapping_Container::install_servant (PortableServer::Servant p, + Container::OA_Type t + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + PortableServer::POA_ptr tmp = 0; + + if (t == Container::Component) + { + tmp = this->home_servant_poa_.in (); + } + else + tmp = this->facet_cons_poa_.in (); + + PortableServer::ObjectId_var oid + = tmp->activate_object (p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Object_var objref + = tmp->id_to_reference (oid.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return objref._retn (); + } +} diff --git a/TAO/CIAO/ciao/Swapping_Container.h b/TAO/CIAO/ciao/Swapping_Container.h new file mode 100644 index 00000000000..9f107cd1b46 --- /dev/null +++ b/TAO/CIAO/ciao/Swapping_Container.h @@ -0,0 +1,133 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Swapping_Container.h + * + * $Id$ + * + * Header file for CIAO's Dynamic Swapping container implementations + * + * @author Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu> + * Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= + + +#ifndef CIAO_SWAPPING_CONTAINER_H +#define CIAO_SWAPPING_CONTAINER_H +#include /**/ "ace/pre.h" + +// @@ Jai, are all these inclusions necessary? Please cut down on them +// to a minimum +#include "tao/ORB.h" +#include "tao/PortableServer/PortableServer.h" +#include "tao/PortableServer/Servant_Base.h" +#include "ciao/CCM_ContainerC.h" +#include "ciao/Container_Base.h" +#include "ciao/Deployment_CoreC.h" +#include "ciao/Dynamic_Component_Activator.h" +#include "ciao/CIAO_Server_Export.h" +#include "ciao/Servant_Activator.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO +{ + class Dynamic_Component_Servant_Base; + + class CIAO_SERVER_Export Swapping_Container : public Session_Container + { + public: + + Swapping_Container (CORBA::ORB_ptr o, Container_Impl *container_impl); + + virtual ~Swapping_Container (void); + + /// Initialize the container with a name. + virtual int init (const char *name = 0, + const CORBA::PolicyList *more_policies = 0 + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Object_ptr install_servant (PortableServer::Servant p, + Container::OA_Type t + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Object_ptr get_objref (PortableServer::Servant p + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void ciao_uninstall_home (Components::CCMHome_ptr homeref + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Object_ptr get_home_objref (PortableServer::Servant p + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void add_servant_map (PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant); + + virtual void delete_servant_map (PortableServer::ObjectId &oid); + + virtual void deactivate_facet (const PortableServer::ObjectId &oid + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + PortableServer::POA_ptr the_home_servant_POA (void) const; + + private: + + /// Create POA for the component. + void create_servant_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root + ACE_ENV_ARG_DECL); + + void create_home_servant_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root + ACE_ENV_ARG_DECL); + + void create_connections_POA (PortableServer::POA_ptr root + ACE_ENV_ARG_DECL); + protected: + long number_; + + // @@ Jai, why should this be static? + static ACE_Atomic_Op <ACE_SYNCH_MUTEX, long> serial_number_; + + Dynamic_Component_Activator *dsa_; + + }; +} + +// Macro for registration of an OBV factory in the generated +// servant class. Similar to the macro for TAO in +// tao/ValueType/ValueFactory.h but here we take advantage of +// the fact that we have access to the current ORB indirectly +// through the context and container. +// @@Jai, is this macro required here? +#define CIAO_REGISTER_OBV_FACTORY(FACTORY, VALUETYPE) \ + { \ + CORBA::ValueFactory factory = new FACTORY; \ + CORBA::ORB_ptr orb = \ + this->context_->_ciao_the_Container ()->the_ORB (); \ + CORBA::ValueFactory prev_factory = \ + orb->register_value_factory ( \ + VALUETYPE::_tao_obv_static_repository_id (), \ + factory); \ + CORBA::remove_ref (prev_factory); \ + CORBA::add_ref (factory); \ + } + +#if defined (__ACE_INLINE__) +# include "Swapping_Container.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" +#endif /* CIAO_SWAPPING_CONTAINER_H */ diff --git a/TAO/CIAO/ciao/Container_Base.inl b/TAO/CIAO/ciao/Swapping_Container.inl index 0d6aeef9bcc..b2c00a33346 100644 --- a/TAO/CIAO/ciao/Container_Base.inl +++ b/TAO/CIAO/ciao/Swapping_Container.inl @@ -1,16 +1,10 @@ -// $Id$ -*- C++ -*- +// $Id$ ACE_INLINE CORBA::Object_ptr -CIAO::Session_Container::get_objref (PortableServer::Servant p +CIAO::Swapping_Container::get_objref (PortableServer::Servant p ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { return this->the_POA ()->servant_to_reference (p ACE_ENV_ARG_PARAMETER); } - -ACE_INLINE CIAO::Servant_Activator * -CIAO::Session_Container::ports_servant_activator (void) const -{ - return this->sa_; -} diff --git a/TAO/CIAO/ciao/Home_Servant_Impl_Base.cpp b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_Base.cpp index 5520c193be7..9f799ae08aa 100644 --- a/TAO/CIAO/ciao/Home_Servant_Impl_Base.cpp +++ b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_Base.cpp @@ -1,27 +1,28 @@ // $Id$ -#include "Home_Servant_Impl_Base.h" +#include "Swapping_Servant_Home_Impl_Base.h" namespace CIAO { - Home_Servant_Impl_Base::Home_Servant_Impl_Base (void) + Swapping_Home_Servant_Impl_Base::Swapping_Home_Servant_Impl_Base (void) { ACE_ASSERT (0); } - Home_Servant_Impl_Base::Home_Servant_Impl_Base (Session_Container * c) + Swapping_Home_Servant_Impl_Base::Swapping_Home_Servant_Impl_Base + (Swapping_Container * c) : container_ (c) { } - Home_Servant_Impl_Base::~Home_Servant_Impl_Base (void) + Swapping_Home_Servant_Impl_Base::~Swapping_Home_Servant_Impl_Base (void) { } // Operations for CCMHome interface. CORBA::IRObject_ptr - Home_Servant_Impl_Base::get_component_def ( + Swapping_Home_Servant_Impl_Base::get_component_def ( ACE_ENV_SINGLE_ARG_DECL ) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -31,7 +32,7 @@ namespace CIAO } CORBA::IRObject_ptr - Home_Servant_Impl_Base::get_home_def ( + Swapping_Home_Servant_Impl_Base::get_home_def ( ACE_ENV_SINGLE_ARG_DECL ) ACE_THROW_SPEC ((CORBA::SystemException)) diff --git a/TAO/CIAO/ciao/Home_Servant_Impl_Base.h b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_Base.h index bbca2a430ad..ed02e055c9d 100644 --- a/TAO/CIAO/ciao/Home_Servant_Impl_Base.h +++ b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_Base.h @@ -2,20 +2,16 @@ //============================================================================= /** - * @file Home_Servant_Impl_Base.h + * @file Swapping_Servant_Home_Impl_Base.h * * $Id$ * - * This file contains the non-template declaration of a base class for - * the template mixin for the generated home servant class. - * - * @author Jeff Parsons <j.parsons@vanderbilt.edu> */ //============================================================================= -#ifndef CIAO_HOME_SERVANT_IMPL_BASE_H -#define CIAO_HOME_SERVANT_IMPL_BASE_H +#ifndef CIAO_SWAPPING_SERVANT_HOME_IMPL_BASE_H +#define CIAO_SWAPPING_SERVANT_HOME_IMPL_BASE_H #include /**/ "ace/pre.h" @@ -29,28 +25,29 @@ namespace CIAO { - class Session_Container; + class Swapping_Container; /** - * @class Home_Servant_Impl_Base - * - * @brief Non-template base class for Home_Servant_Impl. + * @class Swapping_Home_Servant_Impl_Base * - * Holds the non-template parts of its child class - * Home_Servant_Impl. */ - class CIAO_SERVER_Export Home_Servant_Impl_Base + // @@ Jai, why are you inheriting from "home" here? What is the + // point? + // @@ JAI, probably my class naming convention was the problem. + // This is a home implementation and that is why inheriting from + // "home". + // + class CIAO_SERVER_Export Swapping_Home_Servant_Impl_Base : public virtual POA_Components::CCMHome { public: - explicit Home_Servant_Impl_Base (void); + explicit Swapping_Home_Servant_Impl_Base (void); - Home_Servant_Impl_Base (Session_Container * c); + Swapping_Home_Servant_Impl_Base (Swapping_Container * c); - virtual ~Home_Servant_Impl_Base (void); + virtual ~Swapping_Home_Servant_Impl_Base (void); // Operations for CCMHome interface. - virtual ::CORBA::IRObject_ptr get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -60,10 +57,10 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException)); protected: - Session_Container *container_; + Swapping_Container *container_; }; } #include /**/ "ace/post.h" -#endif /* CIAO_HOME_SERVANT_IMPL_BASE_H */ +#endif /* CIAO_SWAPPING_SERVANT_HOME_IMPL_BASE_H */ diff --git a/TAO/CIAO/ciao/Home_Servant_Impl_T.cpp b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_T.cpp index 8385ddb91bd..b5475e2b9b1 100644 --- a/TAO/CIAO/ciao/Home_Servant_Impl_T.cpp +++ b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_T.cpp @@ -1,61 +1,85 @@ // $Id$ -#ifndef CIAO_HOME_SERVANT_IMPL_T_C -#define CIAO_HOME_SERVANT_IMPL_T_C +#ifndef CIAO_SWAPPING_SERVANT_IMPL_T_C +#define CIAO_SWAPPING_SERVANT_IMPL_T_C -#include "Home_Servant_Impl_T.h" +#include "Swapping_Servant_Home_Impl_T.h" +#include "Dynamic_Component_Servant_T.h" namespace CIAO { - template <typename BASE_SKEL, - typename EXEC, + template <typename BASE_SKEL, + typename EXEC, typename EXEC_VAR, typename COMP, typename COMP_VAR, typename COMP_EXEC, typename COMP_EXEC_VAR, typename COMP_SVNT> - Home_Servant_Impl<BASE_SKEL, + Swapping_Home_Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, COMP, COMP_VAR, COMP_EXEC, COMP_EXEC_VAR, - COMP_SVNT>::Home_Servant_Impl ( + COMP_SVNT>::Swapping_Home_Servant_Impl ( EXEC * exe, Session_Container * c, - const char *ins_name - ) + const char* ins_name, const char* obj_id, const char* repo_id) : Home_Servant_Impl_Base (c), - ins_name_ (ins_name), - executor_ (EXEC::_duplicate (exe)) + executor_ (EXEC::_duplicate (exe)), + ins_name_ (ins_name), obj_id_ (obj_id), repo_id_ (repo_id) { } - template <typename BASE_SKEL, - typename EXEC, + template <typename BASE_SKEL, + typename EXEC, typename EXEC_VAR, typename COMP, typename COMP_VAR, typename COMP_EXEC, typename COMP_EXEC_VAR, typename COMP_SVNT> - Home_Servant_Impl<BASE_SKEL, + Swapping_Home_Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, COMP, COMP_VAR, COMP_EXEC, COMP_EXEC_VAR, - COMP_SVNT>::~Home_Servant_Impl (void) + COMP_SVNT>::~Swapping_Home_Servant_Impl () { + const DYNAMIC_SERVANT_MAP_ITERATOR end = + this->dynamic_servant_map_.end (); + + PortableServer::ObjectId_var oid = + PortableServer::string_to_ObjectId (this->obj_id_); + + ACE_TRY_NEW_ENV; + { + this->container_->delete_servant_map (oid ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY; + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "~Swapping_Home_Servant_Impl\t\n"); + } + ACE_ENDTRY; + + for (DYNAMIC_SERVANT_MAP_ITERATOR iter = + this->dynamic_servant_map_.begin (); + iter != end; ++iter) + { + (*iter).int_id_->destroy (oid); + } } // Operations for CCMHome interface. - template <typename BASE_SKEL, - typename EXEC, + template <typename BASE_SKEL, + typename EXEC, typename EXEC_VAR, typename COMP, typename COMP_VAR, @@ -63,7 +87,7 @@ namespace CIAO typename COMP_EXEC_VAR, typename COMP_SVNT> void - Home_Servant_Impl<BASE_SKEL, + Swapping_Home_Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, COMP, @@ -71,32 +95,26 @@ namespace CIAO COMP_EXEC, COMP_EXEC_VAR, COMP_SVNT>::remove_component ( - ::Components::CCMObject_ptr comp - ACE_ENV_ARG_DECL + ::Components::CCMObject_ptr + ACE_ENV_ARG_DECL_NOT_USED ) ACE_THROW_SPEC ((CORBA::SystemException, Components::RemoveFailure)) { - COMP_VAR _ciao_comp = COMP::_narrow (comp - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + PortableServer::ObjectId_var oid = + PortableServer::string_to_ObjectId (this->obj_id_); - if (CORBA::is_nil (_ciao_comp.in ())) + Dynamic_Component_Servant_Base *servant = 0; + if (this->dynamic_servant_map_.find (oid, servant) == 0) { - ACE_THROW (CORBA::INTERNAL ()); + servant->destroy (oid); } - - _ciao_comp->remove (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - this->_ciao_passivate_component (_ciao_comp.in () - ACE_ENV_ARG_PARAMETER); } // Operations for keyless home interface. - template <typename BASE_SKEL, - typename EXEC, + template <typename BASE_SKEL, + typename EXEC, typename EXEC_VAR, typename COMP, typename COMP_VAR, @@ -104,7 +122,7 @@ namespace CIAO typename COMP_EXEC_VAR, typename COMP_SVNT> Components::CCMObject_ptr - Home_Servant_Impl<BASE_SKEL, + Swapping_Home_Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, COMP, @@ -122,8 +140,8 @@ namespace CIAO // Operations for implicit home interface. - template <typename BASE_SKEL, - typename EXEC, + template <typename BASE_SKEL, + typename EXEC, typename EXEC_VAR, typename COMP, typename COMP_VAR, @@ -131,7 +149,7 @@ namespace CIAO typename COMP_EXEC_VAR, typename COMP_SVNT> COMP * - Home_Servant_Impl<BASE_SKEL, + Swapping_Home_Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, COMP, @@ -150,23 +168,19 @@ namespace CIAO COMP::_nil ()); } + ::Components::EnterpriseComponent_var _ciao_ec = this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (COMP::_nil ()); - COMP_EXEC_VAR _ciao_comp = - COMP_EXEC::_narrow (_ciao_ec.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (COMP::_nil ()); - - return this->_ciao_activate_component (_ciao_comp.in () + return this->_ciao_activate_component (_ciao_ec.in () ACE_ENV_ARG_PARAMETER); } // CIAO-specific operations. - template <typename BASE_SKEL, - typename EXEC, + template <typename BASE_SKEL, + typename EXEC, typename EXEC_VAR, typename COMP, typename COMP_VAR, @@ -174,7 +188,7 @@ namespace CIAO typename COMP_EXEC_VAR, typename COMP_SVNT> COMP * - Home_Servant_Impl<BASE_SKEL, + Swapping_Home_Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, COMP, @@ -182,13 +196,13 @@ namespace CIAO COMP_EXEC, COMP_EXEC_VAR, COMP_SVNT>::_ciao_activate_component ( - COMP_EXEC *exe + ::Components::EnterpriseComponent_ptr ec ACE_ENV_ARG_DECL ) ACE_THROW_SPEC ((CORBA::SystemException)) { - CORBA::Object_var hobj = - this->container_->get_objref (this + CORBA::Object_var hobj = + this->container_->get_home_objref (this ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (COMP::_nil ()); @@ -197,38 +211,64 @@ namespace CIAO ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (COMP::_nil ()); - COMP_SVNT *svt = 0; - ACE_NEW_RETURN (svt, - COMP_SVNT (exe, - home.in (), - this->ins_name_, - this, - this->container_), - COMP::_nil ()); - - PortableServer::ServantBase_var safe (svt); - PortableServer::ObjectId_var oid; + PortableServer::ObjectId_var oid = + PortableServer::string_to_ObjectId (this->obj_id_); CORBA::Object_var objref = - this->container_->install_component (svt, - oid.out () - ACE_ENV_ARG_PARAMETER); + this->container_->generate_reference ( + this->obj_id_, + this->repo_id_, + Container::Component + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (COMP::_nil ()); + Dynamic_Component_Servant_Base *svt = + new Dynamic_Component_Servant + <COMP_SVNT, COMP_EXEC, COMP_EXEC_VAR, EXEC, EXEC_VAR, COMP> + (ec, home.in (), this->ins_name_, this, this->container_); + + this->container_->add_servant_map (oid, svt ACE_ENV_ARG_PARAMETER); + + this->dynamic_servant_map_.bind (oid, svt); + COMP_VAR ho = COMP::_narrow (objref.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (COMP::_nil ()); - if (this->component_map_.bind (oid.in (), svt) == 0) - { - safe._retn (); - } + ACE_CHECK_RETURN (COMP::_nil ()); return ho._retn (); } - template <typename BASE_SKEL, - typename EXEC, + template <typename BASE_SKEL, + typename EXEC, + typename EXEC_VAR, + typename COMP, + typename COMP_VAR, + typename COMP_EXEC, + typename COMP_EXEC_VAR, + typename COMP_SVNT> + void + Swapping_Home_Servant_Impl<BASE_SKEL, + EXEC, + EXEC_VAR, + COMP, + COMP_VAR, + COMP_EXEC, + COMP_EXEC_VAR, + COMP_SVNT>::update_component_map ( + PortableServer::ObjectId &oid) + { + Dynamic_Component_Servant_Base *servant = 0; + if (this->dynamic_servant_map_.find (oid, servant) == 0) + { + servant->update_destroy_count (); + this->dynamic_servant_map_.unbind (oid); + } + return; + } + + template <typename BASE_SKEL, + typename EXEC, typename EXEC_VAR, typename COMP, typename COMP_VAR, @@ -236,7 +276,7 @@ namespace CIAO typename COMP_EXEC_VAR, typename COMP_SVNT> void - Home_Servant_Impl<BASE_SKEL, + Swapping_Home_Servant_Impl<BASE_SKEL, EXEC, EXEC_VAR, COMP, @@ -250,6 +290,7 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException)) { PortableServer::ObjectId_var oid; + this->container_->uninstall_component (comp, oid.out () ACE_ENV_ARG_PARAMETER); @@ -257,14 +298,15 @@ namespace CIAO COMP_SVNT *servant = 0; - if (this->component_map_.unbind (oid.in (), servant) == 0) + if (this->component_map_.find (oid.in (), servant) == 0) { PortableServer::ServantBase_var safe (servant); - servant->_ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + servant->ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; + this->component_map_.unbind (oid.in ()); } } } -#endif /* CIAO_HOME_SERVANT_IMPL_T_C */ +#endif /* CIAO_SWAPPING_SERVANT_IMPL_T_C */ diff --git a/TAO/CIAO/ciao/Home_Servant_Impl_T.h b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_T.h index 1808ef9a372..76bc3a09f0f 100644 --- a/TAO/CIAO/ciao/Home_Servant_Impl_T.h +++ b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_T.h @@ -2,20 +2,19 @@ //============================================================================= /** - * @file Home_Servant_Impl_T.h + * @file Swapping_Servant_Home_Impl_T.h * * $Id$ * * This file contains the declaration of a mixin base class for * the generated home servant class. * - * @authors Jeff Parsons <j.parsons@vanderbilt.edu> */ //============================================================================= -#ifndef CIAO_HOME_SERVANT_IMPL_T_H -#define CIAO_HOME_SERVANT_IMPL_T_H +#ifndef CIAO_SWAPPING_SERVANT_HOME_IMPL_T_H +#define CIAO_SWAPPING_SERVANT_HOME_IMPL_T_H #include /**/ "ace/pre.h" @@ -27,13 +26,14 @@ #include "tao/PortableServer/Key_Adapters.h" #include "ace/Hash_Map_Manager_T.h" +#include "Dynamic_Component_Servant_Base.h" namespace CIAO { class Session_Container; /** - * @class Home_Servant_Impl + * @class Swapping_Servant_Impl * * @brief Mixin base class for generated home servant. * @@ -48,16 +48,17 @@ namespace CIAO typename COMP_EXEC, typename COMP_EXEC_VAR, typename COMP_SVNT> - class Home_Servant_Impl + class Swapping_Home_Servant_Impl : public virtual BASE_SKEL, public virtual Home_Servant_Impl_Base { public: - Home_Servant_Impl (EXEC * exe, + Swapping_Home_Servant_Impl (EXEC * exe, Session_Container * c, - const char *ins_name); + const char* ins_name, + const char* obj_id, const char* repo_id); - virtual ~Home_Servant_Impl (void); + virtual ~Swapping_Home_Servant_Impl (void); // Operations for CCMHome interface. @@ -81,11 +82,14 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException, Components::CreateFailure)); + virtual void + update_component_map (PortableServer::ObjectId &oid); + protected: // CIAO-specific operations. COMP * - _ciao_activate_component (COMP_EXEC *exe + _ciao_activate_component (::Components::EnterpriseComponent_ptr ec ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -95,7 +99,6 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException)); protected: - const char *ins_name_; EXEC_VAR executor_; ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, @@ -104,18 +107,30 @@ namespace CIAO ACE_Equal_To<PortableServer::ObjectId>, ACE_SYNCH_MUTEX> component_map_; + + typedef ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, + Dynamic_Component_Servant_Base *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + ACE_SYNCH_MUTEX> DYNAMIC_SERVANT_MAP; + + typedef DYNAMIC_SERVANT_MAP::iterator DYNAMIC_SERVANT_MAP_ITERATOR; + DYNAMIC_SERVANT_MAP dynamic_servant_map_; + + const char* ins_name_; + const char* obj_id_; + const char* repo_id_; }; } #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Home_Servant_Impl_T.cpp" +#include "Swapping_Servant_Home_Impl_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Home_Servant_Impl_T.cpp") +#pragma implementation ("Swapping_Servant_Home_Impl_T.cpp") #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ #include /**/ "ace/post.h" -#endif /* CIAO_HOME_SERVANT_IMPL_T_H */ - +#endif /* CIAO_SWAPPING_SERVANT_HOME_IMPL_T_H */ diff --git a/TAO/CIAO/ciao/UpgradeableContext.idl b/TAO/CIAO/ciao/UpgradeableContext.idl new file mode 100644 index 00000000000..0fe4a332986 --- /dev/null +++ b/TAO/CIAO/ciao/UpgradeableContext.idl @@ -0,0 +1,20 @@ +// $Id$ + +#include "CCM_Container.idl" +#include "CCM_Base.idl" +#include "CCM_Event.idl" +#include "tao/PortableServer/PortableServer_include.pidl" +#include <orb.idl> + +module CIAO +{ + local interface UpgradeableContext : ::Components::SessionContext + { + ::Components::ConsumerDescriptions get_registered_consumers + (in ::Components::FeatureName publisher_name) + raises (::Components::InvalidName, ::Components::InvalidConnection); + void deactivate_facet (in PortableServer::ObjectId oid); + void update_port_activator (in PortableServer::ObjectId oid); + void remove_facet (in Object reference); + }; +}; diff --git a/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.cpp b/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.cpp new file mode 100644 index 00000000000..2b7dcfaa179 --- /dev/null +++ b/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.cpp @@ -0,0 +1,93 @@ +// $Id$ + +#ifndef CIAO_UPGRADEABLE_CONTEXT_IMPL_T_C +#define CIAO_UPGRADEABLE_CONTEXT_IMPL_T_C + +#include "Upgradeable_Context_Impl_T.h" + +namespace CIAO +{ + template <typename BASE_CTX, + typename SVNT, + typename COMP, + typename COMP_VAR> + Upgradeable_Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>:: + Upgradeable_Context_Impl ( + Components::CCMHome_ptr home, + Session_Container *c, + SVNT *sv) + : session_context (home, c, sv), + servant_ (sv) + { + } + + template <typename BASE_CTX, + typename SVNT, + typename COMP, + typename COMP_VAR> + Upgradeable_Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>:: + ~Upgradeable_Context_Impl (void) + { + } + + template <typename BASE_CTX, + typename SVNT, + typename COMP, + typename COMP_VAR> + void + Upgradeable_Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>::deactivate_facet ( + const PortableServer::ObjectId &oid + ACE_ENV_ARG_DECL + ) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + /* + PortableServer::ObjectId_var oid = + PortableServer::string_to_ObjectId (obj_id); + */ + + this->container_->deactivate_facet (oid ACE_ENV_ARG_PARAMETER); + } + + template <typename BASE_CTX, + typename SVNT, + typename COMP, + typename COMP_VAR> + void + Upgradeable_Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>:: + remove_facet ( + CORBA::Object_ptr reference + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + PortableServer::ObjectId_var oid = + this->container_->the_facet_cons_POA ()->reference_to_id + (reference ACE_ENV_ARG_PARAMETER); + this->update_port_activator (oid ACE_ENV_ARG_PARAMETER); + this->deactivate_facet (oid ACE_ENV_ARG_PARAMETER); + } + + template <typename BASE_CTX, + typename SVNT, + typename COMP, + typename COMP_VAR> + void + Upgradeable_Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>:: + update_port_activator ( + const PortableServer::ObjectId &oid + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + /* + PortableServer::ObjectId_var oid = + PortableServer::string_to_ObjectId (obj_id); + */ + + CIAO::Servant_Activator *sa = + this->container_->ports_servant_activator (); + sa->update_port_activator (oid ACE_ENV_ARG_PARAMETER); + } + +} + +#endif /* CIAO_UPGRADEABLE_CONTEXT_IMPL_T_C */ diff --git a/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.h b/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.h new file mode 100644 index 00000000000..28670a296da --- /dev/null +++ b/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.h @@ -0,0 +1,85 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Upgradeable_Context_Impl_T.h + * + * $Id$ + * + */ +//============================================================================= + + +#ifndef CIAO_UPGRADEABLE_CONTEXT_IMPL_T_H +#define CIAO_UPGRADEABLE_CONTEXT_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "UpgradeableContextC.h" +#include "Context_Impl_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CORBA +{ + class SystemException; +} + +namespace CIAO +{ + template <typename BASE_CTX, + typename SVNT, + typename COMP, + typename COMP_VAR> + class Upgradeable_Context_Impl : public virtual Context_Impl< + BASE_CTX, SVNT, COMP, COMP_VAR> + { + public: + Upgradeable_Context_Impl (Components::CCMHome_ptr home, + Session_Container *c, + SVNT *sv); + + virtual ~Upgradeable_Context_Impl (void); + + virtual void + deactivate_facet (const PortableServer::ObjectId &oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + update_port_activator (const PortableServer::ObjectId &oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + remove_facet (CORBA::Object_ptr reference + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ConsumerDescriptions * + get_registered_consumers (const char *publisher_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) = 0; + + protected: + SVNT *servant_; + COMP_VAR component_; + typedef Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR> session_context; + }; +} + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Upgradeable_Context_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Upgradeable_Context_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_UPGRADEABLE_CONTEXT_IMPL_T_H */ diff --git a/TAO/CIAO/ciao/Version.h b/TAO/CIAO/ciao/Version.h deleted file mode 100644 index 6f4d721b1c0..00000000000 --- a/TAO/CIAO/ciao/Version.h +++ /dev/null @@ -1,7 +0,0 @@ -// $Id$ -// This is an automatically generated file. - -#define CIAO_MAJOR_VERSION 0 -#define CIAO_MINOR_VERSION 4 -#define CIAO_BETA_VERSION 7 -#define CIAO_VERSION "0.4.7" diff --git a/TAO/CIAO/ciao/ciao.rc b/TAO/CIAO/ciao/ciao.rc deleted file mode 100644 index 2faa5f7ae8a..00000000000 --- a/TAO/CIAO/ciao/ciao.rc +++ /dev/null @@ -1,30 +0,0 @@ -#include "Version.h" - -1 VERSIONINFO - FILEVERSION CIAO_MAJOR_VERSION,CIAO_MINOR_VERSION,CIAO_BETA_VERSION,0 - PRODUCTVERSION CIAO_MAJOR_VERSION,CIAO_MINOR_VERSION,CIAO_BETA_VERSION,0 - FILEFLAGSMASK 0x3fL - FILEFLAGS 0x0L - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "FileDescription", "CIAO\0" - VALUE "FileVersion", CIAO_VERSION "\0" - VALUE "InternalName", "CIAODLL\0" - VALUE "LegalCopyright", "\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "CIAO.DLL\0" - VALUE "ProductName", "CIAO\0" - VALUE "ProductVersion", CIAO_VERSION "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END diff --git a/TAO/CIAO/ciao/ciaofwd.h b/TAO/CIAO/ciao/ciaofwd.h deleted file mode 100644 index 62d20c7fc0b..00000000000 --- a/TAO/CIAO/ciao/ciaofwd.h +++ /dev/null @@ -1,33 +0,0 @@ - -// -*- C++ -*- - -//============================================================================= -/** - * @file ciaofwd.h - * - * $Id$ - * - * Forward declare the basic types used in the CCM implementation to - * reduce interdependency. Regular users of CIAO should only include - * ciao/ciao.h. - * - * @author Nanbor Wang - */ -//============================================================================= - - -#ifndef CIAO_CIAOFWD_H -#define CIAO_CIAOFWD_H - -#include /**/ "ace/pre.h" -#include "CIAO_Export.h" -#include "tao/corba.h" - -namespace Components -{ - - -}; - -#include /**/ "ace/post.h" -#endif /* CIAO_CIAOFWD_H */ |