Package com.sun.star.connection

Examples of com.sun.star.connection.XConnection


        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 = (XBridgeFactory) UnoRuntime.queryInterface(
                XBridgeFactory.class,
                context.getServiceManager().createInstanceWithContext(
                    "com.sun.star.bridge.BridgeFactory", context));
View Full Code Here


            throw new ConnectionSetupException("alread connected");
        }
 
  try
  {
    XConnection xConn = new PipeConnection( connectionDescription );
    bConnected = true;
    return xConn;
  }
  catch ( java.io.IOException e ) { throw new NoConnectException(); }
    }
View Full Code Here

                               + connectionDescription + ")");
        }
        if (connected) {
            throw new ConnectionSetupException("already connected");
        }
        XConnection con
            = ((XConnector) Implementation.getConnectionService(
                   serviceFactory, connectionDescription, XConnector.class,
                   "Connector")).connect(connectionDescription);
        connected = true;
        return con;
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

    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

       
        XConnector 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

     */
    public void run(){
        try {
            Thread.sleep(ConnectorImpl.iTimeout.intValue());
            ConnectorImpl.aState = "before connection";
            XConnection oConnection = oConnector.connect(connStr);
            if (oConnection != null) {
                ConnectorImpl.aState = "connected";
                oConnection.write(connStr.getBytes());
                oConnection.write(new byte[]{0});
            } else
                ConnectorImpl.aState = "XConnection is null";
        } catch (ConnectionSetupException e) {
            ConnectorImpl.aState = "ConnectionSetupException";
            throw new RuntimeException(e.toString());
View Full Code Here

                if (i == adr.length - 1) {
                    throw new NoConnectException(e.toString());
                }
            }
        }
        XConnection con;
        try {
            if (desc.getTcpNoDelay() != null) {
                socket.setTcpNoDelay(desc.getTcpNoDelay().booleanValue());
            }
            con = new SocketConnection(connectionDescription, socket);
View Full Code Here

        }
       
        XConnector connector_xConnector = (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

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.