-
- All Superinterfaces:
- IDLEntity, Object, ORBInitializerOperations, Serializable
public interface ORBInitializer extends ORBInitializerOperations, Object, 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 toORB.init
.An Interceptor is registered by registering an associated
ORBInitializer
object which implements theORBInitializer
interface. When an ORB is initializing, it shall call each registeredORBInitializer
, passing it anORBInitInfo
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:
whereorg.omg.PortableInterceptor.ORBInitializerClass.<Service>
<Service>
is the string name of a class which implements
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:org.omg.PortableInterceptor.ORBInitializer
org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init1
org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init2
org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init3
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 thepre_init
andpost_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:
To run a program calledpackage 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. } }
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 providedorb_id
). Since registration occurs during ORB initialization, results of invocations on this ORB while it is in this state are undefined.- See Also:
ORBInitInfo
-
-
Method Summary
-
Methods inherited from interface org.omg.PortableInterceptor.ORBInitializerOperations
post_init, pre_init
-
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
17/11/2024 17:17:09 Cette version de la page est en cache (à la date du 17/11/2024 17:17:09) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 31/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-org/omg/portableinterceptor/orbinitializer.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.