Examples of JMSSession


Examples of com.caucho.jms.connection.JmsSession

    throws JMSException
  {
    WeakReference<JmsSession> sessionRef = _sessionRef;
    _sessionRef = null;
   
    JmsSession session;

    if (sessionRef != null && (session = sessionRef.get()) != null) {
      session.acknowledge();
    }
  }
View Full Code Here

Examples of com.caucho.jms.connection.JmsSession

    throws JMSException
  {
    WeakReference<JmsSession> sessionRef = _sessionRef;
    _sessionRef = null;
   
    JmsSession session;

    if (sessionRef != null && (session = sessionRef.get()) != null) {
      session.acknowledge();
    }
  }
View Full Code Here

Examples of org.jboss.internal.soa.esb.rosetta.pooling.JmsSession

    /* (non-Javadoc)
     * @see org.jboss.soa.esb.actions.routing.AbstractRouter#route(java.lang.Object)
     */
    public void route(Object message) throws ActionProcessingException {
        final JmsSession jmsSession = getJmsSession() ;
        try {
            handleRouting(jmsSession, message) ;
        } catch (final JMSException jmse) {
            try {
                if (jmsSession.getTransacted()) {
                    jmsSession.rollback() ;
                    throw new ActionProcessingException("Unexpected exception routing message", jmse) ;
                } else {
                    // Try to acquire again
                    final JmsSession newJmsSession = getJmsSession() ;
                    try {
                        handleRouting(newJmsSession, message) ;
                    } finally {
                        pool.closeSession(newJmsSession) ;
                    }
View Full Code Here

Examples of org.jboss.internal.soa.esb.rosetta.pooling.JmsSession

        String securityCredential) throws ConfigurationException
  {
        final Properties environment = getEnvironment() ;
    try
    {
            final JmsSession jmsSession = pool.getSession();
            try {
                Context oCtx = NamingContextPool.getNamingContext(environment);
                try {
                    try {
                        jmsDestination = (Destination) oCtx.lookup(destinationName);
                    } catch (NamingException ne) {
                        oCtx = NamingContextPool.replaceNamingContext(oCtx, environment);
                        jmsDestination = (Destination) oCtx.lookup(destinationName);
                    }
                    final MessageProducer jmsProducer = jmsSession.createProducer(jmsDestination);
                    jmsProducer.close() ;
                } finally {
                    NamingContextPool.releaseNamingContext(oCtx) ;
                }
            } finally {
View Full Code Here

Examples of org.jboss.internal.soa.esb.rosetta.pooling.JmsSession

        JmsConnectionPool jmsConnectionPool = null;
       
        jmsConnectionPool = JmsConnectionPoolContainer.getPool(environment,"ConnectionFactory");
        assertEquals(0, jmsConnectionPool.getSessionsInPool());
        //Open 3 concurrent sessions
        JmsSession session1 = jmsConnectionPool.getSession();
        assertEquals(1, jmsConnectionPool.getSessionsInPool());
        JmsSession session2 = jmsConnectionPool.getSession();
        assertEquals(2, jmsConnectionPool.getSessionsInPool());
        JmsSession session3 = jmsConnectionPool.getSession();
        assertEquals(3, jmsConnectionPool.getSessionsInPool());
        //Close them
        jmsConnectionPool.closeSession(session1);
        jmsConnectionPool.closeSession(session2);
        jmsConnectionPool.closeSession(session3);
View Full Code Here

Examples of org.jboss.internal.soa.esb.rosetta.pooling.JmsSession

    public void testPoolAndSessionsWithAcknowledgeMode()  throws Exception
    {
        JmsConnectionPool jmsConnectionPool = JmsConnectionPoolContainer.getPool(environment,"ConnectionFactory");
        assertEquals(0, jmsConnectionPool.getSessionsInPool());
       
        JmsSession autoAckSession1 = jmsConnectionPool.getSession(Session.AUTO_ACKNOWLEDGE);
        assertEquals(Session.AUTO_ACKNOWLEDGE, autoAckSession1.getAcknowledgeMode());
        assertEquals(1, jmsConnectionPool.getSessionsInPool());
        assertEquals(1, jmsConnectionPool.getSessionsInPool(Session.AUTO_ACKNOWLEDGE));
       
        JmsSession autoAckSession2 = jmsConnectionPool.getSession(Session.AUTO_ACKNOWLEDGE);
        assertEquals(Session.AUTO_ACKNOWLEDGE, autoAckSession2.getAcknowledgeMode());
        assertEquals(2, jmsConnectionPool.getSessionsInPool());
        assertEquals(2, jmsConnectionPool.getSessionsInPool(Session.AUTO_ACKNOWLEDGE));
       
        JmsSession clientAckSession1 = jmsConnectionPool.getSession(Session.CLIENT_ACKNOWLEDGE);
        assertEquals(Session.CLIENT_ACKNOWLEDGE, clientAckSession1.getAcknowledgeMode());
        assertEquals(3, jmsConnectionPool.getSessionsInPool());
        assertEquals(1, jmsConnectionPool.getSessionsInPool(Session.CLIENT_ACKNOWLEDGE));
       
        JmsSession clientAckSession2 = jmsConnectionPool.getSession(Session.CLIENT_ACKNOWLEDGE);
        assertEquals(Session.CLIENT_ACKNOWLEDGE, clientAckSession2.getAcknowledgeMode());
        assertEquals(4, jmsConnectionPool.getSessionsInPool());
        assertEquals(2, jmsConnectionPool.getSessionsInPool(Session.CLIENT_ACKNOWLEDGE));
       
        JmsSession dupsOkAcSession1 = jmsConnectionPool.getSession(Session.DUPS_OK_ACKNOWLEDGE);
        assertEquals(Session.DUPS_OK_ACKNOWLEDGE, dupsOkAcSession1.getAcknowledgeMode());
        assertEquals(5, jmsConnectionPool.getSessionsInPool());
        assertEquals(1, jmsConnectionPool.getSessionsInPool(Session.DUPS_OK_ACKNOWLEDGE));
       
        JmsSession dupsOkAcSession2 = jmsConnectionPool.getSession(Session.DUPS_OK_ACKNOWLEDGE);
        assertEquals(Session.DUPS_OK_ACKNOWLEDGE, dupsOkAcSession2.getAcknowledgeMode());
        assertEquals(6, jmsConnectionPool.getSessionsInPool());
        assertEquals(2, jmsConnectionPool.getSessionsInPool(Session.DUPS_OK_ACKNOWLEDGE));
       
        //Close them
        jmsConnectionPool.closeSession(autoAckSession1);
View Full Code Here

Examples of org.jboss.seam.jms.annotations.JmsSession

public class SessionProducer {
    @Produces
    @Dependent
    public Session getSession(Connection c, InjectionPoint ip) throws JMSException {
        JmsSession s = null;
        if (ip != null) {
            // Check for JmsSession annotation
            if (ip.getAnnotated().isAnnotationPresent(JmsSession.class)) {
                s = ip.getAnnotated().getAnnotation(JmsSession.class);
            } else {
                // Check meta-annotations
                for (Annotation a : ip.getAnnotated().getAnnotations()) {
                    if (a.annotationType().isAnnotationPresent(JmsSession.class)) {
                        s = a.annotationType().getAnnotation(JmsSession.class);
                    }
                }
            }
            if (s != null) {
                return c.createSession(s.transacted(), s.acknowledgementMode());
            }
        }

        // Default case where we cannot find an annotation
        return c.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

Examples of org.jboss.test.jmsra.bean.JMSSession

   public void testSendToQueueAndTopic()
      throws Exception
   {
      JMSSessionHome home = (JMSSessionHome) getInitialContext().lookup("JMSSession");
      JMSSession session = home.create();
      session.sendToQueueAndTopic();
   }
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.