Examples of XConnector


Examples of com.sun.star.connection.XConnector

    ////////////////////////

    com.sun.star.comp.servicemanager.ServiceManager smgr = new com.sun.star.comp.servicemanager.ServiceManager();
    smgr.addFactories(neededServices);

    XConnector  xConnector  = (XConnector)smgr.createInstance("com.sun.star.connection.Connector");
    if(xConnector == null) System.err.println("no connector!");

    XConnection xConn    = xConnector.connect("socket,host=localhost,port=6001");
    if(xConn == null) System.err.println("no XConnection!");

    IBridge iBridge = UnoRuntime.getBridgeByName("java", null, "remote", null, new Object[]{"iiop", xConn, null});

    Object rInitialObject = iBridge.mapInterfaceFrom("classic_uno", XInterface.class);
View Full Code Here

Examples of com.sun.star.connection.XConnector

    public synchronized void connect() throws ConnectException {
        logger.debug("connecting");
        try {
            XComponentContext localContext = Bootstrap.createInitialComponentContext(null);
            XMultiComponentFactory localServiceManager = localContext.getServiceManager();
            XConnector connector = (XConnector) UnoRuntime.queryInterface(XConnector.class,
                    localServiceManager.createInstanceWithContext("com.sun.star.connection.Connector", localContext));
            XConnection connection = connector.connect(connectionString);
            XBridgeFactory bridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(XBridgeFactory.class,
                    localServiceManager.createInstanceWithContext("com.sun.star.bridge.BridgeFactory", localContext));
            bridge = bridgeFactory.createBridge("", "urp", connection, null);
            bridgeComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, bridge);
            bridgeComponent.addEventListener(this);
View Full Code Here

Examples of com.sun.star.connection.XConnector

      Object x = xRemoteContext
          .getServiceManager()
          .createInstanceWithContext(
              "com.sun.star.connection.Connector", xRemoteContext);

      XConnector xConnector = (XConnector) UnoRuntime.queryInterface(
          XConnector.class, x);
     
      XConnection connection = xConnector.connect(cnx);

      //if (connection == null)
        //System.out.println("Connection is null");
      x = xRemoteContext.getServiceManager().createInstanceWithContext(
          "com.sun.star.bridge.BridgeFactory", xRemoteContext);
View Full Code Here

Examples of com.sun.star.connection.XConnector

          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());
        }
View Full Code Here

Examples of com.sun.star.connection.XConnector

          System.out.println( "couldn't create connector\n" );
          return;
        }

       
        XConnector xConnector =
          UnoRuntime.queryInterface( XConnector.class , x );
       
        XConnection xConnection = xConnector.connect(args[0]);
     
        if( null != xConnection )
        {
          System.out.println( "after connect" );
          String rootOid = "OfficeDaemon.Factory";
View Full Code Here

Examples of com.sun.star.connection.XConnector

        }

        protected final XBridge getBridge(XComponentContext context)
            throws com.sun.star.uno.Exception
        {
            XConnector connector = Connector.create(context);
            XBridgeFactory factory = UnoRuntime.queryInterface(
                XBridgeFactory.class,
                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

Examples of com.sun.star.connection.XConnector

                    connector = xLocalServiceManager.createInstanceWithContext(
                            "com.sun.star.connection.Connector", xLocalContext);
                } catch (com.sun.star.uno.Exception e) {
                    throw new com.sun.star.uno.RuntimeException(e.getMessage());
                }              
                XConnector connector_xConnector = (XConnector)UnoRuntime.queryInterface(XConnector.class, connector);
                // connect to the server
                XConnection xConnection = connector_xConnector.connect(conDcp);
                // create the bridge name. This should not be necessary if we pass an
                //empty string as bridge name into createBridge. Then we should always get
                //a new bridge. This does not work because of (i51323). Therefore we
                //create unique bridge names for the current process.
                String sBridgeName = "OOoBean_private_bridge_" + String.valueOf(m_nBridgeCounter++);
View Full Code Here

Examples of com.sun.star.connection.XConnector

//      try {
      com.sun.star.comp.servicemanager.ServiceManager smgr = new com.sun.star.comp.servicemanager.ServiceManager();
      smgr.addFactories(neededServices, null);

        XConnector  xConnector  = (XConnector)smgr.createInstance("com.sun.star.connection.Connector");
        XConnection xConnection = xConnector.connect(argv[0]);
     
      String rootOid = "classic_uno";
        IBridge iBridge = UnoRuntime.getBridgeByName("java", null, "remote", null, new Object[]{"iiop", xConnection, null});

      Object rInitialObject = iBridge.mapInterfaceFrom(rootOid, XInterface.class);
View Full Code Here

Examples of com.sun.star.connection.XConnector

                    connector = xLocalServiceManager.createInstanceWithContext(
                            "com.sun.star.connection.Connector", xLocalContext);
                } catch (com.sun.star.uno.Exception e) {
                    throw new com.sun.star.uno.RuntimeException(e.getMessage());
                }              
                XConnector connector_xConnector = (XConnector)UnoRuntime.queryInterface(XConnector.class, connector);
                // connect to the server
                XConnection xConnection = connector_xConnector.connect(conDcp);
                // create the bridge name. This should not be necessary if we pass an
                //empty string as bridge name into createBridge. Then we should always get
                //a new bridge. This does not work because of (i51323). Therefore we
                //create unique bridge names for the current process.
                String sBridgeName = "OOoBean_private_bridge_" + String.valueOf(m_nBridgeCounter++);
View Full Code Here

Examples of com.sun.star.connection.XConnector

        }

        protected final XBridge getBridge(XComponentContext context)
            throws com.sun.star.uno.Exception
        {
            XConnector connector = Connector.create(context);
            XBridgeFactory factory = UnoRuntime.queryInterface(
                XBridgeFactory.class,
                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
TOP
Copyright © 2018 www.massapi.com. 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.