KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mortbay > j2ee > session > State


1 // ========================================================================
2
// $Id: State.java,v 1.3 2004/05/09 20:30:47 gregwilkins Exp $
3
// Copyright 2002-2004 Mort Bay Consulting Pty. Ltd.
4
// ------------------------------------------------------------------------
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
// http://www.apache.org/licenses/LICENSE-2.0
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
// ========================================================================
15

16 package org.mortbay.j2ee.session;
17
18 //----------------------------------------
19

20 import java.rmi.RemoteException JavaDoc;
21 import java.util.Enumeration JavaDoc;
22 import java.util.Map JavaDoc;
23
24 //----------------------------------------
25

26 // The API around the isolated state encapsulated by an HttpSession -
27
// NOT quite the same as an HttpSession interface...
28

29 // It would be much cheaper to have set/removeAttribute return a
30
// boolean or void - but we HAVE TO HAVE the old binding to use in
31
// ValueUnbound events...
32

33 //----------------------------------------
34

35 /**
36  * Implemented by objects wishing to be used to store the state from
37  * an HttpSession.
38  *
39  * @author <a HREF="mailto:jules@mortbay.com">Jules Gosnell</a>
40  * @version 1.0
41  */

42 public interface
43   State
44 {
45   // invariant field accessors
46
String JavaDoc getId() throws RemoteException JavaDoc;
47   int getActualMaxInactiveInterval() throws RemoteException JavaDoc;
48   long getCreationTime() throws RemoteException JavaDoc;
49
50   // variant field accessors
51
Map JavaDoc getAttributes() throws RemoteException JavaDoc;
52   void setAttributes(Map JavaDoc attributes) throws RemoteException JavaDoc;
53   long getLastAccessedTime() throws RemoteException JavaDoc;
54   void setLastAccessedTime(long time) throws RemoteException JavaDoc;
55   int getMaxInactiveInterval() throws RemoteException JavaDoc;
56   void setMaxInactiveInterval(int interval) throws RemoteException JavaDoc;
57
58   // compound fn-ality
59
Object JavaDoc getAttribute(String JavaDoc name) throws RemoteException JavaDoc;
60   Object JavaDoc setAttribute(String JavaDoc name, Object JavaDoc value, boolean returnValue) throws RemoteException JavaDoc;
61   Object JavaDoc removeAttribute(String JavaDoc name, boolean returnValue) throws RemoteException JavaDoc;
62   Enumeration JavaDoc getAttributeNameEnumeration() throws RemoteException JavaDoc;
63   String JavaDoc[] getAttributeNameStringArray() throws RemoteException JavaDoc;
64   boolean isValid() throws RemoteException JavaDoc;
65 }
66
67
Popular Tags