Package com.sun.star.connection

Examples of com.sun.star.connection.ConnectionSetupException


     */
    public synchronized XConnection connect(String connectionDescription)
        throws NoConnectException, ConnectionSetupException
    {
        if (bConnected) {
            throw new ConnectionSetupException("alread connected");
        }
 
  try
  {
    XConnection xConn = new PipeConnection( connectionDescription );
View Full Code Here


        if (DEBUG) {
            System.err.println("##### " + getClass().getName() + ".connect("
                               + connectionDescription + ")");
        }
        if (connected) {
            throw new ConnectionSetupException("already connected");
        }
        XConnection con
            = ((XConnector) Implementation.getConnectionService(
                   serviceFactory, connectionDescription, XConnector.class,
                   "Connector")).connect(connectionDescription);
View Full Code Here

            } catch (IllegalAccessException e) {
            } catch (InstantiationException e) {
            }
        }
        if (service == null) {
            throw new ConnectionSetupException("no " + serviceType + " for "
                                               + type);
        }
        return service;
    }
View Full Code Here

     */
    public synchronized XConnection connect(String connectionDescription)
        throws NoConnectException, ConnectionSetupException
    {
        if (connected) {
            throw new ConnectionSetupException("alread connected");
        }
        ConnectionDescriptor desc;
        try {
            desc = new ConnectionDescriptor(connectionDescription);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            throw new ConnectionSetupException(e.toString());
        }
        if (desc.getHost() == null) {
            throw new ConnectionSetupException("host parameter missing");
        }
        // Try all (IPv4 and IPv6) addresses, in case this client is on a
        // dual-stack host and the server process is an IPv4-only process, also
        // on a dual-stack host (see Stevens, Fenner, Rudoff: "Unix Network
        // Programming, Volume 1: The Sockets Networking API, 3rd Edition",
        // p. 359):
        InetAddress[] adr;
        try {
            adr = InetAddress.getAllByName(desc.getHost());
        } catch (UnknownHostException e) {
            throw new ConnectionSetupException(e.toString());
        }
        Socket socket = null;
        for (int i = 0; i < adr.length; ++i) {
            try {
                socket = new Socket(adr[i], desc.getPort());
View Full Code Here

                try {
                    server = new ServerSocket(desc.getPort(), desc.getBacklog(),
                                              host == null ? null
                                              : InetAddress.getByName(host));
                } catch (IOException e) {
                    throw new ConnectionSetupException(e.toString());
                }
                acceptingDescription = connectionDescription;
                tcpNoDelay = desc.getTcpNoDelay();
            } else if (!connectionDescription.equals(acceptingDescription)) {
                throw new AlreadyAcceptingException(acceptingDescription
                                                    + " vs. "
                                                    + connectionDescription);
            }
            serv = server;
        }
        Socket socket;
        try {
            socket = serv.accept();
            if (DEBUG) {
                System.err.println("##### " + getClass().getName()
                                   + ".accept: accepted " + socket);
            }
            if (tcpNoDelay != null) {
                socket.setTcpNoDelay(tcpNoDelay.booleanValue());
            }
            return new SocketConnection(acceptingDescription, socket);
        }
        catch(IOException e) {
            throw new ConnectionSetupException(e.toString());
        }
    }
View Full Code Here

                respFlag = false ;
                wait(10000); // waiting for basic response for 10 seconds.
            } while (respFlag && !container.hasByName("BASIC_Done")) ;

            if (!container.hasByName("BASIC_Done")) {
                throw new ConnectionSetupException("Connection timed out.");
            }
        } catch (Exception e) {
            System.out.println("Exception: " + e.toString());
            throw new ConnectionSetupException();
        }

        log.println("Java-BASIC connection established!");
    }
View Full Code Here

                respFlag = false ;
                wait(10000); // waiting for basic response for 10 seconds.
            } while (respFlag && !container.hasByName("BASIC_Done")) ;

            if (!container.hasByName("BASIC_Done")) {
                throw new ConnectionSetupException("Connection timed out.");
            }
        } catch (Exception e) {
            System.out.println("Exception: " + e.toString());
            throw new ConnectionSetupException();
        }

        log.println("Java-BASIC connection established!");
    }
View Full Code Here

     */
    public synchronized XConnection connect(String connectionDescription)
        throws NoConnectException, ConnectionSetupException
    {
        if (bConnected) {
            throw new ConnectionSetupException("alread connected");
        }
 
  try
  {
    XConnection xConn = new PipeConnection( connectionDescription );
View Full Code Here

        if (DEBUG) {
            System.err.println("##### " + getClass().getName() + ".connect("
                               + connectionDescription + ")");
        }
        if (connected) {
            throw new ConnectionSetupException("already connected");
        }
        XConnection con
            = ((XConnector) Implementation.getConnectionService(
                   serviceFactory, connectionDescription, XConnector.class,
                   "Connector")).connect(connectionDescription);
View Full Code Here

            } catch (IllegalAccessException e) {
            } catch (InstantiationException e) {
            }
        }
        if (service == null) {
            throw new ConnectionSetupException("no " + serviceType + " for "
                                               + type);
        }
        return service;
    }
View Full Code Here

TOP

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

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.