KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > clustering > SessionManager


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.geronimo.clustering;
18
19 /**
20  * Represents a local SessionManager.
21  * <p>
22  * A local SessionManager works collaboratively with remote SessionManagers to manage Session instances. A local
23  * SessionMananger along with its associated remote SessionManagers are a single space where Session instances live.
24  * In this space, each Session is ensured to have a unique sessionId. This contract is enforced during creation of
25  * a Session instance by a local SessionManager. A Session in this space is preemptively migrated from one local
26  * SessionManager to another. The interposition of a ClusteredInvocation between a Client and the Session he wants to
27  * access ensures that at any point in time a Session is uniquely instantiated once cluster wide. Clients can
28  * receive migration callbacks via the registration of SessionListener.
29  *
30  * @version $Rev$ $Date$
31  */

32 public interface SessionManager {
33     
34     /**
35      * Creates a Session having the specified sessionId.
36      *
37      * @param sessionId Unique identifier of the Session instance.
38      * @return Session instance.
39      * @throws SessionAlreadyExistException Thrown when the provided sessiondId already exists in the Session space
40      * of this local SessionManager and its associated remote SessionManagers.
41      */

42     Session createSession(String JavaDoc sessionId) throws SessionAlreadyExistException;
43     
44     /**
45      * Registers a migration listener.
46      */

47     void registerListener(SessionListener listener);
48
49     /**
50      * Unregisters a migration listener.
51      */

52     void unregisterListener(SessionListener listener);
53
54     /**
55      * Gets the Node hosting this local SessionManager.
56      *
57      * @return Hosting Node.
58      */

59     Node getNode();
60
61 }
62
Popular Tags