Interface IEnvironment
With this interface, objects can be registered at and revoked from an environment.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets the context of this environment.getName()
Deprecated.Gets the name of this environment.getRegisteredInterface
(String oid, Type type) Deprecated.Retrieves a registered object, specified by OID and UNO interface type.getRegisteredObjectIdentifier
(Object object) Deprecated.Retrieves the OID for a registered object.void
list()
Deprecated.Lists the registered objects toSystem.out
.registerInterface
(Object object, String[] oid, Type type) Deprecated.Registers one UNO interface facet of an object.void
revokeInterface
(String oid, Type type) Deprecated.Explicitly revokes a UNO interface facet.
-
Method Details
-
getContext
Object getContext()Deprecated.Gets the context of this environment.- Returns:
- the context of this environment
-
getName
String getName()Deprecated.Gets the name of this environment.- Returns:
- the name of this environment
-
registerInterface
Deprecated.Registers one UNO interface facet of an object.Such an object will typically be one of three things:
- A local Java object, to be mapped out of this environment via a given bridge.
- A proxy object, mapped into this environment via some bridge B1, and now to be mapped out of this environment via a given bridge B2.
- A proxy object, created as a remote object is mapped into this environment via a given bridge.
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 callregisterInterface
for the same combination ofoid
andtype
at the same time; the race condition is solved by letting one of the calls register its argumentobject
, ignoring the argumentobject
of the other call, and letting both calls return the sameobject
.The registered object is held only weakly by the environment. After a call to
registerInterface
, a call togetRegisteredInterface
only succeeds as long as the registered object is still strongly reachable, and the registered object has not been explicitly revoked by callingrevokeInterface
.- Parameters:
object
- the object to register; must be non-nulloid
- in-out parameter containing the OID ofobject
. 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 givenobject
should implement thistype
.- Returns:
- the registered object (may differ from the
object
passed in); will never be null
-
revokeInterface
Deprecated.Explicitly revokes a UNO interface facet.Calls to
registerInterface
andrevokeInterface
must be paired. A facet is only removed from the environment when it has been revoked as often as it has been registered. This may change in the future, so that a facet would be removed upon the first call torevokeInterface
(and calls torevokeInterface
would no longer be necessary if the calling code does not want to control the temporal extent of the registration).It is not an error if the specified facet is not registered at this environment (either because no corresponding object has ever been registered, or it has been explicitly revoked, or it is no longer strongly reachable). In such a case, this method simply does nothing.
- Parameters:
oid
- the OID of the object to revoke; must be non-nulltype
- the UNO interface type of the object to revoke. This argument must be non-null, and must denote a UNO interface type.
-
getRegisteredInterface
Deprecated.Retrieves a registered object, specified by OID and UNO interface type.- Parameters:
oid
- the OID of the object to retrieve; must be non-nulltype
- the UNO interface type of the object to retrieve. This argument must be non-null, and must denote a UNO interface type.- Returns:
- the registered object, or null if none is found
-
getRegisteredObjectIdentifier
Deprecated.Retrieves the OID for a registered object.- Parameters:
object
- a registered object; must be non-null- Returns:
- the OID of the
object
; will never be null
-
list
void list()Deprecated.Lists the registered objects toSystem.out
.This is for debug purposes.
-