Class 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
    • 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _xConnection

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

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

        protected java.lang.String _name
      • _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
    • 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.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:
        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 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:
        IBridge.mapInterfaceTo(java.lang.Object, com.sun.star.uno.Type)
      • 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:
        IBridge.release()
      • 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 java.lang.Object getInstance​(java.lang.String instanceName)
        Specified by:
        getInstance in interface com.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 interface com.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 interface com.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.
        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 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 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:
        DisposeNotifier.addDisposeListener(com.sun.star.lib.util.DisposeListener)