Class ORBInitInfoImpl
- java.lang.Object
-
- org.omg.CORBA.LocalObject
-
- com.sun.corba.ee.impl.interceptors.ORBInitInfoImpl
-
- All Implemented Interfaces:
ORBInitInfoExt
,java.io.Serializable
,Object
,IDLEntity
,ORBInitInfo
,ORBInitInfoOperations
public final class ORBInitInfoImpl extends LocalObject implements ORBInitInfo, ORBInitInfoExt
ORBInitInfoImpl is the implementation of the ORBInitInfo class to be passed to ORBInitializers, as described in orbos/99-12-02.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]
args
private CodecFactory
codecFactory
private static java.lang.String
MESSAGE_ORBINITINFO_INVALID
private static OMGSystemException
omgWrapper
private ORB
orb
private java.lang.String
orbId
private static ORBUtilSystemException
orbutilWrapper
private int
stage
static int
STAGE_CLOSED
static int
STAGE_POST_INIT
static int
STAGE_PRE_INIT
private static InterceptorsSystemException
wrapper
-
Constructor Summary
Constructors Constructor Description ORBInitInfoImpl(ORB orb, java.lang.String[] args, java.lang.String orbId, CodecFactory codecFactory)
Creates a new ORBInitInfoImpl object (scoped to package)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add_client_request_interceptor(ClientRequestInterceptor interceptor)
This operation is used to add a client-side request Interceptor to the list of client-side request Interceptors.void
add_client_request_interceptor_with_policy(ClientRequestInterceptor interceptor, Policy[] policies)
void
add_ior_interceptor(IORInterceptor interceptor)
This operation is used to add an IOR Interceptor to the list of IOR Interceptors.void
add_ior_interceptor_with_policy(IORInterceptor interceptor, Policy[] policies)
void
add_server_request_interceptor(ServerRequestInterceptor interceptor)
This operation is used to add a server-side request Interceptor to the list of server-side request Interceptors.void
add_server_request_interceptor_with_policy(ServerRequestInterceptor interceptor, Policy[] policies)
int
allocate_slot_id()
A service calls allocate_slot_id to allocate a slot on PortableInterceptor::Current.java.lang.String[]
arguments()
This attribute contains the arguments passed to ORB_init.private void
checkStage()
Throws an exception if the current stage is STAGE_CLOSED.CodecFactory
codec_factory()
This attribute is the IOP::CodecFactory.ORB
getORB()
Return the ORB behind this ORBInitInfo.private void
nullParam()
Called when an invalid null parameter was passed.java.lang.String
orb_id()
This attribute is the ID of the ORB being initializedvoid
register_initial_reference(java.lang.String id, Object obj)
See orbos/99-12-02, Chapter 11, Dynamic Initial References on page 11-81.void
register_policy_factory(int type, PolicyFactory policy_factory)
Register a PolicyFactory for the given PolicyType.Object
resolve_initial_references(java.lang.String id)
This operation is only valid during post_init.(package private) void
setStage(int stage)
Sets the current stage we are in.-
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
-
-
-
Field Detail
-
orb
private transient ORB orb
-
wrapper
private static final InterceptorsSystemException wrapper
-
orbutilWrapper
private static final ORBUtilSystemException orbutilWrapper
-
omgWrapper
private static final OMGSystemException omgWrapper
-
args
private java.lang.String[] args
-
orbId
private java.lang.String orbId
-
codecFactory
private CodecFactory codecFactory
-
stage
private int stage
-
STAGE_PRE_INIT
public static final int STAGE_PRE_INIT
- See Also:
- Constant Field Values
-
STAGE_POST_INIT
public static final int STAGE_POST_INIT
- See Also:
- Constant Field Values
-
STAGE_CLOSED
public static final int STAGE_CLOSED
- See Also:
- Constant Field Values
-
MESSAGE_ORBINITINFO_INVALID
private static final java.lang.String MESSAGE_ORBINITINFO_INVALID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ORBInitInfoImpl
ORBInitInfoImpl(ORB orb, java.lang.String[] args, java.lang.String orbId, CodecFactory codecFactory)
Creates a new ORBInitInfoImpl object (scoped to package)- Parameters:
args
- The arguments passed to ORB_init.
-
-
Method Detail
-
getORB
public ORB getORB()
Return the ORB behind this ORBInitInfo. This is defined in the ORBInitInfoExt interface.- Specified by:
getORB
in interfaceORBInitInfoExt
-
setStage
void setStage(int stage)
Sets the current stage we are in. This limits access to certain functionality.
-
checkStage
private void checkStage()
Throws an exception if the current stage is STAGE_CLOSED. This is called before any method is invoked to ensure that no method invocations are attempted after all calls to post_init() are completed.
-
arguments
public java.lang.String[] arguments()
This attribute contains the arguments passed to ORB_init. They may or may not contain the ORB's arguments- Specified by:
arguments
in interfaceORBInitInfoOperations
- Returns:
- the arguments for ORB.init
-
orb_id
public java.lang.String orb_id()
This attribute is the ID of the ORB being initialized- Specified by:
orb_id
in interfaceORBInitInfoOperations
- Returns:
- the ID of the ORB
-
codec_factory
public CodecFactory codec_factory()
This attribute is the IOP::CodecFactory. The CodecFactory is normally obtained via a call to ORB::resolve_initial_references( "CodecFactory" ) but since the ORB is not yet available and Interceptors, particularly when processing service contexts, will require a Codec, a means of obtaining a Codec is necessary during ORB intialization.- Specified by:
codec_factory
in interfaceORBInitInfoOperations
- Returns:
- the IOP.CodeFactory
-
register_initial_reference
public void register_initial_reference(java.lang.String id, Object obj) throws InvalidName
See orbos/99-12-02, Chapter 11, Dynamic Initial References on page 11-81. This operation is identical to ORB::register_initial_reference described there. This same functionality exists here because the ORB, not yet fully initialized, is not yet available but initial references may need to be registered as part of Interceptor registration.This method may not be called during post_init.
- Specified by:
register_initial_reference
in interfaceORBInitInfoOperations
- Parameters:
id
- initial object idobj
- initial object to register- Throws:
InvalidName
- if the name is invalid
-
resolve_initial_references
public Object resolve_initial_references(java.lang.String id) throws InvalidName
This operation is only valid during post_init. It is identical to ORB::resolve_initial_references. This same functionality exists here because the ORB, not yet fully initialized, is not yet available, but initial references may be required from the ORB as part of Interceptor registration.(incorporates changes from errata in orbos/00-01-01)
This method may not be called during pre_init.
- Specified by:
resolve_initial_references
in interfaceORBInitInfoOperations
- Parameters:
id
- ID of the object- Returns:
- initial references
- Throws:
InvalidName
- if the ID is not valid
-
add_client_request_interceptor_with_policy
public void add_client_request_interceptor_with_policy(ClientRequestInterceptor interceptor, Policy[] policies) throws DuplicateName
- Throws:
DuplicateName
-
add_client_request_interceptor
public void add_client_request_interceptor(ClientRequestInterceptor interceptor) throws DuplicateName
This operation is used to add a client-side request Interceptor to the list of client-side request Interceptors.If a client-side request Interceptor has already been registered with this Interceptor's name, DuplicateName is raised.
- Specified by:
add_client_request_interceptor
in interfaceORBInitInfoOperations
- Parameters:
interceptor
- TheClientRequestInterceptor
to be added.- Throws:
DuplicateName
- thrown if a client-side request Interceptor has already been registered with this Interceptor's name.
-
add_server_request_interceptor_with_policy
public void add_server_request_interceptor_with_policy(ServerRequestInterceptor interceptor, Policy[] policies) throws DuplicateName, PolicyError
- Throws:
DuplicateName
PolicyError
-
add_server_request_interceptor
public void add_server_request_interceptor(ServerRequestInterceptor interceptor) throws DuplicateName
This operation is used to add a server-side request Interceptor to the list of server-side request Interceptors.If a server-side request Interceptor has already been registered with this Interceptor's name, DuplicateName is raised.
- Specified by:
add_server_request_interceptor
in interfaceORBInitInfoOperations
- Parameters:
interceptor
- The ServerRequestInterceptor to be added.- Throws:
DuplicateName
- thrown if a server-side request Interceptor has already been registered with this Interceptor's name
-
add_ior_interceptor_with_policy
public void add_ior_interceptor_with_policy(IORInterceptor interceptor, Policy[] policies) throws DuplicateName, PolicyError
- Throws:
DuplicateName
PolicyError
-
add_ior_interceptor
public void add_ior_interceptor(IORInterceptor interceptor) throws DuplicateName
This operation is used to add an IOR Interceptor to the list of IOR Interceptors.If an IOR Interceptor has already been registered with this Interceptor's name, DuplicateName is raised.
- Specified by:
add_ior_interceptor
in interfaceORBInitInfoOperations
- Parameters:
interceptor
- The IORInterceptor to be added.- Throws:
DuplicateName
- thrown if an IOR Interceptor has already been registered with this Interceptor's name.
-
allocate_slot_id
public int allocate_slot_id()
A service calls allocate_slot_id to allocate a slot on PortableInterceptor::Current.- Specified by:
allocate_slot_id
in interfaceORBInitInfoOperations
- Returns:
- The index to the slot which has been allocated.
- See Also:
Current
-
register_policy_factory
public void register_policy_factory(int type, PolicyFactory policy_factory)
Register a PolicyFactory for the given PolicyType.If a PolicyFactory already exists for the given PolicyType, BAD_INV_ORDER is raised with a minor code of TBD_BIO+2.
- Specified by:
register_policy_factory
in interfaceORBInitInfoOperations
- Parameters:
type
- The policy type that the givenPolicyFactory
serves.policy_factory
- The factory for the given policy type.
-
-