Package org.springframework.jms.core

Examples of org.springframework.jms.core.SessionCallback


    cfControl.replay();

    JmsTransactionManager tm = new JmsTransactionManager(cf);
    TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition());
    final JmsTemplate jt = new JmsTemplate(cf);
    jt.execute(new SessionCallback() {
      public Object doInJms(Session sess) {
        assertTrue(sess == session);
        return null;
      }
    });
    TransactionTemplate tt = new TransactionTemplate(tm);
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        jt.execute(new SessionCallback() {
          public Object doInJms(Session sess) {
            assertTrue(sess == session);
            return null;
          }
        });
View Full Code Here


    cfControl.replay();

    JmsTransactionManager tm = new JmsTransactionManager(cf);
    TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition());
    final JmsTemplate jt = new JmsTemplate(cf);
    jt.execute(new SessionCallback() {
      public Object doInJms(Session sess) {
        assertTrue(sess == session);
        return null;
      }
    });
    TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_NOT_SUPPORTED);
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        jt.execute(new SessionCallback() {
          public Object doInJms(Session sess) {
            assertTrue(sess != session);
            return null;
          }
        });
      }
    });
    jt.execute(new SessionCallback() {
      public Object doInJms(Session sess) {
        assertTrue(sess == session);
        return null;
      }
    });
View Full Code Here

    cfControl.replay();

    JmsTransactionManager tm = new JmsTransactionManager(cf);
    TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition());
    final JmsTemplate jt = new JmsTemplate(cf);
    jt.execute(new SessionCallback() {
      public Object doInJms(Session sess) {
        assertTrue(sess == session);
        return null;
      }
    });
    TransactionTemplate tt = new TransactionTemplate(tm);
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        jt.execute(new SessionCallback() {
          public Object doInJms(Session sess) {
            assertTrue(sess != session);
            return null;
          }
        });
      }
    });
    jt.execute(new SessionCallback() {
      public Object doInJms(Session sess) {
        assertTrue(sess == session);
        return null;
      }
    });
View Full Code Here

    cfControl.replay();

    JmsTransactionManager tm = new JmsTransactionManager102(cf, false);
    TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition());
    JmsTemplate jt = new JmsTemplate102(cf, false);
    jt.execute(new SessionCallback() {
      public Object doInJms(Session sess) {
        assertTrue(sess == session);
        return null;
      }
    });
View Full Code Here

    cfControl.replay();

    JmsTransactionManager tm = new JmsTransactionManager102(cf, true);
    TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition());
    JmsTemplate jt = new JmsTemplate102(cf, true);
    jt.execute(new SessionCallback() {
      public Object doInJms(Session sess) {
        assertTrue(sess == session);
        return null;
      }
    });
View Full Code Here

        }

        public void send(final String destinationName,
                         final MessageCreator messageCreator,
                         final MessageSentCallback callback) throws JmsException {
            execute(new SessionCallback() {
                public Object doInJms(Session session) throws JMSException {
                    Destination destination = resolveDestinationName(session, destinationName);
                    return doSendToDestination(destination, messageCreator, callback, session);
                }
            }, false);
View Full Code Here

        }

        public void send(final Destination destination,
                         final MessageCreator messageCreator,
                         final MessageSentCallback callback) throws JmsException {
            execute(new SessionCallback() {
                public Object doInJms(Session session) throws JMSException {
                    return doSendToDestination(destination, messageCreator, callback, session);
                }
            }, false);
        }
View Full Code Here

            }, false);
        }

        public void send(final String destinationName,
                         final MessageCreator messageCreator) throws JmsException {
            execute(new SessionCallback() {
                public Object doInJms(Session session) throws JMSException {
                    Destination destination = resolveDestinationName(session, destinationName);
                    return doSendToDestination(destination, messageCreator, null, session);
                }
            }, false);
View Full Code Here

            }, false);
        }

        public void send(final Destination destination,
                         final MessageCreator messageCreator) throws JmsException {
            execute(new SessionCallback() {
                public Object doInJms(Session session) throws JMSException {
                    return doSendToDestination(destination, messageCreator, null, session);
                }
            }, false);
        }
View Full Code Here

        }

        public void send(final String destinationName,
                         final MessageCreator messageCreator,
                         final MessageSentCallback callback) throws JmsException {
            execute(new SessionCallback() {
                public Object doInJms(Session session) throws JMSException {
                    Destination destination = resolveDestinationName(session, destinationName);
                    return doSendToDestination(destination, messageCreator, callback, session);
                }
            }, false);
View Full Code Here

TOP

Related Classes of org.springframework.jms.core.SessionCallback

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.