KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > jms > listener > serversession > ServerSessionFactory


1 /*
2  * Copyright 2002-2005 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
17 package org.springframework.jms.listener.serversession;
18
19 import javax.jms.JMSException JavaDoc;
20 import javax.jms.ServerSession JavaDoc;
21
22 import org.springframework.jms.listener.serversession.ListenerSessionManager;
23
24 /**
25  * SPI interface to be implemented by components that manage
26  * JMS ServerSessions. Usually, but not necessarily, an implementation
27  * of this interface will hold a pool of ServerSessions.
28  *
29  * <p>The passed-in ListenerSessionManager has to be used for creating
30  * and executing JMS Sessions. This session manager is responsible for
31  * registering a MessageListener with all Sessions that it creates.
32  * Consequently, the ServerSessionFactory implementation has to
33  * concentrate on the actual lifecycle (e.g. pooling) of JMS Sessions,
34  * but is not concerned about Session creation or execution.
35  *
36  * @author Juergen Hoeller
37  * @since 2.0
38  * @see org.springframework.jms.listener.serversession.ListenerSessionManager
39  * @see org.springframework.jms.listener.serversession.ServerSessionMessageListenerContainer
40  */

41 public interface ServerSessionFactory {
42
43     /**
44      * Retrieve a JMS ServerSession for the given session manager.
45      * @param sessionManager the session manager to use for
46      * creating and executing new listener sessions
47      * (implicitly indicating the target listener to invoke)
48      * @return the JMS ServerSession
49      * @throws JMSException if retrieval failed
50      */

51     ServerSession JavaDoc getServerSession(ListenerSessionManager sessionManager) throws JMSException JavaDoc;
52
53     /**
54      * Close all ServerSessions for the given session manager.
55      * @param sessionManager the session manager used for
56      * creating and executing new listener sessions
57      * (implicitly indicating the target listener)
58      */

59     void close(ListenerSessionManager sessionManager);
60
61 }
62
Popular Tags