Package org.jpos.q2.cli

Examples of org.jpos.q2.cli.SMCONSOLE


        assertFalse("dirPoll.isPaused()", dirPoll.isPaused());
    }

    @Test
    public void testRetry() throws IOException {
        Q2 q2 = new Q2("build/resources/test/org/jpos/util/dirpoll_retry/deploy");
        q2.start();
        ISOUtil.sleep(5000L);
        createTestFile("build/resources/test/org/jpos/util/dirpoll_retry/request/REQ1", "RETRYME");
        ISOUtil.sleep(5000L);
        q2.stop();
        ISOUtil.sleep(2000L);
        assertTrue("Can't read request", new File("build/resources/test/org/jpos/util/dirpoll_retry/request/REQ1").canRead());
    }
View Full Code Here


    Space sp;
    public static String QUEUE = "TXNMGRTEST";

    public void setUp () throws Exception {
        sp = SpaceFactory.getSpace();
        q2 = new Q2("build/resources/test/org/jpos/transaction");
        q2.start();
    }
View Full Code Here

    Object receivedHandback;

    @Before
    public void setUp() throws Exception {
        sp = SpaceFactory.getSpace();
        q2 = new Q2("build/resources/test/org/jpos/q2/iso");
        expiredCalled = false;
        q2.start();
        Thread.sleep(2000L);
        try {
            mux = (MUX) NameRegistrar.get("mux.mux");
View Full Code Here

        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

        // 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

    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

        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

    @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

    }

    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

    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

TOP

Related Classes of org.jpos.q2.cli.SMCONSOLE

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.