Class java_remote_bridge
- java.lang.Object
-
- com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge
-
- All Implemented Interfaces:
com.sun.star.bridge.XBridge
,com.sun.star.lang.XComponent
,IReceiver
,DisposeNotifier
,IBridge
,com.sun.star.uno.XInterface
public class java_remote_bridge extends java.lang.Object implements IBridge, IReceiver, com.sun.star.bridge.XBridge, com.sun.star.lang.XComponent, DisposeNotifier
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
-
-
Field Summary
Fields Modifier and Type Field Description protected IProtocol
_iProtocol
protected IThreadPool
_iThreadPool
protected IEnvironment
_java_environment
protected java.util.concurrent.atomic.AtomicInteger
_life_count
protected com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.MessageDispatcher
_messageDispatcher
protected java.lang.String
_name
protected com.sun.star.connection.XConnection
_xConnection
protected com.sun.star.bridge.XInstanceProvider
_xInstanceProvider
-
Constructor Summary
Constructors Constructor Description java_remote_bridge(IEnvironment java_environment, IEnvironment remote_environment, java.lang.Object[] args)
java_remote_bridge(java.lang.Object[] args)
Deprecated.as of UDK 1.0
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquire()
Increases the life count.void
addDisposeListener(DisposeListener listener)
Adds a dispose listener, to be notified when this object is disposed.void
addEventListener(com.sun.star.lang.XEventListener xEventListener)
Methods XComponent.void
dispose()
Disposes the bridge.java.lang.String
getDescription()
Gives a description of the connection type and protocol used.java.lang.Object
getInstance(java.lang.String instanceName)
java.lang.String
getName()
Gives the name of this bridge.IEnvironment
getSourceEnvironment()
Gives the source environment.IEnvironment
getTargetEnvironment()
Gives the destination environment.java.lang.Object
mapInterfaceFrom(java.lang.Object oId, Type type)
Maps an object from destination environment to the source environment.java.lang.Object
mapInterfaceTo(java.lang.Object object, Type type)
Maps an object from the source environment to the destination environment.void
release()
Decreases the life count.void
removeEventListener(com.sun.star.lang.XEventListener xEventListener)
void
sendReply(boolean exception, ThreadId threadId, java.lang.Object result)
Send back a reply for a request.java.lang.Object
sendRequest(java.lang.String oid, Type type, java.lang.String operation, java.lang.Object[] params)
-
-
-
Field Detail
-
_xConnection
protected com.sun.star.connection.XConnection _xConnection
-
_xInstanceProvider
protected com.sun.star.bridge.XInstanceProvider _xInstanceProvider
-
_name
protected java.lang.String _name
-
_iProtocol
protected IProtocol _iProtocol
-
_java_environment
protected IEnvironment _java_environment
-
_messageDispatcher
protected com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.MessageDispatcher _messageDispatcher
-
_life_count
protected final java.util.concurrent.atomic.AtomicInteger _life_count
-
_iThreadPool
protected IThreadPool _iThreadPool
-
-
Constructor Detail
-
java_remote_bridge
public java_remote_bridge(IEnvironment java_environment, IEnvironment remote_environment, java.lang.Object[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
java_remote_bridge
@Deprecated public java_remote_bridge(java.lang.Object[] args) throws java.lang.Exception
Deprecated.as of UDK 1.0Constructs a new bridge.This method is not part of the provided
api
and should only be used by the UNO runtime.- Parameters:
args
- the custom parameters: arg[0] == protocol_name, arg[1] == xConnection, arg[2] == xInstanceProvider.- Throws:
java.lang.Exception
-
-
Method Detail
-
mapInterfaceTo
public java.lang.Object mapInterfaceTo(java.lang.Object object, Type type)
Description copied from interface:IBridge
Maps an object from the source environment to the destination environment.- Specified by:
mapInterfaceTo
in interfaceIBridge
- Parameters:
object
- the object to maptype
- the type of the interface that shall be mapped- Returns:
- the object in the destination environment
- See Also:
IBridge.mapInterfaceTo(java.lang.Object, com.sun.star.uno.Type)
-
mapInterfaceFrom
public java.lang.Object mapInterfaceFrom(java.lang.Object oId, Type type)
Maps an object from destination environment to the source environment.- Specified by:
mapInterfaceFrom
in interfaceIBridge
- Parameters:
oId
- the object to map.type
- the interface under which is to be mapped.- Returns:
- the object in the source environment.
- See Also:
IBridge.mapInterfaceFrom(java.lang.Object, com.sun.star.uno.Type)
-
getSourceEnvironment
public IEnvironment getSourceEnvironment()
Gives the source environment.- Specified by:
getSourceEnvironment
in interfaceIBridge
- Returns:
- the source environment of this bridge.
- See Also:
IBridge.getSourceEnvironment()
-
getTargetEnvironment
public IEnvironment getTargetEnvironment()
Gives the destination environment.- Specified by:
getTargetEnvironment
in interfaceIBridge
- Returns:
- the destination environment of this bridge.
- See Also:
IBridge.getTargetEnvironment()
-
acquire
public void acquire()
Increases the life count.- Specified by:
acquire
in interfaceIBridge
- See Also:
IBridge.acquire()
-
release
public void release()
Decreases the life count.If the life count drops to zero, the bridge disposes itself.
- Specified by:
release
in interfaceIBridge
- See Also:
IBridge.release()
-
dispose
public void dispose()
Description copied from interface:IBridge
Disposes the bridge.Sends involved threads an
InterruptedException
. Releases mapped objects.
-
getInstance
public java.lang.Object getInstance(java.lang.String instanceName)
- Specified by:
getInstance
in interfacecom.sun.star.bridge.XBridge
- See Also:
XBridge.getInstance(java.lang.String)
-
getName
public java.lang.String getName()
Gives the name of this bridge.- Specified by:
getName
in interfacecom.sun.star.bridge.XBridge
- Returns:
- the name of this bridge.
- See Also:
XBridge.getName()
-
getDescription
public java.lang.String getDescription()
Gives a description of the connection type and protocol used.- Specified by:
getDescription
in interfacecom.sun.star.bridge.XBridge
- Returns:
- connection type and protocol.
- See Also:
XBridge.getDescription()
-
sendReply
public void sendReply(boolean exception, ThreadId threadId, java.lang.Object result)
Description copied from interface:IReceiver
Send back a reply for a request.
-
sendRequest
public java.lang.Object sendRequest(java.lang.String oid, Type type, java.lang.String operation, java.lang.Object[] params) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
addEventListener
public void addEventListener(com.sun.star.lang.XEventListener xEventListener)
Methods XComponent.- Specified by:
addEventListener
in interfacecom.sun.star.lang.XComponent
-
removeEventListener
public void removeEventListener(com.sun.star.lang.XEventListener xEventListener)
- Specified by:
removeEventListener
in interfacecom.sun.star.lang.XComponent
-
addDisposeListener
public void addDisposeListener(DisposeListener listener)
Description copied from interface:DisposeNotifier
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 anotifyDispose
callback.- Specified by:
addDisposeListener
in interfaceDisposeNotifier
- Parameters:
listener
- a dispose listener, to be notified when this object is disposed; must not benull
- See Also:
DisposeNotifier.addDisposeListener(com.sun.star.lib.util.DisposeListener)
-
-