Package org.jpos.core

Examples of org.jpos.core.ConfigurationException


           }
        } catch (NoSuchMethodException ignored) {
        } catch (NullPointerException ignored) {
        } catch (IllegalAccessException ignored) {
        } catch (InvocationTargetException e) {
            throw new ConfigurationException (
                obj.getClass().getName() + "." + m + "(" + p +")" ,
                    e.getTargetException()
            );
        }
    }
View Full Code Here


            String file  = property.getAttributeValue("file");
            if (file != null)
                try {
                    props.load (new FileInputStream(new File(file)));
                } catch (Exception ex) {
                    throw new ConfigurationException (file, ex);
                }
            else if (name != null && value != null) {
                Object obj = props.get (name);
                if (obj instanceof String[]) {
                    String[] mobj = (String[]) obj;
View Full Code Here

        public void initChannel () throws ConfigurationException {
            Element persist = getPersist ();
            Element e = persist.getChild ("channel");
            if (e == null)
                throw new ConfigurationException ("channel element missing");

            channel = newChannel (e, getFactory());
           
            String socketFactoryString = getSocketFactory();
            if (socketFactoryString != null && channel instanceof FactoryChannel) {
View Full Code Here

        private ISOChannel newChannel (Element e, QFactory f)
            throws ConfigurationException
        {
            String channelName  = e.getAttributeValue ("class");
            if (channelName == null)
                throw new ConfigurationException ("class attribute missing from channel element.");
           
            String packagerName = e.getAttributeValue ("packager");

            ISOChannel channel   = (ISOChannel) f.newInstance (channelName);
            ISOPackager packager;
View Full Code Here

    @Override
    public void initService () throws ConfigurationException {
        queue = cfg.get ("queue", null);
        if (queue == null)
            throw new ConfigurationException ("queue property not specified");
        sp   = SpaceFactory.getSpace (cfg.get ("space"));
        isp  = SpaceFactory.getSpace (cfg.get ("input-space", cfg.get ("space")));
        psp  = SpaceFactory.getSpace (cfg.get ("persistent-space", this.toString()));
        tail = initCounter (TAIL, cfg.getLong ("initial-tail", 1));
        head = Math.max (initCounter (HEAD, tail), tail);
View Full Code Here

        maxActiveSessions  = cfg.getInt  ("max-active-sessions", 0);
        sessions = cfg.getInt ("sessions", 1);
        threshold = cfg.getInt ("threshold", sessions / 2);
        maxSessions = cfg.getInt ("max-sessions", sessions);
        if (maxSessions < sessions)
            throw new ConfigurationException("max-sessions < sessions");
        if (maxActiveSessions > 0) {
            if (maxActiveSessions < sessions)
                throw new ConfigurationException("max-active-sessions < sessions");
            if (maxActiveSessions < maxSessions)
                throw new ConfigurationException("max-active-sessions < max-sessions");
        }
        callSelectorOnAbort = cfg.getBoolean("call-selector-on-abort", true);
    }
View Full Code Here

    {
        groups.put (DEFAULT_GROUP,  initGroup (config));
        for (Element e :(List<Element>)config.getChildren("group")) {
            String name = e.getAttributeValue ("name");
            if (name == null)
                throw new ConfigurationException ("missing group name");
            if (groups.containsKey(name)) {
                throw new ConfigurationException (
                    "Group '" + name + "' already defined"
                );
            }
            groups.put (name, initGroup (e));
        }
View Full Code Here

        this.cfg = cfg;
        try {
            InitialContext ctx = new InitialContext ();
            ctx.rebind (cfg.get ("name"), stub);
        } catch (NamingException e) {
            throw new ConfigurationException (e);
        }
    }
View Full Code Here

    private void newChannel () throws ConfigurationException {
        Element persist = getPersist ();
        Element e = persist.getChild ("channel");
        if (e == null) {
            throw new ConfigurationException ("channel element missing");
        }

        ChannelAdaptor adaptor = new ChannelAdaptor ();
        channel = adaptor.newChannel (e, getFactory ());
    }
View Full Code Here

    private void initServer ()
        throws ConfigurationException
    {
        if (port == 0) {
            throw new ConfigurationException ("Port value not set");
        }
        newChannel();
        if (channel == null) {
            throw new ConfigurationException ("ISO Channel is null");
        }

        if (!(channel instanceof ServerChannel)) {
            throw new ConfigurationException (channelString +
                  "does not implement ServerChannel");
        }

        ThreadPool pool = null;
        pool = new ThreadPool (minSessions ,maxSessions);
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.