Package org.jpos.core

Examples of org.jpos.core.ConfigurationException


        throws ConfigurationException
    {
        key = cfg.get ("key");
        String fieldList = cfg.get ("fields");
        if (fieldList == null)
            throw new ConfigurationException ("'fields' property not present");

        StringTokenizer st = new StringTokenizer (fieldList);
        int f[] = new int[st.countTokens()];

        for (int i=0; i<f.length; i++)
View Full Code Here


                new StreamSource(cfg.get("xsltfile"))
            );
            String s = cfg.get ("reread");
            reread   =  (s == null || s.equals ("no"));
        } catch (Exception e) {
            throw new ConfigurationException (e);
        }
    }
View Full Code Here

            pool    = new ThreadPool (1, cfg.getInt ("poolsize", 10));
        muxName     = cfg.get ("destination-mux", null);
        channelName = cfg.get ("destination-channel", null);
        preserveSourceHeader = cfg.getBoolean ("preserve-source-header", true);
        if (muxName == null && channelName == null) {
            throw new ConfigurationException("Neither destination mux nor channel were specified.");
        }
    }
View Full Code Here

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

        driver = cfg.get("jdbc.driver");
        url    = cfg.get("jdbc.url");
        username = cfg.get("jdbc.user");
        password = cfg.get("jdbc.password");
        int initialConnections = cfg.getInt("initial-connections");
        maxConnections = cfg.getInt("max-connections");
        waitIfBusy = cfg.getBoolean("wait-if-busy");

        if (initialConnections > maxConnections) {
            initialConnections = maxConnections;
        }
        availableConnections = new Vector(initialConnections);
        busyConnections = new Vector();
        for(int i=0; i<initialConnections; i++) {
            try {
                availableConnections.addElement(makeNewConnection());
            } catch(SQLException e) {
                throw new ConfigurationException(e);
            }
        }
    }
View Full Code Here

    public void setConfiguration (Configuration cfg) throws ConfigurationException {
        this.cfg = cfg;
        try {
            init(cfg.get("provider"), cfg.get("lmk"), cfg.getBoolean("rebuildlmk"));
        } catch (SMException e) {
            throw  new ConfigurationException(e);
        }
    }
View Full Code Here

        maxSize   = maxSize <= 0 ? DEFAULT_MAXSIZE : maxSize;

        try {
            openLogFile();
        } catch (IOException e) {
            throw new ConfigurationException (e);
        }
        Timer timer = DefaultTimer.getTimer();
        if (sleepTime != 0)
            timer.schedule (rotate = new Rotate(), sleepTime, sleepTime);
    }
View Full Code Here

            try {
                ((Configurable) listener).setConfiguration (
                    factory.getConfiguration (e)
                );
            } catch (ConfigurationException ex) {
                throw new ConfigurationException (ex);
            }
        }
       
        logger.addListener (listener);
    }
View Full Code Here

        logName = prefix + suffix;
        maxSize = cfg.getLong("maxsize",DEF_MAXSIZE);
        try {
            openLogFile();
        } catch (IOException e) {
            throw new ConfigurationException ("error opening file: " + logName,
                    e);
        }
        sleepTime = cfg.getInt("window", DEF_WIN);
        if (sleepTime <= 0)
            sleepTime = DEF_WIN;
        sleepTime*=1000;
        DateFormat fmt = new SimpleDateFormat(cfg.get("date-format",DEF_DATE_FMT));
       
        setDateFmt(fmt);
        setLastDate(fmt.format(new Date()));
        Date time;
        try {
            time = new SimpleDateFormat("HH:mm:ss").parse(cfg.get("first-rotate-time", "00:00:00"));
        } catch (ParseException ex) {
            throw new ConfigurationException("Bad 'first-rotate-time' format " +
                    "expected HH(0-23):mm:ss ",ex);
        }
        String strDate = cfg.get("first-rotate-date",null);
        //calculate the first execution time
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.MILLISECOND,0);
        Calendar calTemp = Calendar.getInstance();
        calTemp.setTime(time);
        cal.set(Calendar.SECOND,calTemp.get(Calendar.SECOND));
        cal.set(Calendar.MINUTE,calTemp.get(Calendar.MINUTE));
        cal.set(Calendar.HOUR_OF_DAY,calTemp.get(Calendar.HOUR_OF_DAY));
       
        if (strDate != null) {
            Date date;
            try {
                date = new SimpleDateFormat("yyyy-MM-dd").parse(strDate);
            } catch (ParseException ex) {
                throw new ConfigurationException("Bad 'first-rotate-date' " +
                        "format, expected (yyyy-MM-dd)", ex);
            }
            calTemp.setTime(date);
            cal.set(calTemp.get(Calendar.YEAR), calTemp.get(Calendar.MONTH),
                    calTemp.get(Calendar.DATE));
View Full Code Here

                initInterpreter(),
                e.getText(),
                e.getAttributeValue ("source")
            );
        } catch (Throwable t) {
            throw new ConfigurationException (t);
        }
    }
View Full Code Here

            String log_priority = cfg.get("priority");
            if ( (log_priority != null) && (!log_priority.trim().equals("")) && levels.containsKey(log_priority) ) {
                priority = log_priority;
            }
        } catch (Exception e) {
            throw new ConfigurationException (e);
        }
    }
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.