Package com.sun.star.connection

Examples of com.sun.star.connection.XAcceptor


    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


  public XConnection_Test(XMultiServiceFactory xMultiServiceFactory) {
    _xMultiServiceFactory = xMultiServiceFactory;
  }

  public boolean test(Vector notpassed, String clientDcp, String serverDcp, boolean withError) throws com.sun.star.uno.Exception {
    XAcceptor xAcceptor = (XAcceptor)UnoRuntime.queryInterface(XAcceptor.class, _xMultiServiceFactory.createInstance("com.sun.star.connection.Acceptor"));
    XConnector xConnector = (XConnector)UnoRuntime.queryInterface(XConnector.class, _xMultiServiceFactory.createInstance("com.sun.star.connection.Connector"));

   
    Worker writer = new Worker(xAcceptor, serverDcp, withError);
    Worker reader = new Worker(xConnector, clientDcp);
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);

    System.err.println("waiting for connect...");

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

        public void run() {
            try {
                XComponentContext context
                    = Bootstrap.createInitialComponentContext(null);
                XAcceptor acceptor = Acceptor.create(context);
                XBridgeFactory factory
                    = (XBridgeFactory) UnoRuntime.queryInterface(
                        XBridgeFactory.class,
                        context.getServiceManager().createInstanceWithContext(
                            "com.sun.star.bridge.BridgeFactory", context));
                System.out.println("Server: Accepting...");
                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

    }

    private static void execServer(XComponentContext context, String url)
        throws Exception
    {
        XAcceptor acceptor = Acceptor.create(context);
        XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface(
            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

    }

    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...");
    XConnection xConnection = xAcceptor.accept(conDcp);

    XBridgeFactory 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

    {
        if (DEBUG) {
            System.err.println("##### " + getClass().getName() + ".accept("
                               + connectionDescription + ")");
        }
        XAcceptor acc;
        synchronized (this) {
            if (acceptor == null) {
                acceptor = (XAcceptor) Implementation.getConnectionService(
                    serviceFactory, connectionDescription, XAcceptor.class,
                    "Acceptor");
                acceptingDescription = connectionDescription;
            } else if (!connectionDescription.equals(acceptingDescription)) {
                throw new AlreadyAcceptingException(acceptingDescription
                                                    + " vs. "
                                                    + connectionDescription);
            }
            acc = acceptor;
        }
        return acc.accept(connectionDescription);
    }
View Full Code Here

        return acc.accept(connectionDescription);
    }

    // see com.sun.star.connection.XAcceptor#stopAccepting
    public void stopAccepting() {
        XAcceptor acc;
        synchronized (this) {
            acc = acceptor;
        }
        acc.stopAccepting();
    }
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

        protected boolean run(XBridge bridge) throws Throwable {
            XTestFrame f = (XTestFrame) UnoRuntime.queryInterface(
                XTestFrame.class, bridge.getInstance("TestFrame"));
            XComponentContext context
                = Bootstrap.createInitialComponentContext(null);
            XAcceptor acceptor = Acceptor.create(context);
            XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface(
                XBridgeFactory.class,
                context.getServiceManager().createInstanceWithContext(
                    "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

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.