Package org.jpos.q2

Examples of org.jpos.q2.QFactory.newInstance()


            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


    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)
                );
View Full Code Here

    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

    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

        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

            "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

            "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

    }

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

        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);
    }

    public void setImpl (String clazz) {
View Full Code Here

        clazz = DEFAULT_IMPL;
    }
    protected void initService () throws Exception {
        Element e = getPersist ();
        QFactory factory = getServer().getFactory();
        ks = (SecureKeyStore) factory.newInstance (getImpl ());
        factory.setLogger  (ks, e);
        factory.setConfiguration (ks, e);
        NameRegistrar.register (getName (), ks);
    }
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.