KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > session > Session


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
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.apache.axis.session;
18
19 import java.util.Enumeration JavaDoc;
20
21 /**
22  * An abstract interface to provide session storage to Axis services.
23  *
24  * This is extremely basic at the moment.
25  *
26  * @author Glen Daniels (gdaniels@apache.org)
27  */

28 public interface Session
29 {
30     /** Get a property from the session
31      *
32      * @param key the name of the property desired.
33      */

34     public Object JavaDoc get(String JavaDoc key);
35     
36     /** Set a property in the session
37      *
38      * @param key the name of the property to set.
39      * @param value the value of the property.
40      */

41     public void set(String JavaDoc key, Object JavaDoc value);
42     
43     /** Remove a property from the session
44      *
45      * @param key the name of the property desired.
46      */

47     public void remove(String JavaDoc key);
48
49     /**
50      * Get an enumeration of the keys in this session
51      */

52     public Enumeration JavaDoc getKeys();
53
54     /** Set the session's time-to-live.
55      *
56      * This is implementation-specific, but basically should be the #
57      * of seconds of inactivity which will cause the session to time
58      * out and invalidate. "inactivity" is implementation-specific.
59      */

60     public void setTimeout(int timeout);
61     
62     /**
63      * Return the sessions' time-to-live.
64      *
65      * @return the timeout value for this session.
66      */

67     public int getTimeout();
68     
69     /**
70      * "Touch" the session (mark it recently used)
71      */

72     public void touch();
73     
74     /**
75      * invalidate the session
76      */

77     public void invalidate();
78     
79     /**
80      * Get an Object suitable for synchronizing the session. This method
81      * exists because different session implementations might provide
82      * different ways of getting at shared data. For a simple hashtable-
83      * based session, this would just be the hashtable, but for sessions
84      * which use database connections, etc. it might be an object wrapping
85      * a table ID or somesuch.
86      */

87     public Object JavaDoc getLockObject();
88 }
89
Popular Tags