Methods Summary |
---|
public void | connect(org.omg.CORBA.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 the ImplBase class corresponding to the interface that is
supported by the server. The servant must thus be a CORBA object
reference, and inherit from org.omg.CORBA.Object .
Servants created by the user can start receiving remote invocations
after the method connect has 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 connect has no effect
when the servant object is already connected to the ORB.
Deprecated by the OMG in favor of the Portable Object Adapter APIs.
throw new NO_IMPLEMENT();
|
public org.omg.CORBA.TypeCode | create_abstract_interface_tc(java.lang.String id, java.lang.String name)Create a TypeCode object for an IDL abstract interface.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract TypeCode | create_alias_tc(java.lang.String id, java.lang.String name, TypeCode original_type)Creates a TypeCode object representing an IDL alias
(typedef ).
The TypeCode object is initialized with the given id,
name, and original type.
|
public abstract Any | create_any()Creates an IDL Any object initialized to
contain a Typecode object whose kind field
is set to TCKind.tc_null .
|
public abstract TypeCode | create_array_tc(int length, TypeCode element_type)Creates a TypeCode object representing an IDL array .
The TypeCode object is initialized with the given length and
element type.
|
public org.omg.CORBA.DynAny | create_basic_dyn_any(org.omg.CORBA.TypeCode type)Creates a basic DynAny object from the given
TypeCode object.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract ContextList | create_context_list()Creates an empty ContextList object.
|
public org.omg.CORBA.DynAny | create_dyn_any(org.omg.CORBA.Any value)Creates a new DynAny object from the given
Any object.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public org.omg.CORBA.DynArray | create_dyn_array(org.omg.CORBA.TypeCode type)Creates a new DynArray object from the given
TypeCode object.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public org.omg.CORBA.DynEnum | create_dyn_enum(org.omg.CORBA.TypeCode type)Creates a new DynEnum object from the given
TypeCode object.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public org.omg.CORBA.DynSequence | create_dyn_sequence(org.omg.CORBA.TypeCode type)Creates a new DynSequence object from the given
TypeCode object.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public org.omg.CORBA.DynStruct | create_dyn_struct(org.omg.CORBA.TypeCode type)Creates a new DynStruct object from the given
TypeCode object.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public org.omg.CORBA.DynUnion | create_dyn_union(org.omg.CORBA.TypeCode type)Creates a new DynUnion object from the given
TypeCode object.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract TypeCode | create_enum_tc(java.lang.String id, java.lang.String name, java.lang.String[] members)Creates a TypeCode object representing an IDL enum .
The TypeCode object is initialized with the given id,
name, and members.
|
public abstract Environment | create_environment()Creates an Environment object.
|
public abstract ExceptionList | create_exception_list()Creates an empty ExceptionList object.
|
public abstract TypeCode | create_exception_tc(java.lang.String id, java.lang.String name, StructMember[] members)Creates a TypeCode object representing an IDL exception .
The TypeCode object is initialized with the given id,
name, and members.
|
public org.omg.CORBA.TypeCode | create_fixed_tc(short digits, short scale)Create a TypeCode object for an IDL fixed type.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
private static org.omg.CORBA.ORB | create_impl(java.lang.String className)
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null)
cl = ClassLoader.getSystemClassLoader();
try {
return (ORB) Class.forName(className, true, cl).newInstance();
} catch (Throwable ex) {
SystemException systemException = new INITIALIZE(
"can't instantiate default ORB implementation " + className);
systemException.initCause(ex);
throw systemException;
}
|
public abstract TypeCode | create_interface_tc(java.lang.String id, java.lang.String name)Creates a TypeCode object representing an IDL interface .
The TypeCode object is initialized with the given id
and name.
|
public abstract NVList | create_list(int count)Allocates an NVList with (probably) enough
space for the specified number of NamedValue objects.
Note that the specified size is only a hint to help with
storage allocation and does not imply the maximum size of the list.
|
public abstract NamedValue | create_named_value(java.lang.String s, org.omg.CORBA.Any any, int flags)Creates a NamedValue object
using the given name, value, and argument mode flags.
A NamedValue object serves as (1) a parameter or return
value or (2) a context property.
It may be used by itself or
as an element in an NVList object.
|
public org.omg.CORBA.TypeCode | create_native_tc(java.lang.String id, java.lang.String name)Create a TypeCode object for an IDL native type.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public NVList | create_operation_list(org.omg.CORBA.Object oper)Creates an NVList initialized with argument
descriptions for the operation described in the given
OperationDef object. This OperationDef object
is obtained from an Interface Repository. The arguments in the
returned NVList object 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.
// If we came here, it means that the actual ORB implementation
// did not have a create_operation_list(...CORBA.Object oper) method,
// so lets check if it has a create_operation_list(OperationDef oper)
// method.
try {
// First try to load the OperationDef class
String opDefClassName = "org.omg.CORBA.OperationDef";
Class opDefClass = null;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if ( cl == null )
cl = ClassLoader.getSystemClassLoader();
// if this throws a ClassNotFoundException, it will be caught below.
opDefClass = Class.forName(opDefClassName, true, cl);
// OK, we loaded OperationDef. Now try to get the
// create_operation_list(OperationDef oper) method.
Class[] argc = { opDefClass };
java.lang.reflect.Method meth =
this.getClass().getMethod("create_operation_list", argc);
// OK, the method exists, so invoke it and be happy.
Object[] argx = { oper };
return (org.omg.CORBA.NVList)meth.invoke(this, argx);
}
catch( java.lang.reflect.InvocationTargetException exs ) {
Throwable t = exs.getTargetException();
if (t instanceof Error) {
throw (Error) t;
}
else if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
else {
throw new org.omg.CORBA.NO_IMPLEMENT();
}
}
catch( RuntimeException ex ) {
throw ex;
}
catch( Exception exr ) {
throw new org.omg.CORBA.NO_IMPLEMENT();
}
|
public abstract org.omg.CORBA.portable.OutputStream | create_output_stream()Creates a new org.omg.CORBA.portable.OutputStream into which
IDL method parameters can be marshalled during method invocation.
|
public org.omg.CORBA.Policy | create_policy(int type, org.omg.CORBA.Any val)Can be invoked to create new instances of policy objects
of a specific type with specified initial state. If
create_policy fails to instantiate a new Policy
object due to its inability to interpret the requested type
and content of the policy, it raises the PolicyError
exception with the appropriate reason.
// Currently not implemented until PIORB.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract TypeCode | create_recursive_sequence_tc(int bound, int offset)Creates a TypeCode object representing a
a recursive IDL sequence .
For the IDL struct Node in following code fragment,
the offset parameter for creating its sequence would be 1:
Struct Node {
long value;
Sequence <Node> subnodes;
};
|
public org.omg.CORBA.TypeCode | create_recursive_tc(java.lang.String id)Create a recursive TypeCode object 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 a BAD_TYPECODE exception.
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.
// implemented in subclass
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract TypeCode | create_sequence_tc(int bound, TypeCode element_type)Creates a TypeCode object representing an IDL sequence .
The TypeCode object is initialized with the given bound and
element type.
|
public abstract TypeCode | create_string_tc(int bound)Creates a TypeCode object representing a bounded IDL
string .
The TypeCode object 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.
|
public abstract TypeCode | create_struct_tc(java.lang.String id, java.lang.String name, StructMember[] members)Creates a TypeCode object representing an IDL struct .
The TypeCode object is initialized with the given id,
name, and members.
|
public abstract TypeCode | create_union_tc(java.lang.String id, java.lang.String name, TypeCode discriminator_type, UnionMember[] members)Creates a TypeCode object representing an IDL union .
The TypeCode object is initialized with the given id,
name, discriminator type, and members.
|
public org.omg.CORBA.TypeCode | create_value_box_tc(java.lang.String id, java.lang.String name, TypeCode boxed_type)Creates a TypeCode object for an IDL value box.
// implemented in subclass
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public org.omg.CORBA.TypeCode | create_value_tc(java.lang.String id, java.lang.String name, short type_modifier, TypeCode concrete_base, ValueMember[] members)Create a TypeCode object 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.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract TypeCode | create_wstring_tc(int bound)Creates a TypeCode object representing a bounded IDL
wstring (wide string).
The TypeCode object 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.
|
public void | destroy()Destroys the ORB so that its resources can be reclaimed.
Any operation invoked on a destroyed ORB reference will throw the
OBJECT_NOT_EXIST exception.
Once an ORB has been destroyed, another call to init
with the same ORBid will return a reference to a newly constructed ORB.
If destroy is 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 calls destroy in a thread that is currently servicing
an invocation, the BAD_INV_ORDER system 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 shutdown and destroy
on all ORB instances before exiting.
throw new NO_IMPLEMENT();
|
public void | disconnect(org.omg.CORBA.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 exception
org.omg.CORBA.OBJECT_NOT_EXIST back 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 disconnect has no effect
if the servant is not connected to the ORB.
Deprecated by the OMG in favor of the Portable Object Adapter APIs.
throw new NO_IMPLEMENT();
|
private static java.lang.String | getPropertyFromFile(java.lang.String name)
// This will not throw a SecurityException because this
// class was loaded from rt.jar using the bootstrap classloader.
String propValue = (String) AccessController.doPrivileged(
new PrivilegedAction() {
private Properties getFileProperties( String fileName ) {
try {
File propFile = new File( fileName ) ;
if (!propFile.exists())
return null ;
Properties props = new Properties() ;
FileInputStream fis = new FileInputStream(propFile);
try {
props.load( fis );
} finally {
fis.close() ;
}
return props ;
} catch (Exception exc) {
return null ;
}
}
public java.lang.Object run() {
String userHome = System.getProperty("user.home");
String fileName = userHome + File.separator +
"orb.properties" ;
Properties props = getFileProperties( fileName ) ;
if (props != null) {
String value = props.getProperty( name ) ;
if (value != null)
return value ;
}
String javaHome = System.getProperty("java.home");
fileName = javaHome + File.separator
+ "lib" + File.separator + "orb.properties";
props = getFileProperties( fileName ) ;
if (props == null)
return null ;
else
return props.getProperty( name ) ;
}
}
);
return propValue;
|
private static java.lang.String | getSystemProperty(java.lang.String name)
// Get System property
// This will not throw a SecurityException because this
// class was loaded from rt.jar using the bootstrap classloader.
String propValue = (String) AccessController.doPrivileged(
new PrivilegedAction() {
public java.lang.Object run() {
return System.getProperty(name);
}
}
);
return propValue;
|
public org.omg.CORBA.Current | get_current()Retrieves a Current object.
The Current interface is used to manage thread-specific
information for use by services such as transactions and security.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract Context | get_default_context()Gets the default Context object.
|
public abstract Request | get_next_response()Gets the next Request instance for which a response
has been received.
|
public abstract TypeCode | get_primitive_tc(TCKind tcKind)Retrieves the TypeCode object that represents
the given primitive IDL type.
|
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
parameter service_type, the values defined by
constants in the CORBA module. If service information is
available for that type, that is returned in the out parameter
service_info, and the operation returns the
value true. If no information for the requested
services type is available, the operation returns false
(i.e., the service is not supported by this ORB).
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public static org.omg.CORBA.ORB | init()Returns the ORB singleton object. This method always returns the
same ORB instance, which is an instance of the class described by the
org.omg.CORBA.ORBSingletonClass system property.
This no-argument version of the method init is used primarily
as a factory for TypeCode objects, which are used by
Helper classes to implement the method type .
It is also used to create Any objects that are used to
describe union labels (as part of creating a
TypeCode object for a union ).
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
TypeCode objects. Any TypeCode objects
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 TypeCode objects are invoked.
if (singleton == null) {
String className = getSystemProperty(ORBSingletonClassKey);
if (className == null)
className = getPropertyFromFile(ORBSingletonClassKey);
if (className == null)
className = defaultORBSingleton;
singleton = create_impl(className);
}
return singleton;
|
public static org.omg.CORBA.ORB | init(java.lang.String[] args, java.util.Properties props)Creates a new ORB instance for a standalone
application. This method may be called from applications
only and returns a new fully functional ORB object
each time it is called.
//
// Note that there is no standard command-line argument for
// specifying the default ORB implementation. For an
// application you can choose an implementation either by
// setting the CLASSPATH to pick a different org.omg.CORBA
// and it's baked-in ORB implementation default or by
// setting an entry in the properties object or in the
// system properties.
//
String className = null;
ORB orb;
if (props != null)
className = props.getProperty(ORBClassKey);
if (className == null)
className = getSystemProperty(ORBClassKey);
if (className == null)
className = getPropertyFromFile(ORBClassKey);
if (className == null)
className = defaultORB;
orb = create_impl(className);
orb.set_parameters(args, props);
return orb;
|
public static org.omg.CORBA.ORB | init(java.applet.Applet app, java.util.Properties props)Creates a new ORB instance for an applet. This
method may be called from applets only and returns a new
fully-functional ORB object each time it is called.
String className;
ORB orb;
className = app.getParameter(ORBClassKey);
if (className == null && props != null)
className = props.getProperty(ORBClassKey);
if (className == null)
className = getSystemProperty(ORBClassKey);
if (className == null)
className = getPropertyFromFile(ORBClassKey);
if (className == null)
className = defaultORB;
orb = create_impl(className);
orb.set_parameters(app, props);
return orb;
|
public abstract java.lang.String[] | list_initial_services()Returns a list of the initially available CORBA object references,
such as "NameService" and "InterfaceRepository".
|
public abstract java.lang.String | object_to_string(org.omg.CORBA.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 String object may be stored or communicated
in any way that a String object can be manipulated.
|
public void | perform_work()Performs an implementation-dependent unit of work if called
by the main thread. Otherwise it does nothing.
The methods work_pending and perform_work
can be used in
conjunction to implement a simple polling loop that multiplexes
the main thread among the ORB and other activities.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract boolean | poll_next_response()Finds out if any of the deferred (asynchronous) invocations have
a response yet.
|
public abstract org.omg.CORBA.Object | resolve_initial_references(java.lang.String object_name)Resolves a specific object reference from the set of available
initial service names.
|
public void | run()This operation blocks the current thread until the ORB has
completed the shutdown process, initiated when some thread calls
shutdown . It may be used by multiple threads which
get all notified when the ORB shuts down.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract void | send_multiple_requests_deferred(Request[] req)Sends multiple dynamic (DII) requests asynchronously.
|
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.
|
protected abstract void | set_parameters(java.lang.String[] args, java.util.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 appropriate init method to pass in its parameters.
|
protected abstract void | set_parameters(java.applet.Applet app, java.util.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 appropriate init method to pass in its parameters.
|
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 the wait_for_completion parameter
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, the BAD_INV_ORDER system exception
will be thrown with the OMG minor code 3,
since blocking would result in a deadlock.
If the wait_for_completion parameter is FALSE ,
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 destroy operation on the ORB itself.
Invoking any other operation will throw the BAD_INV_ORDER
system exception with the OMG minor code 4.
The ORB.run method will return after
shutdown has been called.
throw new org.omg.CORBA.NO_IMPLEMENT();
|
public abstract org.omg.CORBA.Object | string_to_object(java.lang.String str)Converts a string produced by the method object_to_string
back to a CORBA object reference.
|
public boolean | work_pending()Returns true if the ORB needs the main thread to
perform some work, and false if the ORB does not
need the main thread.
throw new org.omg.CORBA.NO_IMPLEMENT();
|