Package com.sun.star.connection

Examples of com.sun.star.connection.XAcceptor


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

        // create the acceptor
        try {
View Full Code Here


                (XConnector.class, x) ;

            x = (XInterface) ((XMultiServiceFactory)tParam.getMSF()).createInstance
                ("com.sun.star.connection.Acceptor") ;

            XAcceptor xAccptr = (XAcceptor)UnoRuntime.queryInterface(
                                                        XAcceptor.class, x);
            connectString = (String)tEnv.getObjRelation("CNNCTSTR");
            acceptorThread = new AcceptorThread(xAccptr) ;
            acceptorThread.start();
View Full Code Here

            XBridgeFactory xBrdgFctr = (XBridgeFactory)
                        UnoRuntime.queryInterface(XBridgeFactory.class,
                                    tEnv.getObjRelation("BRIDGEFACTORY"));

            // get the acceptor
            XAcceptor xAcc = (XAcceptor)UnoRuntime.queryInterface(
                    XAcceptor.class, tEnv.getObjRelation("ACCEPTOR"));

            // instance provider
            XInstanceProvider xInstProv = new MyInstanceProvider(xMSF);
            // thread for providing a bridge
View Full Code Here

        XSet set = UnoRuntime.queryInterface(XSet.class, smgr);
        Object o = com.sun.star.comp.bridge.TestComponent.__getServiceFactory(
            "com.sun.star.comp.bridge.TestComponent$_TestObject", oldsmgr,null );
        set.insert(o);
       
    XAcceptor xAcceptor = Acceptor.create(ctx);

        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

        } catch (com.sun.star.uno.Exception e) {
            throw new WrappedTargetRuntimeException(e.toString(), this, e);
        } catch (Exception e) {
            throw new com.sun.star.uno.RuntimeException(e.toString(), this);
        }
        final XAcceptor acceptor = Acceptor.create(context);
        final XBridgeFactory factory;
        try {
            factory = UnoRuntime.queryInterface(
                XBridgeFactory.class,
                context.getServiceManager().createInstanceWithContext(
                    "com.sun.star.bridge.BridgeFactory", context));
        } catch (com.sun.star.uno.Exception e) {
            throw new WrappedTargetRuntimeException(e.toString(), this, e);
        }
        new Thread() {
            public void run() {
                try {
                    // Use "127.0.0.1" instead of "localhost", see #i32281#:
                    factory.createBridge(
                        "", "urp",
                        acceptor.accept("socket,host=127.0.0.1,port=3831"),
                        new XInstanceProvider() {
                            public Object getInstance(String instanceName) {
                                return Relay.this;
                            }
                        });
View Full Code Here

    UnoAppHolder holder = new UnoAppHolder();
    holder.acquire();
    try {
      // get an acceptor
      XAcceptor xAcceptor = (XAcceptor)UnoRuntime.queryInterface(XAcceptor.class,
                                     xMultiServiceFactory.createInstance("com.sun.star.connection.Acceptor"));
         
      // get a bridgefactory
      XBridgeFactory xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(XBridgeFactory.class,
                                            xMultiServiceFactory.createInstance("com.sun.star.bridge.BridgeFactory"));
         
      int connect_count = 0;

      do {
        XConnection xConnection = null;
        try {
          System.err.println("waiting for connect [" + conDcp + "#" + connect_count + "]...");
          xConnection = xAcceptor.accept(conDcp);
          if(xConnection == null)
            break;

          XConnectionBroadcaster broadcaster = (XConnectionBroadcaster)
            UnoRuntime.queryInterface(
View Full Code Here

        XSet set = (XSet) UnoRuntime.queryInterface(XSet.class, smgr);
        Object o = com.sun.star.comp.bridge.TestComponent.__getServiceFactory(
            "com.sun.star.comp.bridge.TestComponent$_TestObject", oldsmgr,null );
        set.insert(o);
       
    XAcceptor xAcceptor = Acceptor.create(ctx);

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

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

    }

    ServiceManager serviceManager = new ServiceManager();
    serviceManager.addFactories(neededServices);

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

    System.err.println("waiting for connect...");
    while( true )
    {
      XConnection xConnection = xAcceptor.accept(conDcp);
      System.out.println( xConnection.getDescription() );
      XBridgeFactory xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(XBridgeFactory.class, serviceManager.createInstance("com.sun.star.bridge.BridgeFactory"));
      XBridge xBridge = xBridgeFactory.createBridge(conDcp + ";" + protDcp, protDcp, xConnection, new InstanceProvider(serviceManager, rootOid));
    }
  }
View Full Code Here

           
            manager = (ServiceManager) xSet;                       
                       
            manager.addFactories( SERVICES );
       
          XAcceptor xAcceptor = (XAcceptor) UnoRuntime.queryInterface(XAcceptor.class,
                            manager.createInstance("com.sun.star.connection.Acceptor"));
                           
      String conStr = "socket,host=";
      conStr += host;
      conStr += ",port=";
      conStr += port;
   
      XConnection xConnection = xAcceptor.accept("socket,host=localhost,port=6002");
     
      MyInstanceProvider instanceProvider = new MyInstanceProvider( manager );
     
      IBridge iBridge = UnoRuntime.getBridgeByName(
                   "java", null, "remote", null,
View Full Code Here

       
        if (rmMultiFac != null) {
          System.err.println("got remote ServiceManager.");
         
          Object accObj = rmMultiFac.createInstance("com.sun.star.connection.Acceptor");
          XAcceptor xAcceptor = (XAcceptor) UnoRuntime.queryInterface(XAcceptor.class, accObj);
          if (xAcceptor != null)
            System.err.println("got acceptor from remote");
          else
            System.err.println("get acceptor from remote failed");
        }
View Full Code Here

TOP

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

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.