本文整理汇总了C++中portableinterceptor::ORBInitInfo_ptr类的典型用法代码示例。如果您正苦于以下问题:C++ ORBInitInfo_ptr类的具体用法?C++ ORBInitInfo_ptr怎么用?C++ ORBInitInfo_ptr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ORBInitInfo_ptr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
ACE_NEW_THROW_EX (this->interceptor_,
ServerRequestInterceptor,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ServerRequestInterceptor_var sr_interceptor =
this->interceptor_;
info->add_server_request_interceptor (sr_interceptor.in ());
PortableInterceptor::ServerRequestInterceptor_ptr reject_interceptor;
ACE_NEW_THROW_EX (reject_interceptor,
TAO_LB_ServerRequestInterceptor (this->load_alert_),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ServerRequestInterceptor_var safe_reject_interceptor =
reject_interceptor;
info->add_server_request_interceptor (safe_reject_interceptor.in ());
}
示例2: orb
void
ORB_Initializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
{
// Allocate slot id.
//
state_slot_id (info->allocate_slot_id ());
// Register replica controller as server request interceptor.
//
TAO_ORBInitInfo* tao_info = dynamic_cast<TAO_ORBInitInfo*> (info);
CORBA::ORB_var orb (tao_info->orb_core ()->orb ());
PortableInterceptor::ServerRequestInterceptor_var interceptor;
{
PortableInterceptor::ServerRequestInterceptor *tmp_interceptor = 0;
ACE_NEW_THROW_EX (tmp_interceptor,
ReplicaController (orb.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
interceptor = tmp_interceptor;
}
info->add_server_request_interceptor (interceptor.in ());
}
示例3: ClientInterceptor
void
ClientInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info
)
{
// get Codec factory
IOP::CodecFactory_var codec_factory = info->codec_factory();
// Create and register the request interceptors.
PortableInterceptor::ClientRequestInterceptor_ptr ci =
PortableInterceptor::ClientRequestInterceptor::_nil ();
try
{
ci = new ClientInterceptor (codec_factory);
}
catch(...)
{
std::cerr << "Exception occurred trying to create ClientInterceptor." << std::endl;
}
PortableInterceptor::ClientRequestInterceptor_var ci_interceptor =
ci;
info->add_client_request_interceptor (ci_interceptor.in ());
}
示例4:
void
FOO_IORInterceptor_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
IOP::CodecFactory_var codec_factory =
info->codec_factory ();
// Set up a structure that contains information necessary to
// create a GIOP 1.2 CDR encapsulation Codec.
IOP::Encoding encoding;
encoding.format = IOP::ENCODING_CDR_ENCAPS;
encoding.major_version = 1;
encoding.minor_version = 2;
// Obtain the CDR encapsulation Codec.
IOP::Codec_var codec =
codec_factory->create_codec (encoding);
PortableInterceptor::IORInterceptor_ptr foo;
ACE_NEW_THROW_EX (foo,
FOO_IORInterceptor (codec.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::IORInterceptor_var ior_interceptor =
foo;
info->add_ior_interceptor (ior_interceptor.in ());
}
示例5:
void
Client_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
CORBA::String_var orb_id = info->orb_id ();
CORBA::StringSeq_var args = info->arguments ();
CORBA::String_var forward_str;
// Extract the last forward reference from the argument list.
CORBA::ULong args_len = args->length ();
for (CORBA::ULong i = 0; i < args_len; ++i)
if (ACE_OS::strcmp ("-k", args[i]) == 0
&& i < (args_len - 1))
forward_str = args[i + 1];
PortableInterceptor::ClientRequestInterceptor_ptr interceptor =
PortableInterceptor::ClientRequestInterceptor::_nil ();
// Install the client request interceptor.
ACE_NEW_THROW_EX (interceptor,
Client_Request_Interceptor (orb_id.in (),
forward_str.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ClientRequestInterceptor_var
client_interceptor = interceptor;
info->add_client_request_interceptor (client_interceptor.in ());
}
示例6: ClientInterceptor
void
ClientInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
{
// get Codec factory
IOP::CodecFactory_var codec_factory = info->codec_factory();
// Create and register the request interceptors.
PortableInterceptor::ClientRequestInterceptor_var ci =
new ClientInterceptor (codec_factory);
info->add_client_request_interceptor (ci.in());
}
示例7: INTERNAL
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO::SSLIOP::Server_Invocation_Interceptor::Server_Invocation_Interceptor
(
PortableInterceptor::ORBInitInfo_ptr info,
::Security::QOP default_qop,
size_t tss_slot
)
: qop_ (default_qop)
{
/*
* Cache references to the "Current" objects that we'll need during
* during invocations.
*/
CORBA::Object_var obj =
info->resolve_initial_references ("SSLIOPCurrent");
this->ssliop_current_ = ::SSLIOP::Current::_narrow (obj.in ());
if (!CORBA::is_nil (this->ssliop_current_.in ()))
{
TAO::SSLIOP::Current *tao_current =
dynamic_cast<TAO::SSLIOP::Current *> (this->ssliop_current_.in ());
if (tao_current != 0)
{
if (TAO_debug_level > 3)
ORBSVCS_DEBUG ((LM_DEBUG, "TAO (%P|%t) SSLIOP_Invocation_Interceptor::CTOR--setting up SSLIOP Current with slot %d\n", tss_slot));
tao_current->tss_slot (tss_slot);
}
else
throw CORBA::INTERNAL ();
}
obj = info->resolve_initial_references ("SecurityLevel2:SecurityManager");
this->sec2manager_ = SecurityLevel2::SecurityManager::_narrow (obj.in ());
if (! CORBA::is_nil (this->sec2manager_.in ()))
{
// set the slot id? things seem to work without doing this
}
#if 0
// Don't need this now that we're not using access_allowed(), but
// I'm leaving the code here just in case it would become convenient
// for some other use.
obj = info->resolve_initial_references ("POACurrent");
this->poa_current_ = PortableServer::Current::_narrow (obj.in ());
#endif
}
示例8: ServerRequestInterceptor
void
ServerORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
CORBA::Object_var obj =
info->resolve_initial_references ("POACurrent");
PortableServer::Current_var poa_current =
PortableServer::Current::_narrow (obj.in ());
ACE_ASSERT (!CORBA::is_nil (poa_current.in ()));
CORBA::String_var orb_id = info->orb_id ();
// Create and register the test's ServerRequestInterceptor
PortableInterceptor::ServerRequestInterceptor_ptr tmp;
ACE_NEW_THROW_EX (tmp,
ServerRequestInterceptor (orb_id.in (),
poa_current.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ServerRequestInterceptor_var server_interceptor = tmp;
info->add_server_request_interceptor (server_interceptor.in ());
// Create and register the test's IORInterceptor
PortableInterceptor::IORInterceptor_ptr ort_test_interceptor;
ACE_NEW_THROW_EX (ort_test_interceptor,
ORT_test_IORInterceptor,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::IORInterceptor_var ior_interceptor =
ort_test_interceptor;
info->add_ior_interceptor (ior_interceptor.in ());
}
示例9: INV_OBJREF
void
TAO::SSLIOP::ORBInitializer::pre_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info);
if (CORBA::is_nil (tao_info.in ()))
throw CORBA::INV_OBJREF ();
// SSLIOP doesn't use the ORB Core until a request invocation occurs
// so there is no problem in retrieving the ORB Core pointer in this
// pre_init() method.
TAO_ORB_Core *orb_core = tao_info->orb_core ();
// Create the SSLIOP::Current object.
// Note that a new SSLIOP::Current object is created for each ORB.
// It wouldn't be very useful to share security context information
// with another ORB that isn't configured with security, for
// example.
SSLIOP::Current_ptr current;
ACE_NEW_THROW_EX (current,
TAO::SSLIOP::Current (orb_core),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
SSLIOP::Current_var ssliop_current = current;
// Register the SSLIOP::Current object reference with the ORB.
info->register_initial_reference ("SSLIOPCurrent", ssliop_current.in ());
}
示例10: ServerInterceptor
void
ServerInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
// get reference to the codec_factory
IOP::CodecFactory_var codec_factory = info->codec_factory();
// Create and register the request interceptors.
PortableInterceptor::ServerRequestInterceptor_var si =
new ServerInterceptor (codec_factory);
info->add_server_request_interceptor (si.in());
// add IOR Interceptor
PortableInterceptor::IORInterceptor_var iori = new ServerIORInterceptor;
info->add_ior_interceptor (iori.in());
}
示例11: INTERNAL
size_t
TAO::SSLIOP::ORBInitializer::get_tss_slot_id (
PortableInterceptor::ORBInitInfo_ptr info)
{
// Obtain the Security Service TSS slot ID from the SecurityCurrent
// object.
CORBA::Object_var obj =
info->resolve_initial_references ("SecurityLevel3:SecurityCurrent");
SecurityLevel3::SecurityCurrent_var current =
SecurityLevel3::SecurityCurrent::_narrow (obj.in ());
TAO::SL3::SecurityCurrent * security_current =
dynamic_cast<TAO::SL3::SecurityCurrent *> (current.in ());
if (security_current == 0)
{
ORBSVCS_DEBUG ((LM_DEBUG,
"Unable to obtain TSS slot ID from "
"\"SecurityCurrent\" object.\n"));
throw CORBA::INTERNAL ();
}
return security_current->tss_slot ();
}
示例12:
void
TAO_RTScheduler_ORB_Initializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
{
// @@ This is busted. TAO_ORBInitInfo should do proper reference
// counting.
// Narrow to a TAO_ORBInitInfo object to get access to the
// orb_core() TAO extension.
//TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info
// );
if (TAO_debug_level > 0)
TAOLIB_DEBUG ((LM_DEBUG,
"In post_init\n"));
CORBA::Object_var rt_current_obj =
info->resolve_initial_references (TAO_OBJID_RTCURRENT);
RTCORBA::Current_var rt_current =
RTCORBA::Current::_narrow (rt_current_obj.in ());
if (CORBA::is_nil (rt_current.in ()))
{
TAOLIB_DEBUG ((LM_DEBUG,
"(%P|%t) ::post_init\n"
"(%P|%t) Unable to narrow to RTCORBA::Current\n"));
throw ::CORBA::INTERNAL ();
}
this->current_->rt_current (rt_current.in ());
}
示例13: current
void
Current_ORBInitializer_Base::pre_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
// Narrow to a TAO_ORBInitInfo object to get access to the
// allocate_tss_slot_id() TAO extension.
TAO_ORBInitInfo_var tao_info =
TAO_ORBInitInfo::_narrow (info);
if (CORBA::is_nil (tao_info.in ()))
{
if (TAO_debug_level > 0)
TAOLIB_ERROR ((LM_ERROR,
"TAO (%P|%t) TAO::Transport::ORBInitializer::pre_init - "
"Panic: unable to narrow the ORBInitInfo_ptr\n"));
throw ::CORBA::INTERNAL ();
}
// Reserve a TSS slot in the ORB core internal TSS resources for the
// thread-specific portion of the Current object.
size_t tss_slot = tao_info->allocate_tss_slot_id (0);
// Create the Current
Current_var current (this->make_current_instance (tao_info->orb_core (),
tss_slot));
info->register_initial_reference (ACE_TEXT_ALWAYS_CHAR (this->id_.fast_rep ()),
current.in ());
}
示例14:
void
TAO_FT_ServerORBInitializer::register_policy_factories (
PortableInterceptor::ORBInitInfo_ptr info)
{
// Register the FTCORBA policy factories.
PortableInterceptor::PolicyFactory_ptr temp_factory =
PortableInterceptor::PolicyFactory::_nil ();
PortableInterceptor::PolicyFactory_var policy_factory;
// This policy factory is used for all FTCORBA related policies.
ACE_NEW_THROW_EX (temp_factory,
TAO_FT_ServerPolicyFactory,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
policy_factory = temp_factory;
// Bind the same policy factory to all FTCORBA related policy
// types since a single policy factory is used to create each of
// the different types of FTCORBA policies.
CORBA::PolicyType type = FT::HEARTBEAT_ENABLED_POLICY;
info->register_policy_factory (type,
policy_factory.in ());
}
示例15: ClientInterceptor
void
ClientInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
{
// Find the Naming Service
CORBA::Object_var naming_obj =
info->resolve_initial_references("NameService");
CosNaming::NamingContext_var root =
CosNaming::NamingContext::_narrow(naming_obj.in());
if( CORBA::is_nil(root.in())) {
std::cerr << "Nil Naming Context reference" << std::endl;
ACE_ASSERT(false);
}
// Resolve the Messenger object
CosNaming::Name name;
name.length( 1 );
name[0].id = CORBA::string_dup( "Messenger" );
CORBA::Object_var obj = CORBA::Object::_nil();
while ( CORBA::is_nil( obj.in() ) ) {
try {
obj = root->resolve( name );
} catch (const CosNaming::NamingContext::NotFound&) {
// Sleep for a second and try again
ACE_OS::sleep(1);
}
}
Messenger_var messenger = Messenger::_narrow( obj.in() );
if( CORBA::is_nil( messenger.in() ) ) {
std::cerr << "Not a Messenger reference" << std::endl;
ACE_ASSERT(false);
}
// allocate slot
slot_ = info->allocate_slot_id();
// get PICurrent
CORBA::Object_var current_obj = info->resolve_initial_references("PICurrent");
current_ =
PortableInterceptor::Current::_narrow(current_obj.in());
// Create and register the request interceptors.
PortableInterceptor::ClientRequestInterceptor_var ci =
new ClientInterceptor(messenger, current_.in(), slot_);
info->add_client_request_interceptor (ci.in());
}