SessionCallback.java
Upload User: jiancairen
Upload Date: 2007-08-27
Package Size: 26458k
Code Size: 1k
Category:

Java Develop

Development Platform:

Java

  1. /*
  2.  * Copyright 2002-2004 the original author or authors.
  3.  *
  4.  * Licensed under the Apache License, Version 2.0 (the "License");
  5.  * you may not use this file except in compliance with the License.
  6.  * You may obtain a copy of the License at
  7.  *
  8.  *      http://www.apache.org/licenses/LICENSE-2.0
  9.  *
  10.  * Unless required by applicable law or agreed to in writing, software
  11.  * distributed under the License is distributed on an "AS IS" BASIS,
  12.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.  * See the License for the specific language governing permissions and
  14.  * limitations under the License.
  15.  */
  16. package org.springframework.jms.core;
  17. import javax.jms.JMSException;
  18. import javax.jms.Session;
  19. /**
  20.  * Callback interface for JMS code. To be used with JmsTemplate's execute
  21.  * method, often as an anonymous class within a method implementation.
  22.  *
  23.  * <p>The typical implementatino will perform multiple operations
  24.  * on the JMS Session, possibly returning a result object.
  25.  *
  26.  * @author Mark Pollack
  27.  * @since 1.1
  28.  * @see JmsTemplate#execute(SessionCallback)
  29.  */
  30. public interface SessionCallback {
  31. /**
  32.  * Execute operations against a JMS session possibly returning a result.
  33.  * @param session the JMS session
  34.  * @return a result object from working with the session, if any
  35.  * @throws javax.jms.JMSException if thrown by JMS API methods
  36.  */
  37. Object doInJms(Session session) throws JMSException;
  38. }