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

    • _xConnection

      protected com.sun.star.connection.XConnection _xConnection
    • _xInstanceProvider

      protected com.sun.star.bridge.XInstanceProvider _xInstanceProvider
    • _name

      protected 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 AtomicInteger _life_count
    • _iThreadPool

      protected IThreadPool _iThreadPool
  • Constructor Details

    • java_remote_bridge

      public java_remote_bridge(IEnvironment java_environment, IEnvironment remote_environment, Object[] args) throws Exception
      Throws:
      Exception
    • java_remote_bridge

      @Deprecated 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 - the custom parameters: arg[0] == protocol_name, arg[1] == xConnection, arg[2] == xInstanceProvider.
      Throws:
      Exception
  • Method Details

    • mapInterfaceTo

      public Object mapInterfaceTo(Object object, Type type)
      Description copied from interface: IBridge
      Maps an object from the source environment to the destination environment.
      Specified by:
      mapInterfaceTo in interface IBridge
      Parameters:
      object - the object to map
      type - the type of the interface that shall be mapped
      Returns:
      the object in the destination environment
      See Also:
    • mapInterfaceFrom

      public Object mapInterfaceFrom(Object oId, Type type)
      Maps an object from destination environment to the source environment.
      Specified by:
      mapInterfaceFrom in interface IBridge
      Parameters:
      oId - the object to map.
      type - the interface under which is to be mapped.
      Returns:
      the object in the source environment.
      See Also:
    • getSourceEnvironment

      public IEnvironment getSourceEnvironment()
      Gives the source environment.
      Specified by:
      getSourceEnvironment in interface IBridge
      Returns:
      the source environment of this bridge.
      See Also:
    • getTargetEnvironment

      public IEnvironment getTargetEnvironment()
      Gives the destination environment.
      Specified by:
      getTargetEnvironment in interface IBridge
      Returns:
      the destination environment of this bridge.
      See Also:
    • acquire

      public void acquire()
      Increases the life count.
      Specified by:
      acquire in interface IBridge
      See Also:
    • release

      public void release()
      Decreases the life count.

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

      Specified by:
      release in interface IBridge
      See Also:
    • dispose

      public void dispose()
      Description copied from interface: IBridge
      Disposes the bridge.

      Sends involved threads an InterruptedException. Releases mapped objects.

      Specified by:
      dispose in interface IBridge
      Specified by:
      dispose in interface com.sun.star.lang.XComponent
    • getInstance

      public Object getInstance(String instanceName)
      Specified by:
      getInstance in interface com.sun.star.bridge.XBridge
      See Also:
      • XBridge.getInstance(java.lang.String)
    • getName

      public String getName()
      Gives the name of this bridge.
      Specified by:
      getName in interface com.sun.star.bridge.XBridge
      Returns:
      the name of this bridge.
      See Also:
      • XBridge.getName()
    • getDescription

      public String getDescription()
      Gives a description of the connection type and protocol used.
      Specified by:
      getDescription in interface com.sun.star.bridge.XBridge
      Returns:
      connection type and protocol.
      See Also:
      • XBridge.getDescription()
    • sendReply

      public void sendReply(boolean exception, ThreadId threadId, Object result)
      Description copied from interface: IReceiver
      Send back a reply for a request.
      Specified by:
      sendReply in interface IReceiver
      Parameters:
      exception - true if an exception (instead of a normal result) is sent back.
      threadId - the thread ID of the request.
      result - the result of executing the request, or an exception thrown while executing the request.
    • sendRequest

      public Object sendRequest(String oid, Type type, String operation, Object[] params) throws Throwable
      Throws:
      Throwable
    • addEventListener

      public void addEventListener(com.sun.star.lang.XEventListener xEventListener)
      Methods XComponent.
      Specified by:
      addEventListener in interface com.sun.star.lang.XComponent
    • removeEventListener

      public void removeEventListener(com.sun.star.lang.XEventListener xEventListener)
      Specified by:
      removeEventListener in interface com.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 a notifyDispose callback.

      Specified by:
      addDisposeListener in interface DisposeNotifier
      Parameters:
      listener - a dispose listener, to be notified when this object is disposed; must not be null
      See Also: