Package org.smpp

Examples of org.smpp.Session$UnbindServerPDUEventListener


                // Get a session from the pool and attempt to send the message.
                boolean submitted = false;
                SubmitSMResp response = null;
                while (!submitted) {
                    Session SMSSession = (Session) sessionPool.borrowObject();
                    try {
                        response = SMSSession.submit(request);
                        submitted = true;
                        sessionPool.returnObject(SMSSession);
                    } catch (Exception e) {
                        LOGGER.warn("message-submit-failure-retrying", e.getMessage());
                        sessionPool.invalidateObject(SMSSession);
View Full Code Here


            }

            // Get a session from the pool and attempt to send the message.
            boolean submitted = false;
            while (!submitted) {
                Session SMSSession = (Session) sessionPool.borrowObject();
                try {
                    response = SMSSession.submitMulti(request);
                    submitted = true;
                    sessionPool.returnObject(SMSSession);
                } catch (Exception e) {
                    LOGGER.warn("message-submit-failure-retrying", e.getMessage());
                    sessionPool.invalidateObject(SMSSession);
View Full Code Here

     * @throws MessageException if there was a problem running the test
     */
    public void testSendEnquireLinkWhenSynchronous() throws MessageException {
        PoolableSessionFactory sessionFactory = new PoolableSessionFactory(
                ADDRESS, PORT, SMSC_USERNAME, SMSC_PASSWORD, SYNC_BINDTYPE);
        Session session = (Session) sessionFactory.makeObject();
        assertTrue(SessionValidator.sendEnquireLink(session));
    }
View Full Code Here

     * @throws MessageException if there was a problem running the test
     */
    public void testSendEnquireLinkWhenAsynchronous() throws MessageException {
        PoolableSessionFactory sessionFactory = new PoolableSessionFactory(
                ADDRESS, PORT, SMSC_USERNAME, SMSC_PASSWORD, ASYNC_BINDTYPE);
        Session session = (Session) sessionFactory.makeObject();
        assertFalse(SessionValidator.sendEnquireLink(session));
    }
View Full Code Here

                        // Go through the pool and check that all the available
                        // borrowable objects are still valid.
                        Iterator i = sessionPool.iterator();
                        while (i.hasNext()) {
                            Session session = (Session)i.next();
                            validateSession(session);
                        }

                        if (LOGGER.isDebugEnabled()) {
                            LOGGER.debug("Finished checking sessions: [took "
View Full Code Here

        testSimulator.start(listener);
        sessionFactory = new PoolableSessionFactory(
                ADDRESS, PORT, USERNAME, PASSWORD, ASYNC_BINDTYPE);
        Object object = sessionFactory.makeObject();
        assertTrue(object instanceof Session);
        Session session = (Session) object;
        assertTrue(session.isOpened());
        assertTrue(session.isBound());
        session.checkState(Session.STATE_TRANSMITTER);
        assertEquals(20*1000, session.getConnection().getReceiveTimeout());
    }
View Full Code Here

    // Javadoc inherited.
    public synchronized void clear() throws Exception,
            UnsupportedOperationException {
        // Close all available sessions and clear the set.
        for (Iterator i = available.iterator(); i.hasNext();) {
            Session s = (Session) i.next();
            s.close();
        }
        available.clear();
    }
View Full Code Here

    // Javadoc inherited.
    public synchronized void close() throws Exception {
        // Close all active sessions and clear the set.
        for (Iterator i = active.iterator(); i.hasNext();) {
            Session s = (Session) i.next();
            s.close();
        }
        active.clear();

        // Close all available sessions and clear the set.
        clear();
View Full Code Here

     *
     * @throws MessageException if there was a problem running the test
     * @throws IOException if there was a problem running the test
     */
    public void testDestroyObject() throws MessageException, IOException {
        Session session = (Session) sessionFactory.makeObject();
        assertTrue(session.isOpened());
        assertTrue(session.isBound());
        sessionFactory.destroyObject(session);
        assertFalse(session.isOpened());
        assertFalse(session.isBound());
    }
View Full Code Here

     *
     * @return Session new active session
     * @throws Exception if there was a problem creating the new session.
     */
    protected Session createNewSession() throws Exception {
        Session session = (Session) objectFactory.makeObject();
        active.add(session);

        if (!validateIfRequired(session)) {
            // If a new session is invalid we have a problem, so throw
            // an exception and log a fatal error.
View Full Code Here

TOP

Related Classes of org.smpp.Session$UnbindServerPDUEventListener

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.