KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > spi > sfsb > store > SFSBBeanState


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * SFSBBeanState.java
26  *
27  * Created on May 12, 2003, 3:21 PM
28  */

29
30 package com.sun.ejb.spi.sfsb.store;
31
32 /**
33  *
34  * @author lwhite
35  */

36 public class SFSBBeanState {
37     
38     /** Creates a new instance of SFSBBeanState */
39     public SFSBBeanState(String JavaDoc clusterId, long containerId,
40         Object JavaDoc sessionId, long lastAccess,
41         boolean isNew, byte[] state,
42         SFSBStoreManager storeManager)
43     {
44     _clusterId = clusterId;
45     _containerId = containerId;
46         _id = sessionId;
47         _lastAccess = lastAccess;
48         _isNew = isNew;
49         _state = state;
50     _storeManager = storeManager;
51     }
52     
53     public String JavaDoc getClusterId() {
54     return _clusterId;
55     }
56
57     public long getContainerId() {
58     return _containerId;
59     }
60
61     /**
62      * @return id (key)
63      */

64     public Object JavaDoc getId() {
65         return _id;
66     }
67     
68     /**
69      * @return last access time
70      */

71     public long getLastAccess() {
72         return _lastAccess;
73     }
74     
75     /**
76      * @return tx checkpoint duration (milliseconds)
77      */

78     public long getTxCheckpointDuration() {
79         return _txCheckpointDuration;
80     }
81     
82     /**
83      * set tx checkpoint duration (milliseconds)
84      * by semantic convention the setter will usually
85      * be incrementing the present value by an additional duration
86      */

87     public void setTxCheckpointDuration(long value) {
88         _txCheckpointDuration = value;
89     }
90     
91     /**
92      * @return isNew - true means not persistent; false means already persistent
93      */

94     public boolean isNew() {
95         return _isNew;
96     }
97     
98     /**
99      * @return state
100      */

101     public byte[] getState() {
102         return _state;
103     }
104     
105     public SFSBStoreManager getSFSBStoreManager() {
106     return _storeManager;
107     }
108
109     private String JavaDoc _clusterId;
110     private long _containerId;
111     private Object JavaDoc _id = null;
112     private long _lastAccess = 0L;
113     private long _txCheckpointDuration = 0L;
114     private boolean _isNew = false;
115     private byte[] _state = null;
116     private SFSBStoreManager _storeManager;
117
118 }
119
Popular Tags