Top Description Inners Fields Constructors Methods
com.sun.star.lib.uno.environments.java

public final Class java_environment

extends Object
implements IEnvironment
Class Inheritance
All Implemented Interfaces
com.sun.star.uno.IEnvironment
Imports
com.sun.star.uno.IEnvironment, .Type, .UnoRuntime, java.lang.ref.ReferenceQueue, .WeakReference, java.util.HashMap, .Iterator

References Deprecated

IEnvironment is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The java_environment is the environment where objects and interfaces are registered, which are mapped out of java or into java.

The java_environment implements the IEnvironment interface defined in the uno runtime.

Since
UDK1.0
See Also
com.sun.star.uno.UnoRuntime, com.sun.star.uno.IEnvironment

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Object
private static final java_environment.Registry
private final java_environment.Registry

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public Object
getContext()

Implements com.sun.star.uno.IEnvironment.getContext.

Gets the context of this environment.

public String
getName()

Implements com.sun.star.uno.IEnvironment.getName.

Gets the name of this environment.

public Object
getRegisteredInterface(String
object id of interface to be retrieved.
oid
,
Type
the type description of the interface to be retrieved.
type
)

Implements com.sun.star.uno.IEnvironment.getRegisteredInterface.

Retrieves an interface identified by its object id and type from this environment.

public String
getRegisteredObjectIdentifier(Object
a registered interface.
object
)

Implements com.sun.star.uno.IEnvironment.getRegisteredObjectIdentifier.

Retrieves the object identifier for a registered interface from this environment.

private boolean
isProxy(Object object)

public void
list()

Implements com.sun.star.uno.IEnvironment.list.

Lists the registered objects to System.out.

public Object
registerInterface(Object object, String[] oid, Type type)

Implements com.sun.star.uno.IEnvironment.registerInterface.

Registers one UNO interface facet of an object.

public void
revokeAllProxies()

Revokes all registered proxy interfaces.

public void
revokeInterface(String
object id of interface to be revoked.
oid
,
Type
the type description of the interface.
type
)

Implements com.sun.star.uno.IEnvironment.revokeInterface.

You have to revoke ANY interface that has been registered via this method.

Inherited from java.lang.Object:
clonefinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
private final Object context
localObjectsback to summary
private static final java_environment.Registry localObjects
proxiesback to summary
private final java_environment.Registry proxies

Constructor Detail

java_environmentback to summary
public java_environment(Object context)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getContextback to summary
public Object getContext()

Implements com.sun.star.uno.IEnvironment.getContext.

Doc from com.sun.star.uno.IEnvironment.getContext.

Gets the context of this environment.

See Also
com.sun.star.uno.IEnvironment#getContext
getNameback to summary
public String getName()

Implements com.sun.star.uno.IEnvironment.getName.

Doc from com.sun.star.uno.IEnvironment.getName.

Gets the name of this environment.

See Also
com.sun.star.uno.IEnvironment#getName
getRegisteredInterfaceback to summary
public Object getRegisteredInterface(String oid, Type type)

Implements com.sun.star.uno.IEnvironment.getRegisteredInterface.

Retrieves an interface identified by its object id and type from this environment.

Parameters
oid:String

object id of interface to be retrieved.

type:Type

the type description of the interface to be retrieved.

See Also
com.sun.star.uno.IEnvironment#getRegisteredInterface
getRegisteredObjectIdentifierback to summary
public String getRegisteredObjectIdentifier(Object object)

Implements com.sun.star.uno.IEnvironment.getRegisteredObjectIdentifier.

Retrieves the object identifier for a registered interface from this environment.

Parameters
object:Object

a registered interface.

See Also
com.sun.star.uno.IEnvironment#getRegisteredObjectIdentifier
isProxyback to summary
private boolean isProxy(Object object)
listback to summary
public void list()

Implements com.sun.star.uno.IEnvironment.list.

Doc from com.sun.star.uno.IEnvironment.list.

Lists the registered objects to System.out.

This is for debug purposes.

See Also
com.sun.star.uno.IEnvironment#list
registerInterfaceback to summary
public Object registerInterface(Object object, String[] oid, Type type)

Implements com.sun.star.uno.IEnvironment.registerInterface.

Doc from com.sun.star.uno.IEnvironment.registerInterface.

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 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.

See Also
com.sun.star.uno.IEnvironment#registerInterface
revokeAllProxiesback to summary
public void revokeAllProxies()

Revokes all registered proxy interfaces.

This method should be part of IEnvironment. It is called from com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.dispose.

revokeInterfaceback to summary
public void revokeInterface(String oid, Type type)

Implements com.sun.star.uno.IEnvironment.revokeInterface.

You have to revoke ANY interface that has been registered via this method.

Parameters
oid:String

object id of interface to be revoked.

type:Type

the type description of the interface.

See Also
com.sun.star.uno.IEnvironment#revokeInterface
com.sun.star.lib.uno.environments.java back to summary

private final Class java_environment.Registry

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.star.lib.uno.environments.java.java_environment.Registry

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final HashMap<String, java_environment.Registry.Level1Entry>
private final ReferenceQueue<Object>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
public synchronized void
public synchronized Object
get(String oid, Type type)

public synchronized Object
register(Object object, String oid, Type type)

private void
public synchronized boolean
revoke(String oid, Type type)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

level1mapback to summary
private final HashMap<String, java_environment.Registry.Level1Entry> level1map
queueback to summary
private final ReferenceQueue<Object> queue

Constructor Detail

Registryback to summary
private Registry()

Method Detail

cleanUpback to summary
private void cleanUp()
clearback to summary
public synchronized void clear()
getback to summary
public synchronized Object get(String oid, Type type)
registerback to summary
public synchronized Object register(Object object, String oid, Type type)
removeLevel2Entryback to summary
private void removeLevel2Entry(java_environment.Registry.Level1Entry l1, String oid, Type type)
revokeback to summary
public synchronized boolean revoke(String oid, Type type)
com.sun.star.lib.uno.environments.java back to summary

private final Class java_environment.Registry.Level1Entry

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.star.lib.uno.environments.java.java_environment.Registry.Level1Entry

Field Summary

Modifier and TypeField and Description
public final HashMap<Type, java_environment.Registry.Level2Entry>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object
find(Type type)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

level2mapback to summary
public final HashMap<Type, java_environment.Registry.Level2Entry> level2map

Constructor Detail

Level1Entryback to summary
private Level1Entry()

Method Detail

findback to summary
public Object find(Type type)
com.sun.star.lib.uno.environments.java back to summary

private final Class java_environment.Registry.Level2Entry

extends WeakReference<Object>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int
public final String
public final Type

Constructor Summary

AccessConstructor and Description
public
Level2Entry(String oid, Type type, Object object, ReferenceQueue<Object> queue)

Method Summary

Modifier and TypeMethod and Description
public void
public boolean

Field Detail

countback to summary
private int count
oidback to summary
public final String oid
typeback to summary
public final Type type

Constructor Detail

Level2Entryback to summary
public Level2Entry(String oid, Type type, Object object, ReferenceQueue<Object> queue)

Method Detail

acquireback to summary
public void acquire()
releaseback to summary
public boolean release()