Package org.tubo.exception

Examples of org.tubo.exception.TuboConsumerException


        // get ports to listen
        String ports = manager.getProperty("ports");
        //
        // check ports null
        if (ports==null || "".equals(ports.trim()))
                throw new TuboConsumerException("port property is empty or not configured");
        //
        // create tokenizer
        StringTokenizer tokenizer = new StringTokenizer(ports,",",false);
        //
        // check number of tokens
        if (tokenizer.countTokens()==0)
            throw new TuboConsumerException("Ports not found");
        //
        // create Workers ejecutor
        executor = Executors.newCachedThreadPool();
        while (tokenizer.hasMoreElements()) {
            //
            // get port
            String sport = tokenizer.nextToken();
            //
            // convert String port to int (FIXME: ver el error)
            int port = 0;
            try {
                port = Integer.parseInt(sport);
            } catch (NumberFormatException e) {
                throw new TuboConsumerException("Malformat port number port="+sport);
            }
            //
            // create worker for server socket accept
            ServerSocketWorker worker = new ServerSocketWorker(manager,port);
            //
View Full Code Here


            String inputLine;
            while (((inputLine = in.readLine()) != null) && !"bye".equals(inputLine.trim())) {
                out.println(inputLine);
            }
        } catch (IOException e) {
            throw new TuboConsumerException("Error processing streams",e);
        } finally {
            if (out!=null)
                try {
                    out.flush();
                    out.close();
View Full Code Here

TOP

Related Classes of org.tubo.exception.TuboConsumerException

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.