- java.lang.Object
-
- org.omg.CORBA.ORB
-
- Direct Known Subclasses:
ORB
public abstract class ORB extends Object
A class providing APIs for the CORBA Object Request Broker features. TheORBclass also provides "pluggable ORB implementation" APIs that allow another vendor's ORB implementation to be used.An ORB makes it possible for CORBA objects to communicate with each other by connecting objects making requests (clients) with objects servicing requests (servers).
The
ORBclass, which encapsulates generic CORBA functionality, does the following: (Note that items 5 and 6, which include most of the methods in the classORB, are typically used with theDynamic Invocation Interface(DII) and theDynamic Skeleton Interface(DSI). These interfaces may be used by a developer directly, but most commonly they are used by the ORB internally and are not seen by the general programmer.)- initializes the ORB implementation by supplying values for predefined properties and environmental parameters
- obtains initial object references to services such as
the NameService using the method
resolve_initial_references - converts object references to strings and back
- connects the ORB to a servant (an instance of a CORBA object implementation) and disconnects the ORB from a servant
- creates objects such as
TypeCodeAnyNamedValueContextEnvironment- lists (such as
NVList) containing these objects
- sends multiple messages in the DII
The
ORBclass can be used to obtain references to objects implemented anywhere on the network.An application or applet gains access to the CORBA environment by initializing itself into an
ORBusing one of threeinitmethods. Two of the three methods use the properties (associations of a name with a value) shown in the table below.
Standard Java CORBA Properties: Property Name Property Value org.omg.CORBA.ORBClass class name of an ORB implementation org.omg.CORBA.ORBSingletonClass class name of the ORB returned by init()These properties allow a different vendor's
ORBimplementation to be "plugged in."When an ORB instance is being created, the class name of the ORB implementation is located using the following standard search order:
- check in Applet parameter or application string array, if any
- check in properties parameter, if any
- check in the System properties, if any
- check in the orb.properties file located in the user.home directory, if any
- check in the orb.properties file located in the run-time image, if any
- fall back on a hardcoded default behavior (use the Java IDL implementation)
Note that Java IDL provides a default implementation for the fully-functional ORB and for the Singleton ORB. When the method
initis given no parameters, the default Singleton ORB is returned. When the methodinitis given parameters but no ORB class is specified, the Java IDL ORB implementation is returned.The following code fragment creates an
ORBobject initialized with the default ORB Singleton. This ORB has a restricted implementation to prevent malicious applets from doing anything beyond creating typecodes. It is called a singleton because there is only one instance for an entire virtual machine.ORB orb = ORB.init();The following code fragment creates an
ORBobject for an application. The parameterargsrepresents the arguments supplied to the application'smainmethod. Since the property specifies the ORB class to be "SomeORBImplementation", the new ORB will be initialized with that ORB implementation. If p had been null, and the arguments had not specified an ORB class, the new ORB would have been initialized with the default Java IDL implementation.Properties p = new Properties(); p.put("org.omg.CORBA.ORBClass", "SomeORBImplementation"); ORB orb = ORB.init(args, p);The following code fragment creates an
ORBobject for the applet supplied as the first parameter. If the given applet does not specify an ORB class, the new ORB will be initialized with the default Java IDL implementation.ORB orb = ORB.init(myApplet, null);An application or applet can be initialized in one or more ORBs. ORB initialization is a bootstrap call into the CORBA world.
- Implementation Note:
- When a singleton ORB is configured via the system property,
or orb.properties, it will be
located, and loaded via the system class loader.
Thus, where appropriate, it is necessary that
the classes for this alternative ORBSingleton are available on the application's class path.
It should be noted that the singleton ORB is system wide.
When a per-application ORB is created via the 2-arg init methods, then it will be located using the thread context class loader.
The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location, in the Java run-time image, to search for orb.properties. This location is not intended for user editable configuration files. Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties, and thereafter the ${java.home}/lib directory.
See also IDL developer's guide.
- Since:
- JDK1.2
-
-
Constructor Summary
Constructors Constructor Description ORB()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidconnect(Object obj)Connects the given servant object (a Java object that is an instance of the server implementation class) to the ORB.TypeCodecreate_abstract_interface_tc(String id, String name)Create aTypeCodeobject for an IDL abstract interface.abstract TypeCodecreate_alias_tc(String id, String name, TypeCode original_type)Creates aTypeCodeobject representing an IDLalias(typedef).abstract Anycreate_any()Creates an IDLAnyobject initialized to contain aTypecodeobject whosekindfield is set toTCKind.tc_null.abstract TypeCodecreate_array_tc(int length, TypeCode element_type)Creates aTypeCodeobject representing an IDLarray.DynAnycreate_basic_dyn_any(TypeCode type)Deprecated.Use the new DynAnyFactory API insteadabstract ContextListcreate_context_list()Creates an emptyContextListobject.DynAnycreate_dyn_any(Any value)Deprecated.Use the new DynAnyFactory API insteadDynArraycreate_dyn_array(TypeCode type)Deprecated.Use the new DynAnyFactory API insteadDynEnumcreate_dyn_enum(TypeCode type)Deprecated.Use the new DynAnyFactory API insteadDynSequencecreate_dyn_sequence(TypeCode type)Deprecated.Use the new DynAnyFactory API insteadDynStructcreate_dyn_struct(TypeCode type)Deprecated.Use the new DynAnyFactory API insteadDynUnioncreate_dyn_union(TypeCode type)Deprecated.Use the new DynAnyFactory API insteadabstract TypeCodecreate_enum_tc(String id, String name, String[] members)Creates aTypeCodeobject representing an IDLenum.abstract Environmentcreate_environment()Creates anEnvironmentobject.abstract ExceptionListcreate_exception_list()Creates an emptyExceptionListobject.abstract TypeCodecreate_exception_tc(String id, String name, StructMember[] members)Creates aTypeCodeobject representing an IDLexception.TypeCodecreate_fixed_tc(short digits, short scale)Create aTypeCodeobject for an IDL fixed type.abstract TypeCodecreate_interface_tc(String id, String name)Creates aTypeCodeobject representing an IDLinterface.abstract NVListcreate_list(int count)Allocates anNVListwith (probably) enough space for the specified number ofNamedValueobjects.abstract NamedValuecreate_named_value(String s, Any any, int flags)Creates aNamedValueobject using the given name, value, and argument mode flags.TypeCodecreate_native_tc(String id, String name)Create aTypeCodeobject for an IDL native type.NVListcreate_operation_list(Object oper)Creates anNVListinitialized with argument descriptions for the operation described in the givenOperationDefobject.abstract OutputStreamcreate_output_stream()Creates a neworg.omg.CORBA.portable.OutputStreaminto which IDL method parameters can be marshalled during method invocation.Policycreate_policy(int type, Any val)Can be invoked to create new instances of policy objects of a specific type with specified initial state.abstract TypeCodecreate_recursive_sequence_tc(int bound, int offset)Deprecated.Use a combination of create_recursive_tc and create_sequence_tc insteadTypeCodecreate_recursive_tc(String id)Create a recursiveTypeCodeobject which serves as a placeholder for a concrete TypeCode during the process of creating TypeCodes which contain recursion.abstract TypeCodecreate_sequence_tc(int bound, TypeCode element_type)Creates aTypeCodeobject representing an IDLsequence.abstract TypeCodecreate_string_tc(int bound)Creates aTypeCodeobject representing a bounded IDLstring.abstract TypeCodecreate_struct_tc(String id, String name, StructMember[] members)Creates aTypeCodeobject representing an IDLstruct.abstract TypeCodecreate_union_tc(String id, String name, TypeCode discriminator_type, UnionMember[] members)Creates aTypeCodeobject representing an IDLunion.TypeCodecreate_value_box_tc(String id, String name, TypeCode boxed_type)Creates aTypeCodeobject for an IDL value box.TypeCodecreate_value_tc(String id, String name, short type_modifier, TypeCode concrete_base, ValueMember[] members)Create aTypeCodeobject for an IDL value type.abstract TypeCodecreate_wstring_tc(int bound)Creates aTypeCodeobject representing a bounded IDLwstring(wide string).voiddestroy()Destroys the ORB so that its resources can be reclaimed.voiddisconnect(Object obj)Disconnects the given servant object from the ORB.Currentget_current()Deprecated.useresolve_initial_references.abstract Contextget_default_context()Gets the defaultContextobject.abstract Requestget_next_response()Gets the nextRequestinstance for which a response has been received.abstract TypeCodeget_primitive_tc(TCKind tcKind)Retrieves theTypeCodeobject that represents the given primitive IDL type.booleanget_service_information(short service_type, ServiceInformationHolder service_info)Used to obtain information about CORBA facilities and services that are supported by this ORB.static ORBinit()Returns theORBsingleton object.static ORBinit(Applet app, Properties props)Creates a newORBinstance for an applet.static ORBinit(String[] args, Properties props)Creates a newORBinstance for a standalone application.abstract String[]list_initial_services()Returns a list of the initially available CORBA object references, such as "NameService" and "InterfaceRepository".abstract Stringobject_to_string(Object obj)Converts the given CORBA object reference to a string.voidperform_work()Performs an implementation-dependent unit of work if called by the main thread.abstract booleanpoll_next_response()Finds out if any of the deferred (asynchronous) invocations have a response yet.abstract Objectresolve_initial_references(String object_name)Resolves a specific object reference from the set of available initial service names.voidrun()This operation blocks the current thread until the ORB has completed the shutdown process, initiated when some thread callsshutdown.abstract voidsend_multiple_requests_deferred(Request[] req)Sends multiple dynamic (DII) requests asynchronously.abstract voidsend_multiple_requests_oneway(Request[] req)Sends multiple dynamic (DII) requests asynchronously without expecting any responses.protected abstract voidset_parameters(Applet app, Properties props)Allows the ORB implementation to be initialized with the given applet and parameters.protected abstract voidset_parameters(String[] args, Properties props)Allows the ORB implementation to be initialized with the given parameters and properties.voidshutdown(boolean wait_for_completion)Instructs the ORB to shut down, which causes all object adapters to shut down, in preparation for destruction.
If thewait_for_completionparameter is true, this operation blocks until all ORB processing (including processing of currently executing requests, object deactivation, and other object adapter operations) has completed.abstract Objectstring_to_object(String str)Converts a string produced by the methodobject_to_stringback to a CORBA object reference.booleanwork_pending()Returnstrueif the ORB needs the main thread to perform some work, andfalseif the ORB does not need the main thread.
-
-
-
Method Detail
-
init
public static ORB init()
Returns theORBsingleton object. This method always returns the same ORB instance, which is an instance of the class described by theorg.omg.CORBA.ORBSingletonClasssystem property.This no-argument version of the method
initis used primarily as a factory forTypeCodeobjects, which are used byHelperclasses to implement the methodtype. It is also used to createAnyobjects that are used to describeunionlabels (as part of creating aTypeCodeobject for aunion).This method is not intended to be used by applets, and in the event that it is called in an applet environment, the ORB it returns is restricted so that it can be used only as a factory for
TypeCodeobjects. AnyTypeCodeobjects it produces can be safely shared among untrusted applets.If an ORB is created using this method from an applet, a system exception will be thrown if methods other than those for creating
TypeCodeobjects are invoked.- Implementation Note:
- When configured via the system property, or orb.properties, the system-wide singleton ORB is located via the system class loader.
- Returns:
- the singleton ORB
-
init
public static ORB init(String[] args, Properties props)
Creates a newORBinstance for a standalone application. This method may be called from applications only and returns a new fully functionalORBobject each time it is called.- Implementation Note:
- When configured via the system property, or orb.properties, the ORB is located via the thread context class loader.
- Parameters:
args- command-line arguments for the application'smainmethod; may benullprops- application-specific properties; may benull- Returns:
- the newly-created ORB instance
-
init
public static ORB init(Applet app, Properties props)
Creates a newORBinstance for an applet. This method may be called from applets only and returns a new fully-functionalORBobject each time it is called.- Implementation Note:
- When configured via the system property, or orb.properties, the ORB is located via the thread context class loader.
- Parameters:
app- the applet; may benullprops- applet-specific properties; may benull- Returns:
- the newly-created ORB instance
-
set_parameters
protected abstract void set_parameters(String[] args, Properties props)
Allows the ORB implementation to be initialized with the given parameters and properties. This method, used in applications only, is implemented by subclass ORB implementations and called by the appropriateinitmethod to pass in its parameters.- Parameters:
args- command-line arguments for the application'smainmethod; may benullprops- application-specific properties; may benull
-
set_parameters
protected abstract void set_parameters(Applet app, Properties props)
Allows the ORB implementation to be initialized with the given applet and parameters. This method, used in applets only, is implemented by subclass ORB implementations and called by the appropriateinitmethod to pass in its parameters.- Parameters:
app- the applet; may benullprops- applet-specific properties; may benull
-
connect
public void connect(Object obj)
Connects the given servant object (a Java object that is an instance of the server implementation class) to the ORB. The servant class must extend theImplBaseclass corresponding to the interface that is supported by the server. The servant must thus be a CORBA object reference, and inherit fromorg.omg.CORBA.Object. Servants created by the user can start receiving remote invocations after the methodconnecthas been called. A servant may also be automatically and implicitly connected to the ORB if it is passed as an IDL parameter in an IDL method invocation on a non-local object, that is, if the servant object has to be marshalled and sent outside of the process address space.Calling the method
connecthas no effect when the servant object is already connected to the ORB.Deprecated by the OMG in favor of the Portable Object Adapter APIs.
- Parameters:
obj- The servant object reference
-
destroy
public void destroy()
Destroys the ORB so that its resources can be reclaimed. Any operation invoked on a destroyed ORB reference will throw theOBJECT_NOT_EXISTexception. Once an ORB has been destroyed, another call toinitwith the same ORBid will return a reference to a newly constructed ORB.If
destroyis called on an ORB that has not been shut down, it will start the shut down process and block until the ORB has shut down before it destroys the ORB.
If an application callsdestroyin a thread that is currently servicing an invocation, theBAD_INV_ORDERsystem exception will be thrown with the OMG minor code 3, since blocking would result in a deadlock.For maximum portability and to avoid resource leaks, an application should always call
shutdownanddestroyon all ORB instances before exiting.- Throws:
BAD_INV_ORDER- if the current thread is servicing an invocation
-
disconnect
public void disconnect(Object obj)
Disconnects the given servant object from the ORB. After this method returns, the ORB will reject incoming remote requests for the disconnected servant and will send the exceptionorg.omg.CORBA.OBJECT_NOT_EXISTback to the remote client. Thus the object appears to be destroyed from the point of view of remote clients. Note, however, that local requests issued using the servant directly do not pass through the ORB; hence, they will continue to be processed by the servant.Calling the method
disconnecthas no effect if the servant is not connected to the ORB.Deprecated by the OMG in favor of the Portable Object Adapter APIs.
- Parameters:
obj- The servant object to be disconnected from the ORB
-
list_initial_services
public abstract String[] list_initial_services()
Returns a list of the initially available CORBA object references, such as "NameService" and "InterfaceRepository".- Returns:
- an array of
Stringobjects that represent the object references for CORBA services that are initially available with this ORB
-
resolve_initial_references
public abstract Object resolve_initial_references(String object_name) throws InvalidName
Resolves a specific object reference from the set of available initial service names.- Parameters:
object_name- the name of the initial service as a string- Returns:
- the object reference associated with the given name
- Throws:
InvalidName- if the given name is not associated with a known service
-
object_to_string
public abstract String object_to_string(Object obj)
Converts the given CORBA object reference to a string. Note that the format of this string is predefined by IIOP, allowing strings generated by a different ORB to be converted back into an object reference.The resulting
Stringobject may be stored or communicated in any way that aStringobject can be manipulated.- Parameters:
obj- the object reference to stringify- Returns:
- the string representing the object reference
-
string_to_object
public abstract Object string_to_object(String str)
Converts a string produced by the methodobject_to_stringback to a CORBA object reference.- Parameters:
str- the string to be converted back to an object reference. It must be the result of converting an object reference to a string using the methodobject_to_string.- Returns:
- the object reference
-
create_list
public abstract NVList create_list(int count)
Allocates anNVListwith (probably) enough space for the specified number ofNamedValueobjects. Note that the specified size is only a hint to help with storage allocation and does not imply the maximum size of the list.- Parameters:
count- suggested number ofNamedValueobjects for which to allocate space- Returns:
- the newly-created
NVList - See Also:
NVList
-
create_operation_list
public NVList create_operation_list(Object oper)
Creates anNVListinitialized with argument descriptions for the operation described in the givenOperationDefobject. ThisOperationDefobject is obtained from an Interface Repository. The arguments in the returnedNVListobject are in the same order as in the original IDL operation definition, which makes it possible for the list to be used in dynamic invocation requests.- Parameters:
oper- theOperationDefobject to use to create the list- Returns:
- a newly-created
NVListobject containing descriptions of the arguments to the method described in the givenOperationDefobject - See Also:
NVList
-
create_named_value
public abstract NamedValue create_named_value(String s, Any any, int flags)
Creates aNamedValueobject using the given name, value, and argument mode flags.A
NamedValueobject serves as (1) a parameter or return value or (2) a context property. It may be used by itself or as an element in anNVListobject.- Parameters:
s- the name of theNamedValueobjectany- theAnyvalue to be inserted into theNamedValueobjectflags- the argument mode flags for theNamedValue: one ofARG_IN.value,ARG_OUT.value, orARG_INOUT.value.- Returns:
- the newly-created
NamedValueobject - See Also:
NamedValue
-
create_exception_list
public abstract ExceptionList create_exception_list()
Creates an emptyExceptionListobject.- Returns:
- the newly-created
ExceptionListobject
-
create_context_list
public abstract ContextList create_context_list()
Creates an emptyContextListobject.- Returns:
- the newly-created
ContextListobject - See Also:
ContextList,Context
-
get_default_context
public abstract Context get_default_context()
Gets the defaultContextobject.- Returns:
- the default
Contextobject - See Also:
Context
-
create_environment
public abstract Environment create_environment()
Creates anEnvironmentobject.- Returns:
- the newly-created
Environmentobject - See Also:
Environment
-
create_output_stream
public abstract OutputStream create_output_stream()
Creates a neworg.omg.CORBA.portable.OutputStreaminto which IDL method parameters can be marshalled during method invocation.- Returns:
- the newly-created
org.omg.CORBA.portable.OutputStreamobject
-
send_multiple_requests_oneway
public abstract void send_multiple_requests_oneway(Request[] req)
Sends multiple dynamic (DII) requests asynchronously without expecting any responses. Note that oneway invocations are not guaranteed to reach the server.- Parameters:
req- an array of request objects
-
send_multiple_requests_deferred
public abstract void send_multiple_requests_deferred(Request[] req)
Sends multiple dynamic (DII) requests asynchronously.- Parameters:
req- an array ofRequestobjects
-
poll_next_response
public abstract boolean poll_next_response()
Finds out if any of the deferred (asynchronous) invocations have a response yet.- Returns:
trueif there is a response available;falseotherwise
-
get_next_response
public abstract Request get_next_response() throws WrongTransaction
Gets the nextRequestinstance for which a response has been received.- Returns:
- the next
Requestobject ready with a response - Throws:
WrongTransaction- if the methodget_next_responseis called from a transaction scope different from the one from which the original request was sent. See the OMG Transaction Service specification for details.
-
get_primitive_tc
public abstract TypeCode get_primitive_tc(TCKind tcKind)
Retrieves theTypeCodeobject that represents the given primitive IDL type.- Parameters:
tcKind- theTCKindinstance corresponding to the desired primitive type- Returns:
- the requested
TypeCodeobject
-
create_struct_tc
public abstract TypeCode create_struct_tc(String id, String name, StructMember[] members)
Creates aTypeCodeobject representing an IDLstruct. TheTypeCodeobject is initialized with the given id, name, and members.- Parameters:
id- the repository id for thestructname- the name of thestructmembers- an array describing the members of thestruct- Returns:
- a newly-created
TypeCodeobject describing an IDLstruct
-
create_union_tc
public abstract TypeCode create_union_tc(String id, String name, TypeCode discriminator_type, UnionMember[] members)
Creates aTypeCodeobject representing an IDLunion. TheTypeCodeobject is initialized with the given id, name, discriminator type, and members.- Parameters:
id- the repository id of theunionname- the name of theuniondiscriminator_type- the type of theuniondiscriminatormembers- an array describing the members of theunion- Returns:
- a newly-created
TypeCodeobject describing an IDLunion
-
create_enum_tc
public abstract TypeCode create_enum_tc(String id, String name, String[] members)
Creates aTypeCodeobject representing an IDLenum. TheTypeCodeobject is initialized with the given id, name, and members.- Parameters:
id- the repository id for theenumname- the name for theenummembers- an array describing the members of theenum- Returns:
- a newly-created
TypeCodeobject describing an IDLenum
-
create_alias_tc
public abstract TypeCode create_alias_tc(String id, String name, TypeCode original_type)
Creates aTypeCodeobject representing an IDLalias(typedef). TheTypeCodeobject is initialized with the given id, name, and original type.- Parameters:
id- the repository id for the aliasname- the name for the aliasoriginal_type- theTypeCodeobject describing the original type for which this is an alias- Returns:
- a newly-created
TypeCodeobject describing an IDLalias
-
create_exception_tc
public abstract TypeCode create_exception_tc(String id, String name, StructMember[] members)
Creates aTypeCodeobject representing an IDLexception. TheTypeCodeobject is initialized with the given id, name, and members.- Parameters:
id- the repository id for theexceptionname- the name for theexceptionmembers- an array describing the members of theexception- Returns:
- a newly-created
TypeCodeobject describing an IDLexception
-
create_interface_tc
public abstract TypeCode create_interface_tc(String id, String name)
Creates aTypeCodeobject representing an IDLinterface. TheTypeCodeobject is initialized with the given id and name.- Parameters:
id- the repository id for the interfacename- the name for the interface- Returns:
- a newly-created
TypeCodeobject describing an IDLinterface
-
create_string_tc
public abstract TypeCode create_string_tc(int bound)
Creates aTypeCodeobject representing a bounded IDLstring. TheTypeCodeobject is initialized with the given bound, which represents the maximum length of the string. Zero indicates that the string described by this type code is unbounded.- Parameters:
bound- the bound for thestring; cannot be negative- Returns:
- a newly-created
TypeCodeobject describing a bounded IDLstring - Throws:
BAD_PARAM- if bound is a negative value
-
create_wstring_tc
public abstract TypeCode create_wstring_tc(int bound)
Creates aTypeCodeobject representing a bounded IDLwstring(wide string). TheTypeCodeobject is initialized with the given bound, which represents the maximum length of the wide string. Zero indicates that the string described by this type code is unbounded.- Parameters:
bound- the bound for thewstring; cannot be negative- Returns:
- a newly-created
TypeCodeobject describing a bounded IDLwstring - Throws:
BAD_PARAM- if bound is a negative value
-
create_sequence_tc
public abstract TypeCode create_sequence_tc(int bound, TypeCode element_type)
Creates aTypeCodeobject representing an IDLsequence. TheTypeCodeobject is initialized with the given bound and element type.- Parameters:
bound- the bound for thesequence, 0 if unboundedelement_type- theTypeCodeobject describing the elements contained in thesequence- Returns:
- a newly-created
TypeCodeobject describing an IDLsequence
-
create_recursive_sequence_tc
@Deprecated public abstract TypeCode create_recursive_sequence_tc(int bound, int offset)
Deprecated. Use a combination of create_recursive_tc and create_sequence_tc insteadCreates aTypeCodeobject representing a a recursive IDLsequence.For the IDL
structNode in following code fragment, the offset parameter for creating its sequence would be 1:Struct Node { long value; Sequence <Node> subnodes; };- Parameters:
bound- the bound for the sequence, 0 if unboundedoffset- the index to the enclosingTypeCodeobject that describes the elements of this sequence- Returns:
- a newly-created
TypeCodeobject describing a recursive sequence - See Also:
create_recursive_tc,create_sequence_tc
-
create_array_tc
public abstract TypeCode create_array_tc(int length, TypeCode element_type)
Creates aTypeCodeobject representing an IDLarray. TheTypeCodeobject is initialized with the given length and element type.- Parameters:
length- the length of thearrayelement_type- aTypeCodeobject describing the type of element contained in thearray- Returns:
- a newly-created
TypeCodeobject describing an IDLarray
-
create_native_tc
public TypeCode create_native_tc(String id, String name)
Create aTypeCodeobject for an IDL native type.- Parameters:
id- the logical id for the native type.name- the name of the native type.- Returns:
- the requested TypeCode.
-
create_abstract_interface_tc
public TypeCode create_abstract_interface_tc(String id, String name)
Create aTypeCodeobject for an IDL abstract interface.- Parameters:
id- the logical id for the abstract interface type.name- the name of the abstract interface type.- Returns:
- the requested TypeCode.
-
create_fixed_tc
public TypeCode create_fixed_tc(short digits, short scale)
Create aTypeCodeobject for an IDL fixed type.- Parameters:
digits- specifies the total number of decimal digits in the number and must be from 1 to 31 inclusive.scale- specifies the position of the decimal point.- Returns:
- the requested TypeCode.
-
create_value_tc
public TypeCode create_value_tc(String id, String name, short type_modifier, TypeCode concrete_base, ValueMember[] members)
Create aTypeCodeobject for an IDL value type. The concrete_base parameter is the TypeCode for the immediate concrete valuetype base of the valuetype for which the TypeCode is being created. It may be null if the valuetype does not have a concrete base.- Parameters:
id- the logical id for the value type.name- the name of the value type.type_modifier- one of the value type modifier constants: VM_NONE, VM_CUSTOM, VM_ABSTRACT or VM_TRUNCATABLEconcrete_base- aTypeCodeobject describing the concrete valuetype basemembers- an array containing the members of the value type- Returns:
- the requested TypeCode
-
create_recursive_tc
public TypeCode create_recursive_tc(String id)
Create a recursiveTypeCodeobject which serves as a placeholder for a concrete TypeCode during the process of creating TypeCodes which contain recursion. The id parameter specifies the repository id of the type for which the recursive TypeCode is serving as a placeholder. Once the recursive TypeCode has been properly embedded in the enclosing TypeCode which corresponds to the specified repository id, it will function as a normal TypeCode. Invoking operations on the recursive TypeCode before it has been embedded in the enclosing TypeCode will result in aBAD_TYPECODEexception.For example, the following IDL type declaration contains recursion:
Struct Node { Sequence<Node> subnodes; };To create a TypeCode for struct Node, you would invoke the TypeCode creation operations as shown below:
String nodeID = "IDL:Node:1.0"; TypeCode recursiveSeqTC = orb.create_sequence_tc(0, orb.create_recursive_tc(nodeID)); StructMember[] members = { new StructMember("subnodes", recursiveSeqTC, null) }; TypeCode structNodeTC = orb.create_struct_tc(nodeID, "Node", members);Also note that the following is an illegal IDL type declaration:
Struct Node { Node next; };Recursive types can only appear within sequences which can be empty. That way marshaling problems, when transmitting the struct in an Any, are avoided.
- Parameters:
id- the logical id of the referenced type- Returns:
- the requested TypeCode
-
create_value_box_tc
public TypeCode create_value_box_tc(String id, String name, TypeCode boxed_type)
Creates aTypeCodeobject for an IDL value box.- Parameters:
id- the logical id for the value typename- the name of the value typeboxed_type- the TypeCode for the type- Returns:
- the requested TypeCode
-
create_any
public abstract Any create_any()
Creates an IDLAnyobject initialized to contain aTypecodeobject whosekindfield is set toTCKind.tc_null.- Returns:
- a newly-created
Anyobject
-
get_current
@Deprecated public Current get_current()
Deprecated. useresolve_initial_references.Retrieves aCurrentobject. TheCurrentinterface is used to manage thread-specific information for use by services such as transactions and security.- Returns:
- a newly-created
Currentobject - See Also:
CORBApackage comments for unimplemented features
-
run
public void run()
This operation blocks the current thread until the ORB has completed the shutdown process, initiated when some thread callsshutdown. It may be used by multiple threads which get all notified when the ORB shuts down.
-
shutdown
public void shutdown(boolean wait_for_completion)
Instructs the ORB to shut down, which causes all object adapters to shut down, in preparation for destruction.
If thewait_for_completionparameter is true, this operation blocks until all ORB processing (including processing of currently executing requests, object deactivation, and other object adapter operations) has completed. If an application does this in a thread that is currently servicing an invocation, theBAD_INV_ORDERsystem exception will be thrown with the OMG minor code 3, since blocking would result in a deadlock.
If thewait_for_completionparameter isFALSE, then shutdown may not have completed upon return.While the ORB is in the process of shutting down, the ORB operates as normal, servicing incoming and outgoing requests until all requests have been completed. Once an ORB has shutdown, only object reference management operations may be invoked on the ORB or any object reference obtained from it. An application may also invoke the
destroyoperation on the ORB itself. Invoking any other operation will throw theBAD_INV_ORDERsystem exception with the OMG minor code 4.The
ORB.runmethod will return aftershutdownhas been called.- Parameters:
wait_for_completion-trueif the call should block until the shutdown is complete;falseif it should return immediately- Throws:
BAD_INV_ORDER- if the current thread is servicing an invocation
-
work_pending
public boolean work_pending()
Returnstrueif the ORB needs the main thread to perform some work, andfalseif the ORB does not need the main thread.- Returns:
trueif there is work pending, meaning that the ORB needs the main thread to perform some work;falseif there is no work pending and thus the ORB does not need the main thread
-
perform_work
public void perform_work()
Performs an implementation-dependent unit of work if called by the main thread. Otherwise it does nothing. The methodswork_pendingandperform_workcan be used in conjunction to implement a simple polling loop that multiplexes the main thread among the ORB and other activities.
-
get_service_information
public boolean get_service_information(short service_type, ServiceInformationHolder service_info)Used to obtain information about CORBA facilities and services that are supported by this ORB. The service type for which information is being requested is passed in as the in parameterservice_type, the values defined by constants in the CORBA module. If service information is available for that type, that is returned in the out parameterservice_info, and the operation returns the valuetrue. If no information for the requested services type is available, the operation returnsfalse(i.e., the service is not supported by this ORB).- Parameters:
service_type- ashortindicating the service type for which information is being requestedservice_info- aServiceInformationHolderobject that will hold theServiceInformationobject produced by this method- Returns:
trueif service information is available for theservice_type;falseif no information for the requested services type is available- See Also:
CORBApackage comments for unimplemented features
-
create_dyn_any
@Deprecated public DynAny create_dyn_any(Any value)
Deprecated. Use the new DynAnyFactory API insteadCreates a newDynAnyobject from the givenAnyobject.- Parameters:
value- theAnyobject from which to create a newDynAnyobject- Returns:
- the new
DynAnyobject created from the givenAnyobject - See Also:
CORBApackage comments for unimplemented features
-
create_basic_dyn_any
@Deprecated public DynAny create_basic_dyn_any(TypeCode type) throws InconsistentTypeCode
Deprecated. Use the new DynAnyFactory API insteadCreates a basicDynAnyobject from the givenTypeCodeobject.- Parameters:
type- theTypeCodeobject from which to create a newDynAnyobject- Returns:
- the new
DynAnyobject created from the givenTypeCodeobject - Throws:
InconsistentTypeCode- if the givenTypeCodeobject is not consistent with the operation.- See Also:
CORBApackage comments for unimplemented features
-
create_dyn_struct
@Deprecated public DynStruct create_dyn_struct(TypeCode type) throws InconsistentTypeCode
Deprecated. Use the new DynAnyFactory API insteadCreates a newDynStructobject from the givenTypeCodeobject.- Parameters:
type- theTypeCodeobject from which to create a newDynStructobject- Returns:
- the new
DynStructobject created from the givenTypeCodeobject - Throws:
InconsistentTypeCode- if the givenTypeCodeobject is not consistent with the operation.- See Also:
CORBApackage comments for unimplemented features
-
create_dyn_sequence
@Deprecated public DynSequence create_dyn_sequence(TypeCode type) throws InconsistentTypeCode
Deprecated. Use the new DynAnyFactory API insteadCreates a newDynSequenceobject from the givenTypeCodeobject.- Parameters:
type- theTypeCodeobject from which to create a newDynSequenceobject- Returns:
- the new
DynSequenceobject created from the givenTypeCodeobject - Throws:
InconsistentTypeCode- if the givenTypeCodeobject is not consistent with the operation.- See Also:
CORBApackage comments for unimplemented features
-
create_dyn_array
@Deprecated public DynArray create_dyn_array(TypeCode type) throws InconsistentTypeCode
Deprecated. Use the new DynAnyFactory API insteadCreates a newDynArrayobject from the givenTypeCodeobject.- Parameters:
type- theTypeCodeobject from which to create a newDynArrayobject- Returns:
- the new
DynArrayobject created from the givenTypeCodeobject - Throws:
InconsistentTypeCode- if the givenTypeCodeobject is not consistent with the operation.- See Also:
CORBApackage comments for unimplemented features
-
create_dyn_union
@Deprecated public DynUnion create_dyn_union(TypeCode type) throws InconsistentTypeCode
Deprecated. Use the new DynAnyFactory API insteadCreates a newDynUnionobject from the givenTypeCodeobject.- Parameters:
type- theTypeCodeobject from which to create a newDynUnionobject- Returns:
- the new
DynUnionobject created from the givenTypeCodeobject - Throws:
InconsistentTypeCode- if the givenTypeCodeobject is not consistent with the operation.- See Also:
CORBApackage comments for unimplemented features
-
create_dyn_enum
@Deprecated public DynEnum create_dyn_enum(TypeCode type) throws InconsistentTypeCode
Deprecated. Use the new DynAnyFactory API insteadCreates a newDynEnumobject from the givenTypeCodeobject.- Parameters:
type- theTypeCodeobject from which to create a newDynEnumobject- Returns:
- the new
DynEnumobject created from the givenTypeCodeobject - Throws:
InconsistentTypeCode- if the givenTypeCodeobject is not consistent with the operation.- See Also:
CORBApackage comments for unimplemented features
-
create_policy
public Policy create_policy(int type, Any val) throws PolicyError
Can be invoked to create new instances of policy objects of a specific type with specified initial state. Ifcreate_policyfails to instantiate a new Policy object due to its inability to interpret the requested type and content of the policy, it raises thePolicyErrorexception with the appropriate reason.- Parameters:
type- thePolicyTypeof the policy object to be createdval- the value that will be used to set the initial state of thePolicyobject that is created- Returns:
- Reference to a newly created
Policyobject of type specified by thetypeparameter and initialized to a state specified by thevalparameter - Throws:
PolicyError- when the requested policy is not supported or a requested initial state for the policy is not supported.
-
-