Package com.sun.star.bridge

Examples of com.sun.star.bridge.XBridge


     
      XBridgeFactory xBridgeFactory = (XBridgeFactory) UnoRuntime
          .queryInterface(XBridgeFactory.class, x);
     
      // this is the bridge that you will dispose
      XBridge bridge = xBridgeFactory.createBridge("", "urp", connection,null);
     
      /*XComponent xComponent = (XComponent) UnoRuntime.queryInterface(
          XComponent.class, bridge);*/
      // get the remote instance
      x = bridge.getInstance("StarOffice.ServiceManager");
      // Query the initial object for its main factory interface
      XMultiComponentFactory xMultiComponentFactory = (XMultiComponentFactory) UnoRuntime
          .queryInterface(XMultiComponentFactory.class, x);
      XPropertySet xProperySet = (XPropertySet) UnoRuntime
          .queryInterface(XPropertySet.class, xMultiComponentFactory);
View Full Code Here


    // do not create a new bridge, if one already exists
        if (hasName) {
            IBridge iBridges[] = UnoRuntime.getBridges();
            for(int i = 0; i < iBridges.length; ++ i) {
                XBridge xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridges[i]);

                if(xBridge != null) {
                    if(xBridge.getName().equals(sName))
                        throw new BridgeExistsException(sName + " already exists");
                }
            }
        }

    XBridge xBridge = null;

    try {
      IBridge iBridge = UnoRuntime.getBridgeByName("java", context, "remote", context, hasName ? new Object[]{sProtocol, aConnection, anInstanceProvider, sName} : new Object[]{sProtocol, aConnection, anInstanceProvider});

      xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridge);
View Full Code Here

   * @return   the bridge
   * @param    sName                the name of the bridge
   * @see                           com.sun.star.bridge.XBridgeFactory
   */
    public XBridge getBridge(String sName) throws com.sun.star.uno.RuntimeException {
    XBridge xBridge = null;

    IBridge iBridges[] = UnoRuntime.getBridges();
    for(int i = 0; i < iBridges.length; ++ i) {
      xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridges[i]);

      if(xBridge != null) {
        if(xBridge.getName().equals(sName))
          break;
         
        else
          xBridge = null;
      }
View Full Code Here

    public synchronized XBridge[] getExistingBridges() throws com.sun.star.uno.RuntimeException {
    Vector vector = new Vector();

    IBridge iBridges[] = UnoRuntime.getBridges();
    for(int i = 0; i < iBridges.length; ++ i) {
      XBridge xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridges[i]);

      if(xBridge != null)
        vector.addElement(xBridge);
    }

    XBridge xBridges[]= new XBridge[vector.size()];
    for(int i = 0; i < vector.size(); ++ i)
      xBridges[i] = (XBridge)vector.elementAt(i);

    return xBridges;
  }
View Full Code Here

            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) {
                while (!done) {
                    lock.wait();
View Full Code Here

    // do not create a new bridge, if one already exists
        if (hasName) {
            IBridge iBridges[] = UnoRuntime.getBridges();
            for(int i = 0; i < iBridges.length; ++ i) {
                XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]);

                if(xBridge != null) {
                    if(xBridge.getName().equals(sName))
                        throw new BridgeExistsException(sName + " already exists");
                }
            }
        }

    XBridge xBridge = null;

    try {
      IBridge iBridge = UnoRuntime.getBridgeByName("java", context, "remote", context, hasName ? new Object[]{sProtocol, aConnection, anInstanceProvider, sName} : new Object[]{sProtocol, aConnection, anInstanceProvider});

      xBridge = UnoRuntime.queryInterface(XBridge.class, iBridge);
View Full Code Here

   * @return   the bridge
   * @param    sName                the name of the bridge
   * @see                           com.sun.star.bridge.XBridgeFactory
   */
    public XBridge getBridge(String sName) throws com.sun.star.uno.RuntimeException {
    XBridge xBridge = null;

    IBridge iBridges[] = UnoRuntime.getBridges();
    for(int i = 0; i < iBridges.length; ++ i) {
      xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]);

      if(xBridge != null) {
        if(xBridge.getName().equals(sName))
          break;
         
        else
          xBridge = null;
      }
View Full Code Here

    public synchronized XBridge[] getExistingBridges() throws com.sun.star.uno.RuntimeException {
    Vector vector = new Vector();

    IBridge iBridges[] = UnoRuntime.getBridges();
    for(int i = 0; i < iBridges.length; ++ i) {
      XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]);

      if(xBridge != null)
        vector.addElement(xBridge);
    }

    XBridge xBridges[]= new XBridge[vector.size()];
    for(int i = 0; i < vector.size(); ++ i)
      xBridges[i] = (XBridge)vector.elementAt(i);

    return xBridges;
  }
View Full Code Here

        xBridgeFactory = UnoRuntime.queryInterface(XBridgeFactory.class,
                                      _xMultiServiceFactory.createInstance("com.sun.star.bridge.BridgeFactory"));
      } catch (com.sun.star.uno.Exception e) {
        throw new com.sun.star.uno.RuntimeException(e.getMessage());
      }
      XBridge xBridge = xBridgeFactory.getBridge(conDcp + ";" + protDcp);
     
      if(xBridge == null) {
        Object connector= null;
        try {
          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());
        }
      }
      rootObject = xBridge.getInstance(rootOid);
      return rootObject;
    }
View Full Code Here

        * instance provider
        */
        public void run() {
            try {
                acceptedCall = acc.accept(connectString) ;
                XBridge xBridge = xBrdgFctr.createBridge("MyBridge", "urp",
                                            acceptedCall, xInstProv);
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                ex = e ;
            } catch (com.sun.star.connection.ConnectionSetupException e) {
                ex = e ;
View Full Code Here

TOP

Related Classes of com.sun.star.bridge.XBridge

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.