Top Description Inners Fields Constructors Methods
com.sun.star.lib.uno.bridges.java_remote

public Class java_remote_bridge

extends Object
implements IBridge, IReceiver, RequestHandler, com.sun.star.bridge.XBridge, com.sun.star.lang.XComponent, DisposeNotifier
Class Inheritance
All Implemented Interfaces
com.sun.star.lib.util.DisposeNotifier, com.sun.star.lib.uno.bridges.java_remote.RequestHandler, com.sun.star.lib.uno.environments.remote.IReceiver, com.sun.star.uno.IBridge
Imports
java.io.IOException, .InputStream, .OutputStream, java.util.ArrayList, .HashMap, .Iterator, .LinkedList, .Map, java.util.concurrent.atomic.AtomicInteger, com.sun.star.bridge.XBridge, com.sun.star.bridge.XInstanceProvider, com.sun.star.connection.XConnection, com.sun.star.lang.DisposedException, com.sun.star.lang.EventObject, com.sun.star.lang.XComponent, com.sun.star.lang.XEventListener, com.sun.star.lib.uno.environments.java.java_environment, com.sun.star.lib.uno.environments.remote.IProtocol, .IReceiver, .IThreadPool, .Job, .Message, .ThreadId, .ThreadPoolManager, com.sun.star.lib.uno.typedesc.MethodDescription, .TypeDescription, com.sun.star.lib.util.DisposeListener, .DisposeNotifier, com.sun.star.uno.Any, .IBridge, .IEnvironment, .Type, .UnoRuntime, com.sun.star.uno.TypeClass, com.sun.star.uno.XInterface

References Deprecated

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

See corresponding docs for further information.

This class implements a remote bridge.

Therefore various interfaces are implemented.

The protocol to used is passed by name, the bridge then looks for it under com.sun.star.lib.uno.protocols.

Since
UDK1.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class
java_remote_bridge.RefHolder

The ref holder stuff strongly holds objects mapped out via this bridge (the java_environment only holds them weakly).

Field Summary

Modifier and TypeField and Description
protected IProtocol
protected IThreadPool
protected IEnvironment
_java_environment

References Deprecated IEnvironment is deprecated or references (maybe indirectly) at least one deprecated element.
protected final AtomicInteger
private final ArrayList<com.sun.star.lang.XEventListener>
protected java_remote_bridge.MessageDispatcher
protected String
protected com.sun.star.connection.XConnection
protected com.sun.star.bridge.XInstanceProvider
private static final boolean
DEBUG

When set to true, enables various debugging output.

private boolean
private final ArrayList<DisposeListener>
private final String
private final ProxyFactory
private final HashMap<String, LinkedList<java_remote_bridge.RefHolder>>

Constructor Summary

AccessConstructor and Description
public
java_remote_bridge(IEnvironment java_environment, IEnvironment remote_environment, Object[] args)
References Deprecated IEnvironment is deprecated or references (maybe indirectly) at least one deprecated element.

public
java_remote_bridge(Object[]
the custom parameters: arg[0] == protocol_name, arg[1] == xConnection, arg[2] == xInstanceProvider.
args
)
Deprecated as of UDK 1.0

Constructs a new bridge.

Method Summary

Modifier and TypeMethod and Description
public void
acquire()

Implements com.sun.star.uno.IBridge.acquire.

Increases the life count.

public void
addDisposeListener(DisposeListener listener)

Implements com.sun.star.lib.util.DisposeNotifier.addDisposeListener.

Adds a dispose listener, to be notified when this object is disposed.

public void
addEventListener(com.sun.star.lang.XEventListener xEventListener)

Methods XComponent.

pack-priv final void
addRefHolder(Object obj, Type type, String oid)

private synchronized void
checkDisposed()

This function must only be called while synchronized on this object.

public void
dispose()

Implements com.sun.star.uno.IBridge.dispose.

Disposes the bridge.

private void
dispose(Throwable throwable)

pack-priv final void
public String

Returns:

connection type and protocol.
getDescription
()

Gives a description of the connection type and protocol used.

public Object
getInstance(String instanceName)

pack-priv int
getLifeCount()

This method is for testing only.

public String

Returns:

the name of this bridge.
getName
()

Gives the name of this bridge.

pack-priv IProtocol
getProtocol()

This method is for testing only.

public IEnvironment

Returns:

the source environment of this bridge.
getSourceEnvironment
()

Implements com.sun.star.uno.IBridge.getSourceEnvironment.

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

Gives the source environment.

public IEnvironment

Returns:

