Package com.sun.star.connection

Examples of com.sun.star.connection.XConnection


    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


       
        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

            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

                synchronized (this) {
                    state = ACCEPTING;
                    notifyAll();
                }
                for (;;) {
                    XConnection connection = acceptor.accept(
                        connectionDescription);
                    System.out.println("Server: ...connected...");
                    XBridge bridge = factory.createBridge(
                        "", protocolDescription, connection, provider);
                    System.out.println("Server: ...bridged.");
View Full Code Here

            XBridgeFactory.class,
            context.getServiceManager().createInstanceWithContext(
                "com.sun.star.bridge.BridgeFactory", context));
        UnoUrl unoUrl = UnoUrl.parseUnoUrl(url);
        System.out.println("Server: Accepting...");
        XConnection connection = acceptor.accept(
            unoUrl.getConnectionAndParametersAsString());
        System.out.println("Server: ...connected...");
        factory.createBridge(
            "", unoUrl.getProtocolAndParametersAsString(), connection,
            new Provider());
View Full Code Here

                    "com.sun.star.bridge.BridgeFactory", context));
            System.out.println("Client, 2nd connection: Accepting...");
            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) {
View Full Code Here

    serviceManager.addFactories(neededServices);

    XAcceptor xAcceptor = UnoRuntime.queryInterface(XAcceptor.class, serviceManager.createInstance("com.sun.star.connection.Acceptor"));

    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

        public static void main(String[] args) {
            new Client().execute();
        }

        protected boolean run(XComponentContext context) throws Throwable {
            XConnection connection =
                Connector.create(context).connect(getConnectionDescription());
            XBridgeFactory factory = UnoRuntime.queryInterface(
                XBridgeFactory.class,
                context.getServiceManager().createInstanceWithContext(
                    "com.sun.star.bridge.BridgeFactory", context));
View Full Code Here

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

            XConnection con = xConnector.connect(connectString) ;

            if (con == null)
                log.println("Connector returned : null") ;
            else
                log.println("Connector returned : " + con.getDescription()) ;

            try {
                acception.join(5 * 1000) ;
            } catch(InterruptedException e) {}

View Full Code Here

    */
    public void _connect() {
        boolean result = true ;
        AcceptorThread acceptorThread = null;
        XAcceptor xAcceptor = null ;       
        XConnection aCon = null;
        XInterface x = null;

        // create the acceptor
        try {
            x = (XInterface) (
                (XMultiServiceFactory)tParam.getMSF()).createInstance
                ("com.sun.star.connection.Acceptor") ;
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create service", e) ;
        }

        xAcceptor = (XAcceptor)UnoRuntime.queryInterface(XAcceptor.class, x);

        acceptorThread = new AcceptorThread(xAcceptor) ;
        acceptorThread.start() ;

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

        // connect to acceptor
        try {
            aCon = oObj.connect(connectString);

            if (aCon == null)
                log.println("Connector returned: null") ;
            else
                log.println("Connector returned: " + aCon.getDescription()) ;

            try {
                acceptorThread.join(30 * 1000) ;
            } catch(InterruptedException e) {}

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.