Package com.sun.star.bridge

Examples of com.sun.star.bridge.XBridge


        xBridgeFactory = UnoRuntime.queryInterface(XBridgeFactory.class,
                                      _xMultiServiceFactory.createInstance("com.sun.star.bridge.BridgeFactory"));
      } catch (com.sun.star.uno.Exception e) {
        throw new com.sun.star.uno.RuntimeException(e.getMessage());
      }
      XBridge xBridge = xBridgeFactory.getBridge(conDcp + ";" + protDcp);
     
      if(xBridge == null) {
        Object connector ;
        try {
          connector = _xMultiServiceFactory.createInstance("com.sun.star.connection.Connector");
        } catch (com.sun.star.uno.Exception e) {
            throw new com.sun.star.uno.RuntimeException(e.getMessage());
        }
       
        XConnector connector_xConnector = UnoRuntime.queryInterface(XConnector.class, connector);
       
        // connect to the server
        XConnection xConnection = connector_xConnector.connect(conDcp);
        try {
          xBridge = xBridgeFactory.createBridge(conDcp + ";" + protDcp, protDcp, xConnection, null);
        } catch (com.sun.star.bridge.BridgeExistsException e) {
          throw new com.sun.star.uno.RuntimeException(e.getMessage());
        }
      }
      rootObject = xBridge.getInstance(rootOid);
      return rootObject;
    }
View Full Code Here


    System.err.println("waiting for connect...");
    XConnection xConnection = xAcceptor.accept(conDcp);

    XBridgeFactory xBridgeFactory = UnoRuntime.queryInterface(XBridgeFactory.class, serviceManager.createInstance("com.sun.star.bridge.BridgeFactory"));
    XBridge xBridge = xBridgeFactory.createBridge(conDcp + ";" + protDcp, protDcp, xConnection, new InstanceProvider());

  }
View Full Code Here

        XBridgeFactory xBridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(
                XBridgeFactory.class, x);

        // create a nameless bridge with no instance provider
        // using the middle part of the uno-url
        XBridge bridge = xBridgeFactory.createBridge("", a[1], m_Connection, null);

        // query for the XComponent interface and add this as event listener
        XComponent xComponent = (XComponent) UnoRuntime.queryInterface(
                XComponent.class, bridge);

        // get the remote instance
        x = bridge.getInstance(a[2]);

        // Did the remote server export this object ?
        if (null == x) {
            throw new com.sun.star.uno.Exception(
                    "Server didn't provide an instance for" + a[2], null);
View Full Code Here

                "com.sun.star.bridge.BridgeFactory", context));
        if (factory == null) {
            throw new NullPointerException("no bridge factory");
        }
        UnoUrl url = UnoUrl.parseUnoUrl(arguments[0]);
        XBridge bridge = factory.createBridge(
            "", url.getProtocolAndParametersAsString(),
            Connector.create(context).connect(
                url.getConnectionAndParametersAsString()),
            null);
        Data d = UnoRuntime.queryInterface(
            XServer.class, bridge.getInstance(url.getRootOid())).getData();
        UnoRuntime.queryInterface(XComponent.class, bridge).dispose();
        if (!d.m1.equals("Hello") || d.m2 != 42) {
            throw new RuntimeException("Data object contains bad values");
        }
    }
View Full Code Here

            XBridgeFactory xBridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(
                XBridgeFactory.class , x );

            // create a nameless bridge with no instance provider
            // using the middle part of the uno-url
            XBridge bridge = xBridgeFactory.createBridge( "" , a[1] , connection , null );

            // query for the XComponent interface and add this as event listener
            XComponent xComponent = (XComponent) UnoRuntime.queryInterface(
                XComponent.class, bridge );
            xComponent.addEventListener( this );

            // get the remote instance
            x = bridge.getInstance( a[2] );

            // Did the remote server export this object ?
            if( null == x )
            {
                throw new com.sun.star.uno.Exception(
View Full Code Here

        * instance provider
        */
        public void run() {
            try {
                acceptedCall = acc.accept(connectString) ;
                XBridge xBridge = xBrdgFctr.createBridge("MyBridge", "urp",
                                            acceptedCall, xInstProv);
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                ex = e ;
            } catch (com.sun.star.connection.ConnectionSetupException e) {
                ex = e ;
View Full Code Here

        XBridgeFactory xBridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(
                XBridgeFactory.class, x);

        // create a nameless bridge with no instance provider
        // using the middle part of the uno-url
        XBridge bridge = xBridgeFactory.createBridge("", a[1], m_Connection, null);

        // query for the XComponent interface and add this as event listener
        XComponent xComponent = (XComponent) UnoRuntime.queryInterface(
                XComponent.class, bridge);

        // get the remote instance
        x = bridge.getInstance(a[2]);

        // Did the remote server export this object ?
        if (null == x) {
            throw new com.sun.star.uno.Exception(
                    "Server didn't provide an instance for" + a[2], null);
View Full Code Here

                context.getServiceManager().createInstanceWithContext(
                    "com.sun.star.bridge.BridgeFactory", context));
            System.out.println("Client: Connecting...");
            XConnection connection = connector.connect(connectionDescription);
            System.out.println("Client: ...connected...");
            XBridge bridge = factory.createBridge(
                "", protocolDescription, connection, null);
            System.out.println("Client: ...bridged.");
            return bridge;
        }
View Full Code Here

                }
                for (;;) {
                    XConnection connection = acceptor.accept(
                        connectionDescription);
                    System.out.println("Server: ...connected...");
                    XBridge bridge = factory.createBridge(
                        "", protocolDescription, connection, provider);
                    System.out.println("Server: ...bridged.");
                }
            } catch (Throwable e) {
                e.printStackTrace(System.err);
View Full Code Here

            XInstanceProvider prov = new Provider();
            f.notifyAccepting(new Done(), prov.getInstance(INSTANCE1),
                              prov.getInstance(INSTANCE2));
            XConnection connection = acceptor.accept(CONNECTION_DESCRIPTION);
            System.out.println("Client, 2nd connection: ...connected...");
            XBridge bridge2 = factory.createBridge(
                "", PROTOCOL_DESCRIPTION, connection, prov);
            System.out.println("Client, 2nd connection: ...bridged.");
            synchronized (lock) {
                while (!done) {
                    lock.wait();
View Full Code Here

TOP

Related Classes of com.sun.star.bridge.XBridge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.