org.omg.PortableInterceptor
Interface ORBInitializer

All Superinterfaces:
IDLEntity sample code for org.omg.CORBA.portable.IDLEntity definition code for org.omg.CORBA.portable.IDLEntity , Object sample code for org.omg.CORBA.Object definition code for org.omg.CORBA.Object , ORBInitializerOperations sample code for org.omg.PortableInterceptor.ORBInitializerOperations definition code for org.omg.PortableInterceptor.ORBInitializerOperations , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public interface ORBInitializer
extends ORBInitializerOperations sample code for org.omg.PortableInterceptor.ORBInitializerOperations definition code for org.omg.PortableInterceptor.ORBInitializerOperations , Object sample code for org.omg.CORBA.Object definition code for org.omg.CORBA.Object , IDLEntity sample code for org.omg.CORBA.portable.IDLEntity definition code for org.omg.CORBA.portable.IDLEntity

Facilitates interceptor registration and ORB initialization.

Interceptors are intended to be a means by which ORB services gain access to ORB processing, effectively becoming part of the ORB. Since Interceptors are part of the ORB, when ORB.init returns an ORB, the Interceptors shall have been registered. Interceptors cannot be registered on an ORB after it has been returned by a call to ORB.init.

An Interceptor is registered by registering an associated ORBInitializer object which implements the ORBInitializer interface. When an ORB is initializing, it shall call each registered ORBInitializer, passing it an ORBInitInfo object which is used to register its Interceptor.

Registering ORB Initializers in Java

ORBInitializers are registered via Java ORB properties.

The property names are of the form:

org.omg.PortableInterceptor.ORBInitializerClass.<Service>
where <Service> is the string name of a class which implements
org.omg.PortableInterceptor.ORBInitializer
To avoid name collisions, the reverse DNS name convention should be used. For example, if company X has three initializers, it could define the following properties: During ORB.init, these ORB properties which begin with org.omg.PortableInterceptor.ORBInitializerClass shall be collected, the <Service> portion of each property shall be extracted, an object shall be instantiated with the <Service> string as its class name, and the pre_init and post_init methods shall be called on that object. If there are any exceptions, the ORB shall ignore them and proceed.

Example

A client-side logging service written by company X, for example, may have the following ORBInitializer implementation:

 package com.x.logging;
 
 import org.omg.PortableInterceptor.Interceptor; 
 import org.omg.PortableInterceptor.ORBInitializer; 
 import org.omg.PortableInterceptor.ORBInitInfo; 
 
 public class LoggingService implements ORBInitializer { 
     void pre_init( ORBInitInfo info ) { 
         // Instantiate the Logging Service s Interceptor. 
         Interceptor interceptor = new LoggingInterceptor(); 

         // Register the Logging Service s Interceptor. 
         info.add_client_request_interceptor( interceptor ); 
     } 
 
     void post_init( ORBInitInfo info ) { 
         // This service does not need two init points. 
     } 
 } 
 
To run a program called MyApp using this logging service, the user could type:
java -Dorg.omg.PortableInterceptor.ORBInitializerClass.com.x.Logging.LoggingService MyApp

Notes about Registering Interceptors

Request Interceptors are registered on a per-ORB basis.

To achieve virtual per-object Interceptors, query the policies on the target from within the interception points to determine whether they should do any work.

To achieve virtual per-POA Interceptors, instantiate each POA with a different ORB. While Interceptors may be ordered administratively, there is no concept of order with respect to the registration of Interceptors. Request Interceptors are concerned with service contexts. Service contexts have no order, so there is no purpose for request Interceptors to have an order. IOR Interceptors are concerned with tagged components. Tagged components also have no order, so there is no purpose for IOR Interceptors to have an order.

Registration code should avoid using the ORB (i.e., calling ORB.init with the provided orb_id). Since registration occurs during ORB initialization, results of invocations on this ORB while it is in this state are undefined.

See Also:
ORBInitInfo sample code for org.omg.PortableInterceptor.ORBInitInfo definition code for org.omg.PortableInterceptor.ORBInitInfo

Method Summary
 
Methods inherited from interface org.omg.PortableInterceptor.ORBInitializerOperations sample code for org.omg.PortableInterceptor.ORBInitializerOperations definition code for org.omg.PortableInterceptor.ORBInitializerOperations
post_init sample code for org.omg.PortableInterceptor.ORBInitializerOperations.post_init(org.omg.PortableInterceptor.ORBInitInfo) definition code for org.omg.PortableInterceptor.ORBInitializerOperations.post_init(org.omg.PortableInterceptor.ORBInitInfo) , pre_init sample code for org.omg.PortableInterceptor.ORBInitializerOperations.pre_init(org.omg.PortableInterceptor.ORBInitInfo) definition code for org.omg.PortableInterceptor.ORBInitializerOperations.pre_init(org.omg.PortableInterceptor.ORBInitInfo)
 
Methods inherited from interface org.omg.CORBA.Object sample code for org.omg.CORBA.Object definition code for org.omg.CORBA.Object
_create_request sample code for org.omg.CORBA.Object._create_request(org.omg.CORBA.Context, java.lang.String, org.omg.CORBA.NVList, org.omg.CORBA.NamedValue) definition code for org.omg.CORBA.Object._create_request(org.omg.CORBA.Context, java.lang.String, org.omg.CORBA.NVList, org.omg.CORBA.NamedValue) , _create_request sample code for org.omg.CORBA.Object._create_request(org.omg.CORBA.Context, java.lang.String, org.omg.CORBA.NVList, org.omg.CORBA.NamedValue, org.omg.CORBA.ExceptionList, org.omg.CORBA.ContextList) definition code for org.omg.CORBA.Object._create_request(org.omg.CORBA.Context, java.lang.String, org.omg.CORBA.NVList, org.omg.CORBA.NamedValue, org.omg.CORBA.ExceptionList, org.omg.CORBA.ContextList) , _duplicate sample code for org.omg.CORBA.Object._duplicate() definition code for org.omg.CORBA.Object._duplicate() , _get_domain_managers sample code for org.omg.CORBA.Object._get_domain_managers() definition code for org.omg.CORBA.Object._get_domain_managers() , _get_interface_def sample code for org.omg.CORBA.Object._get_interface_def() definition code for org.omg.CORBA.Object._get_interface_def() , _get_policy sample code for org.omg.CORBA.Object._get_policy(int) definition code for org.omg.CORBA.Object._get_policy(int) , _hash sample code for org.omg.CORBA.Object._hash(int) definition code for org.omg.CORBA.Object._hash(int) , _is_a sample code for org.omg.CORBA.Object._is_a(java.lang.String) definition code for org.omg.CORBA.Object._is_a(java.lang.String) , _is_equivalent sample code for org.omg.CORBA.Object._is_equivalent(org.omg.CORBA.Object) definition code for org.omg.CORBA.Object._is_equivalent(org.omg.CORBA.Object) , _non_existent sample code for org.omg.CORBA.Object._non_existent() definition code for org.omg.CORBA.Object._non_existent() , _release sample code for org.omg.CORBA.Object._release() definition code for org.omg.CORBA.Object._release() , _request sample code for org.omg.CORBA.Object._request(java.lang.String) definition code for org.omg.CORBA.Object._request(java.lang.String) , _set_policy_override sample code for org.omg.CORBA.Object._set_policy_override(org.omg.CORBA.Policy[], org.omg.CORBA.SetOverrideType) definition code for org.omg.CORBA.Object._set_policy_override(org.omg.CORBA.Policy[], org.omg.CORBA.SetOverrideType)