Package com.sun.star.connection

Examples of com.sun.star.connection.XConnection


    * Has <b>OK</b> status if value returned is not null
    * and no exceptions were thrown.<p>
    */
    public void _createBridge() {
        XBridge bridge = null;
        XConnection conn = null ;
        boolean result = false ;

        // first creating a connection
        try {
            XInterface x = (XInterface)
View Full Code Here


    * Has <b>OK</b> status if description returned by the method
    * is equal to expected one.
    */
    public void _getDescription() {
        String protocol = (String)args[1]; // args[1] - protocol
        XConnection xConnection = (XConnection)args[2]; // args[2] - connection
        // expected description is protocol + ":" + xConnection.getDescription()
        String expectedDescription =
                protocol + ":" + xConnection.getDescription();

        String description = oObj.getDescription();

        if (!tRes.tested("getDescription()",
                description.equals(expectedDescription))) {
View Full Code Here

        }

        public void run() {
            try {
                // create a connection
                XConnection xCon = xAcc.accept(connectString);
                // create a bridge over that conmnection
                xBridge = xBrdgFctr.createBridge(
                                    "MyBridge", "urp", xCon, xInstProv);
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                e.printStackTrace(log);
View Full Code Here

            XBridgeFactory bridgeFactory
                = UnoRuntime.queryInterface(
                    XBridgeFactory.class,
                    serviceManager.createInstanceWithContext(
                        "com.sun.star.bridge.BridgeFactory", context));
            XConnection connection = Acceptor.create(context).accept(
                CONNECTION_DESCRIPTION);
            bridgeFactory.createBridge(
                "", PROTOCOL_DESCRIPTION, connection,
                new XInstanceProvider() {
                    public Object getInstance(String instanceName) {
View Full Code Here

        while( true )
        {
            System.err.println("waiting for connect...");

            XConnection xConnection = xAcceptor.accept(conDcp);
           
            XBridgeFactory xBridgeFactory = UnoRuntime.queryInterface(
                XBridgeFactory.class,
                smgr.createInstanceWithContext("com.sun.star.bridge.BridgeFactory",ctx));
           
View Full Code Here

        }
       
        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

    }

    public void test() throws Exception {
        String protocol = "urp";

        XConnection connectionA = new PipedConnection(new Object[0]);
        XConnection connectionB = new PipedConnection(
            new Object[] { connectionA });
        java_remote_bridge bridgeA = new java_remote_bridge(
            new java_environment(null), null,
            new Object[] { protocol, connectionA, new TestInstanceProvider() });
        java_remote_bridge bridgeB = new java_remote_bridge(
View Full Code Here

                Thread.sleep(500);
            }
            catch (java.lang.InterruptedException e) {}

            // establish the connection
            XConnection xConnection = xCntr.connect(connectString);

            String protocol = "urp";
            String bridgeName = protocol + ":" + connectString;

/*            bridgeDisposed[0] = false ;
View Full Code Here

 
        Object x = xRemoteContext.getServiceManager().createInstanceWithContext(
          "com.sun.star.connection.Connector", xRemoteContext);
        XConnector xConnector = (XConnector) UnoRuntime.queryInterface(XConnector.class, x);
        logger.debug("XConnector retrieved: " + xConnector);
            XConnection connection = null;
            try {
          connection = xConnector.connect("socket,host=" + host + ",port=" + port);
          if (connection == null) {
            logger.error("Cannot connect to open office using host " + host + " and port " + port);
            throw new OpenOfficeConnectionException("Cannot connect to open office using host " + host
View Full Code Here

      Object x = xRemoteContext.getServiceManager().createInstanceWithContext(
        "com.sun.star.connection.Connector", xRemoteContext);
      XConnector xConnector = (XConnector) UnoRuntime.queryInterface(XConnector.class, x);
      logger.debug("XConnector retrieved: " + xConnector);
      XConnection connection = xConnector.connect("socket,host=" + host + ",port=" + port);
      logger.debug("XConnection retrieved: " + connection);
      x = xRemoteContext.getServiceManager().createInstanceWithContext("com.sun.star.bridge.BridgeFactory",
        xRemoteContext);
      XBridgeFactory xBridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(XBridgeFactory.class, x);
      logger.debug("XBridgeFactory retrieved: " + xBridgeFactory);
View Full Code Here

TOP

Related Classes of com.sun.star.connection.XConnection

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.