the destination environment of this bridge.
getTargetEnvironment
()

Implements com.sun.star.uno.IBridge.getTargetEnvironment.

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

Gives the destination environment.

private boolean
public Object

Returns:

the object in the source environment.
mapInterfaceFrom
(Object
the object to map.
oId
,
Type
the interface under which is to be mapped.
type
)

Implements com.sun.star.uno.IBridge.mapInterfaceFrom.

Maps an object from destination environment to the source environment.

public Object
mapInterfaceTo(Object object, Type type)

Implements com.sun.star.uno.IBridge.mapInterfaceTo.

Maps an object from the source environment to the destination environment.

private void
public void
release()

Implements com.sun.star.uno.IBridge.release.

Decreases the life count.

public void
removeEventListener(com.sun.star.lang.XEventListener xEventListener)

pack-priv final void
private Object
sendInternalRequest(String oid, Type type, String operation, Object[] arguments)

public void
sendReply(boolean exception, ThreadId threadId, Object result)

Implements com.sun.star.lib.uno.environments.remote.IReceiver.sendReply.

Send back a reply for a request.

public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_iProtocolback to summary
protected IProtocol _iProtocol
_iThreadPoolback to summary
protected IThreadPool _iThreadPool
_java_environmentback to summary
protected IEnvironment _java_environment

References Deprecated

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

See corresponding docs for further information.

_life_countback to summary
protected final AtomicInteger _life_count
_listenersback to summary
private final ArrayList<com.sun.star.lang.XEventListener> _listeners
_messageDispatcherback to summary
protected java_remote_bridge.MessageDispatcher _messageDispatcher
_nameback to summary
protected String _name
_xConnectionback to summary
protected com.sun.star.connection.XConnection _xConnection
_xInstanceProviderback to summary
protected com.sun.star.bridge.XInstanceProvider _xInstanceProvider
DEBUGback to summary
private static final boolean DEBUG

When set to true, enables various debugging output.

disposedback to summary
private boolean disposed
disposeListenersback to summary
private final ArrayList<DisposeListener> disposeListeners
protocolback to summary
private final String protocol
proxyFactoryback to summary
private final ProxyFactory proxyFactory
refHoldersback to summary
private final HashMap<String, LinkedList<java_remote_bridge.RefHolder>> refHolders

Constructor Detail

java_remote_bridgeback to summary
public java_remote_bridge(IEnvironment java_environment, IEnvironment remote_environment, Object[] args) throws Exception

References Deprecated

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

See corresponding docs for further information.

java_remote_bridgeback to summary
public java_remote_bridge(Object[] args) throws Exception

Deprecated

as of UDK 1.0

Constructs a new bridge.

This method is not part of the provided api and should only be used by the UNO runtime.

Parameters
args:Object[]

the custom parameters: arg[0] == protocol_name, arg[1] == xConnection, arg[2] == xInstanceProvider.

Annotations
@Deprecated

Method Detail

acquireback to summary
public void acquire()

Implements com.sun.star.uno.IBridge.acquire.

Increases the life count.

See Also
com.sun.star.uno.IBridge#acquire
addDisposeListenerback to summary
public void addDisposeListener(DisposeListener listener)

Implements com.sun.star.lib.util.DisposeNotifier.addDisposeListener.

Doc from com.sun.star.lib.util.DisposeNotifier.addDisposeListener.

Adds a dispose listener, to be notified when this object is disposed.

It is unspecified what happens when the same listener is added multiple times.

It is unspecified exactly when the notifyDispose callback is fired: immediately before the notifier is disposed, while it is in the process of disposing, or some time after it got disposed. But even if adding a listener to an already disposed notifier, the listener must eventually receive a notifyDispose callback.

See Also
DisposeNotifier#addDisposeListener
addEventListenerback to summary
public void addEventListener(com.sun.star.lang.XEventListener xEventListener)

Methods XComponent.

addRefHolderback to summary
pack-priv final void addRefHolder(Object obj, Type type, String oid)
checkDisposedback to summary
private synchronized void checkDisposed()

This function must only be called while synchronized on this object.

disposeback to summary
public void dispose()

Implements com.sun.star.uno.IBridge.dispose.

Doc from com.sun.star.uno.IBridge.dispose.

Disposes the bridge.

Sends involved threads an InterruptedException. Releases mapped objects.

disposeback to summary
private void dispose(Throwable throwable)
freeHoldersback to summary
pack-priv final void freeHolders()
getDescriptionback to summary
public String getDescription()

Gives a description of the connection type and protocol used.

