Package org.jpos.core

Examples of org.jpos.core.ConfigurationException


        String channelName[] = cfg.getAll ("channel");
        for (String aChannelName : channelName) {
            try {
                addChannel(aChannelName);
            } catch (NameRegistrar.NotFoundException e) {
                throw new ConfigurationException(e);
            }
        }
    }
View Full Code Here


        String h    = cfg.get    ("host");
        int port    = cfg.getInt ("port");
        maxPacketLength = cfg.getInt ("max-packet-length", 100000);
        if (h != null && h.length() > 0) {
            if (port == 0)
                throw new ConfigurationException
                    ("invalid port for host '"+h+"'");
            setHost (h, port);
            setLocalAddress (cfg.get("local-iface", null),cfg.getInt("local-port"));
            String[] altHosts = cfg.getAll  ("alternate-host");
            int[] altPorts = cfg.getInts ("alternate-port");
            hosts = new String[altHosts.length + 1];
            ports = new int[altPorts.length + 1];
            if (hosts.length != ports.length) {
                throw new ConfigurationException (
                    "alternate host/port misconfiguration"
                );
            }
            hosts[0] = host;
            ports[0] = port;
            System.arraycopy (altHosts, 0, hosts, 1, altHosts.length);
            System.arraycopy (altPorts, 0, ports, 1, altPorts.length);
        }
        setOverrideHeader(cfg.getBoolean ("override-header", false));
        keepAlive = cfg.getBoolean ("keep-alive", false);
        expectKeepAlive = cfg.getBoolean ("expect-keep-alive", false);
        if (socketFactory != this && socketFactory instanceof Configurable)
            ((Configurable)socketFactory).setConfiguration (cfg);
        try {
            setTimeout (cfg.getInt ("timeout", DEFAULT_TIMEOUT));
            connectTimeout = cfg.getInt ("connect-timeout", timeout);
        } catch (SocketException e) {
            throw new ConfigurationException (e);
        }
    }
View Full Code Here

            );
            ready  = channel.toString() + ".ready";
            new Thread (new Sender ()).start ();
            new Thread (new Receiver ()).start ();
        } catch (NameRegistrar.NotFoundException e) {
            throw new ConfigurationException (e);
        }
    }
View Full Code Here

    }
    private String get (String prop) throws ConfigurationException
    {
        String value = cfg.get (prop);
        if (value == null)
            throw new ConfigurationException ("null property "+prop);
        return value;
    }
View Full Code Here

    {
        this.cfg = cfg;
        try {
            mux = (SpaceMUX) NameRegistrar.get (cfg.get ("mux"));
        } catch (NotFoundException e) {
            throw new ConfigurationException (e);
        }
        timeout = cfg.getLong ("timeout", 120000);
        pool    = new ThreadPool (1, cfg.getInt ("pool", 100));
    }
View Full Code Here

    }
    private void initJDBC() throws ConfigurationException {
        try {
            Class.forName(cfg.get("jdbc.driver")).newInstance();
        } catch (Exception e) {
            throw new ConfigurationException (e);
        }
    }
View Full Code Here

    }
    private String get (String prop) throws ConfigurationException
    {
        String value = cfg.get (prop);
        if (value == null)
            throw new ConfigurationException ("null property "+prop);
        return value;
    }
View Full Code Here

                        firstTime = time;
                    } else {
                        firstTime = new Date(time.getTime() + 1000 * 60 * 60 * 24);
                    }
                } catch (ParseException ex) {
                    throw new ConfigurationException("The format in which to specify the first execution time is HH:mm:ss");
                }
                initTimeInfo = "firstTime = " + dateTimeFormat.format(firstTime);
            }
        }
       
View Full Code Here

    public void setConfiguration (Configuration cfg) throws ConfigurationException {
        try {
            init(cfg.get("key-file"));
            header = cfg.get("file-header", header);
        } catch (Exception e) {
            throw  new ConfigurationException(e);
        }
    }
View Full Code Here

    {
        Element persist = getPersist();
        channelElement = persist.getChild("channel");
        if (channelElement == null)
        {
            throw new ConfigurationException("channel element missing");
        }
        sp = grabSpace(persist.getChild("space"));
        in = persist.getChildTextTrim("in");
        out = persist.getChildTextTrim("out");
        ready = getName() + ".ready";
View Full Code Here

TOP

Related Classes of org.jpos.core.ConfigurationException

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.