public final class java_environment extends java.lang.Object implements IEnvironment
The java_environment implements the IEnvironment
interface
defined in the uno runtime.
UnoRuntime
,
IEnvironment
Constructor and Description |
---|
java_environment(java.lang.Object context) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.Object |
getContext()
Gets the context of this environment.
|
java.lang.String |
getName()
Gets the name of this environment.
|
java.lang.Object |
getRegisteredInterface(java.lang.String oid,
Type type)
Retrieves an interface identified by its object id and type from this
environment.
|
java.lang.String |
getRegisteredObjectIdentifier(java.lang.Object object)
Retrieves the object identifier for a registered interface from this
environment.
|
void |
list()
Lists the registered objects to
System.out . |
java.lang.Object |
registerInterface(java.lang.Object object,
java.lang.String[] oid,
Type type)
Registers one UNO interface facet of an object.
|
void |
revokeAllProxies()
Revokes all registered proxy interfaces.
|
void |
revokeInterface(java.lang.String oid,
Type type)
You have to revoke ANY interface that has been registered via this
method.
|
public java.lang.Object getContext()
IEnvironment
getContext
in interface IEnvironment
public java.lang.String getName()
IEnvironment
getName
in interface IEnvironment
public java.lang.Object registerInterface(java.lang.Object object, java.lang.String[] oid, Type type)
IEnvironment
Such an object will typically be one of three things:
The object actually registered may differ from the specified
object
that is passed as an argument. This enables an
environment to work in a multi-threaded scenario, where two threads can
call registerInterface
for the same combination of
oid
and type
at the same time; the race
condition is solved by letting one of the calls register its argument
object
, ignoring the argument object
of the
other call, and letting both calls return the same
object
.
The registered object is held only weakly by the environment. After a
call to registerInterface
, a call to
getRegisteredInterface
only succeeds as long as the
registered object is still strongly reachable, and the registered object
has not been explicitly revoked by calling
revokeInterface
.
registerInterface
in interface IEnvironment
object
- the object to register; must be non-nulloid
- in-out parameter containing the OID of object
.
This must be a non-null reference to an array of length at least one;
the zeroth element is used to pass the argument in and out. If the
zeroth element is null on input, the OID will be computed and passed
out (that is, the zeroth element will never be null upon normal
return).type
- the UNO interface type to register. This argument must be
non-null, and must denote a UNO interface type. The given
object
should implement this type
.object
passed in); will never be nullpublic void revokeInterface(java.lang.String oid, Type type)
revokeInterface
in interface IEnvironment
oid
- object id of interface to be revokedtype
- the type description of the interfaceIEnvironment.revokeInterface(java.lang.String, com.sun.star.uno.Type)
public java.lang.Object getRegisteredInterface(java.lang.String oid, Type type)
getRegisteredInterface
in interface IEnvironment
oid
- object id of interface to be retrievedtype
- the type description of the interface to be retrievedIEnvironment.getRegisteredInterface(java.lang.String, com.sun.star.uno.Type)
public java.lang.String getRegisteredObjectIdentifier(java.lang.Object object)
getRegisteredObjectIdentifier
in interface IEnvironment
object
- a registered interfaceobject
; will never be nullIEnvironment.getRegisteredObjectIdentifier(java.lang.Object)
public void list()
IEnvironment
System.out
.
This is for debug purposes.
list
in interface IEnvironment
public void revokeAllProxies()
This method should be part of IEnvironment
. It is called
from com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.dispose
.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object