Examples of QFactory


Examples of org.jpos.q2.QFactory

        poolSize = 1;
        pollInterval = 1000;
    }

    protected void initService () throws Exception {
        QFactory factory = getServer().getFactory();
        dirPoll  = createDirPoll();
        dirPoll.setPath (getPath ());
        dirPoll.setThreadPool (new ThreadPool (1, poolSize));
        dirPoll.setPollInterval (pollInterval);
        if (priorities != null)
            dirPoll.setPriorities (priorities);
        dirPoll.setLogger (getLog().getLogger(), getLog().getRealm ());
        Configuration cfg = factory.getConfiguration (getPersist());
        dirPoll.setConfiguration (cfg);
        dirPoll.createDirs ();
        Object dpp = factory.newInstance (getProcessor());
        if (dpp instanceof LogSource) {
            ((LogSource) dpp).setLogger (
                getLog().getLogger(), getLog().getRealm ()
            );
        }
View Full Code Here

Examples of org.jpos.q2.QFactory

        // logger.destroy ();
    }
    private void addListener (Element e)
        throws ConfigurationException
    {
        QFactory factory = getServer().getFactory();
        String clazz  = e.getAttributeValue ("class");
        LogListener listener = (LogListener) factory.newInstance (clazz);
        if (listener instanceof Configurable) {
            try {
                ((Configurable) listener).setConfiguration (
                    factory.getConfiguration (e)
                );
            } catch (ConfigurationException ex) {
                throw new ConfigurationException (ex);
            }
        }
View Full Code Here

Examples of org.jpos.q2.QFactory

    protected void initStatusListeners (Element configthrows ConfigurationException{
        final Iterator iter = config.getChildren ("status-listener").iterator();
        while (iter.hasNext()) {
            final Element e = (Element) iter.next();
            final QFactory factory = getFactory();
            final TransactionStatusListener listener = (TransactionStatusListener) factory.newInstance (e.getAttributeValue ("class"));
            factory.setConfiguration (listener, config);
            addListener(listener);
        }
    }
View Full Code Here

Examples of org.jpos.q2.QFactory

        return group;
    }
    public TransactionParticipant createParticipant (Element e)
        throws ConfigurationException
    {
        QFactory factory = getFactory();
        TransactionParticipant participant = (TransactionParticipant)
            factory.newInstance (e.getAttributeValue ("class")
        );
        factory.setLogger (participant, e);
        QFactory.invoke (participant, "setTransactionManager", this, TransactionManager.class);
        factory.setConfiguration (participant, e);
        return participant;
    }
View Full Code Here

Examples of org.jpos.q2.QFactory

    @Override
    public String getCountersAsString (String isoChannelName) {
        return server.getCountersAsString (isoChannelName);
    }
    private void addServerSocketFactory () throws ConfigurationException {
        QFactory factory = getFactory ();
        Element persist = getPersist ();

        Element serverSocketFactoryElement = persist.getChild ("server-socket-factory");

        if (serverSocketFactoryElement != null) {
            ISOServerSocketFactory serverSocketFactory = (ISOServerSocketFactory) factory.newInstance (serverSocketFactoryElement.getAttributeValue ("class"));
            factory.setLogger        (serverSocketFactory, serverSocketFactoryElement);
            factory.setConfiguration (serverSocketFactory, serverSocketFactoryElement);
            server.setSocketFactory(serverSocketFactory);
        }

    }
View Full Code Here

Examples of org.jpos.q2.QFactory

    }

    private void addListeners ()
        throws ConfigurationException
    {
        QFactory factory = getFactory ();
        Iterator iter = getPersist().getChildren (
            "request-listener"
        ).iterator();
        while (iter.hasNext()) {
            Element l = (Element) iter.next();
            ISORequestListener listener = (ISORequestListener)
                factory.newInstance (l.getAttributeValue ("class"));
            factory.setLogger        (listener, l);
            factory.setConfiguration (listener, l);
            server.addISORequestListener (listener);
        }
    }
View Full Code Here

Examples of org.jpos.q2.QFactory

    private void addISOServerConnectionListeners()
         throws ConfigurationException
    {

        QFactory factory = getFactory ();
        Iterator iter = getPersist().getChildren (
            "connection-listener"
        ).iterator();
        while (iter.hasNext()) {
            Element l = (Element) iter.next();
            ISOServerEventListener listener = (ISOServerEventListener)
                factory.newInstance (l.getAttributeValue ("class"));
            factory.setLogger        (listener, l);
            factory.setConfiguration (listener, l);
            server.addServerEventListener(listener);
        }
    }
View Full Code Here

Examples of org.jpos.q2.QFactory

    public DailyTaskAdaptor () {
        super ();
    }

    protected void initService () throws Exception {
        QFactory factory = getServer().getFactory();
        Element e = getPersist ();
        task = (Runnable) factory.newInstance (e.getChildTextTrim ("class"));
        factory.setLogger (task, e);
    }
View Full Code Here

Examples of org.jpos.q2.QFactory

        factory.setLogger (task, e);
    }
    protected void startService () throws Exception {
        if (task instanceof Configurable) {
            Element e = getPersist ();
            QFactory factory = getServer().getFactory();
            ((Configurable)task).setConfiguration (
                factory.getConfiguration (e)
            );
        }
        (thisThread = new Thread(this)).start();
    }
View Full Code Here

Examples of org.jpos.q2.QFactory

    public SMAdaptor () {
        super ();
    }
    protected void initService () throws Exception {
        Element e = getPersist ();
        QFactory factory = getServer().getFactory();
        sm = (SMAdapter) factory.newInstance (getImpl ());
        factory.setLogger  (sm, e);
        factory.setConfiguration (sm, e);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.