Returns:String

connection type and protocol.

See Also
com.sun.star.bridge.XBridge#getDescription
getInstanceback to summary
public Object getInstance(String instanceName)
See Also
com.sun.star.bridge.XBridge#getInstance
getLifeCountback to summary
pack-priv int getLifeCount()

This method is for testing only.

getNameback to summary
public String getName()

Gives the name of this bridge.

Returns:String

the name of this bridge.

See Also
com.sun.star.bridge.XBridge#getName
getProtocolback to summary
pack-priv IProtocol getProtocol()

This method is for testing only.

getSourceEnvironmentback to summary
public IEnvironment getSourceEnvironment()

Implements com.sun.star.uno.IBridge.getSourceEnvironment.

References Deprecated

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

See corresponding docs for further information.

Gives the source environment.

Returns:IEnvironment

the source environment of this bridge.

See Also
com.sun.star.uno.IBridge#getSourceEnvironment
getTargetEnvironmentback to summary
public IEnvironment getTargetEnvironment()

Implements com.sun.star.uno.IBridge.getTargetEnvironment.

References Deprecated

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

See corresponding docs for further information.

Gives the destination environment.

Returns:IEnvironment

the destination environment of this bridge.

See Also
com.sun.star.uno.IBridge#getTargetEnvironment
hasRefHolderback to summary
private boolean hasRefHolder(String oid, Type type)
mapInterfaceFromback to summary
public Object mapInterfaceFrom(Object oId, Type type)

Implements com.sun.star.uno.IBridge.mapInterfaceFrom.

Maps an object from destination environment to the source environment.

Parameters
oId:Object

the object to map.

type:Type

the interface under which is to be mapped.

Returns:Object

the object in the source environment.

See Also
com.sun.star.uno.IBridge#mapInterfaceFrom
mapInterfaceToback to summary
public Object mapInterfaceTo(Object object, Type type)

Implements com.sun.star.uno.IBridge.mapInterfaceTo.

Doc from com.sun.star.uno.IBridge.mapInterfaceTo.

Maps an object from the source environment to the destination environment.

See Also
com.sun.star.uno.IBridge#mapInterfaceTo
notifyListenersback to summary
private void notifyListeners()
releaseback to summary
public void release()

Implements com.sun.star.uno.IBridge.release.

Decreases the life count.

If the life count drops to zero, the bridge disposes itself.

See Also
com.sun.star.uno.IBridge#release
removeEventListenerback to summary
public void removeEventListener(com.sun.star.lang.XEventListener xEventListener)
remRefHolderback to summary
pack-priv final void remRefHolder(Type type, String oid)
sendInternalRequestback to summary
private Object sendInternalRequest(String oid, Type type, String operation, Object[] arguments)
sendReplyback to summary
public void sendReply(boolean exception, ThreadId threadId, Object result)

Implements com.sun.star.lib.uno.environments.remote.IReceiver.sendReply.

Doc from com.sun.star.lib.uno.environments.remote.IReceiver.sendReply.

Send back a reply for a request.

sendRequestback to summary
public Object sendRequest(String oid, Type type, String operation, Object[] params) throws Throwable

Implements com.sun.star.lib.uno.bridges.java_remote.RequestHandler.sendRequest.

com.sun.star.lib.uno.bridges.java_remote back to summary

private final Class java_remote_bridge.MessageDispatcher

extends Thread
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

public synchronized void
Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopthreadIdtoStringyield

Field Detail

terminateback to summary
private boolean terminate

Constructor Detail

MessageDispatcherback to summary
public MessageDispatcher()

Method Detail

runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.

Annotations
@Override
terminateback to summary
public synchronized void terminate()
com.sun.star.lib.uno.bridges.java_remote back to summary

private final Class java_remote_bridge.RefHolder

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.RefHolder

The ref holder stuff strongly holds objects mapped out via this bridge (the java_environment only holds them weakly).

When this bridge is disposed, all remaining ref holder entries are released.

Field Summary

Modifier and TypeField and Description
private int
private final Object
private final Type

Constructor Summary

AccessConstructor and Description
public
RefHolder(Type type, Object object)

Method Summary

Modifier and TypeMethod and Description
public void
public Type
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
private int count
objectback to summary
private final Object object
Annotations
@SuppressWarnings:unused
typeback to summary
private final Type type

Constructor Detail

RefHolderback to summary
public RefHolder(Type type, Object object)

Method Detail

acquireback to summary
public void acquire()
getTypeback to summary
public Type getType()
releaseback to summary
public boolean release()