KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > containers > TimerLocal


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 package com.sun.ejb.containers;
25
26 import java.io.Serializable JavaDoc;
27 import java.util.Date JavaDoc;
28
29 import javax.ejb.EJBLocalObject JavaDoc;
30
31 /**
32  * Local view of the persistent representation of an EJB timer.
33  *
34  * @author Kenneth Saks
35  */

36 public interface TimerLocal extends EJBLocalObject JavaDoc {
37
38     /**
39      * Accessors for read-only state.
40      */

41
42     /**
43      * When timer was created. Informational only.
44      */

45     Date JavaDoc getCreationTime();
46
47     /**
48      * Time of first timer expiration.
49      */

50     Date JavaDoc getInitialExpiration();
51
52
53     /**
54      * For periodic timers, number of milli-seconds between
55      * timeouts. 0 for single-action timers.
56      */

57     long getIntervalDuration();
58
59     /**
60      * ejb container corresponding to timed object that created timer.
61      */

62     long getContainerId();
63
64     /**
65      * Id of server instance that owns timer.
66      */

67     String JavaDoc getOwnerId();
68
69     /**
70      * Application info associated with timer. Can be null.
71      *
72      */

73     Serializable JavaDoc getInfo();
74
75     /**
76      * Holds primary key for entity timed object. Null otherwise.
77      */

78     Object JavaDoc getTimedObjectPrimaryKey();
79
80     /**
81      * Mutable fields.
82      */

83
84     /**
85      * This is the last time that a timer expiration completed
86      * successfully or null if this field has not been set.
87      */

88     Date JavaDoc getLastExpiration();
89
90     /**
91      * This is the last time that a timer expiration completed
92      * successfully or null to clear this value.
93      */

94     void setLastExpiration(Date JavaDoc lastExpiration);
95
96     /**
97      * Changes timer owner. Typically done during timer migration.
98      */

99     void setOwnerId(String JavaDoc ownerId);
100
101     /**
102      * Operations.
103      */

104
105     /**
106      * True if interval timer. False if single-action timer.
107      */

108     boolean repeats();
109
110     /**
111      * Check if timer is in an active state.
112      */

113     boolean isActive();
114
115     /**
116      * Check if timer is in a cancelled state.
117      */

118     boolean isCancelled();
119     
120     /**
121      * Cancel timer.
122      */

123     void cancel() throws Exception JavaDoc;
124
125 }
126
Popular Tags