KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > eviction > EvictedEventNode


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.cache.eviction;
8
9 import org.jboss.cache.Fqn;
10
11 /**
12  * Value object used in evicted event node queue.
13  *
14  * @author Ben Wang 2-2004
15  * @author Daniel Huang (dhuang@jboss.org)
16  * @see org.jboss.cache.Region
17  */

18 public class EvictedEventNode
19 {
20    private Fqn fqn_;
21    private NodeEventType type_;
22    private int elementDifference_;
23    private boolean resetElementCount_;
24
25    private long inUseTimeout;
26
27    public EvictedEventNode(Fqn fqn, NodeEventType type, int elementDifference)
28    {
29       this(fqn, type);
30       setElementDifference(elementDifference);
31    }
32
33    public EvictedEventNode(Fqn fqn, NodeEventType event)
34    {
35       setFqn(fqn);
36       setEventType(event);
37    }
38
39    public long getInUseTimeout()
40    {
41       return inUseTimeout;
42    }
43
44    public void setInUseTimeout(long inUseTimeout)
45    {
46       this.inUseTimeout = inUseTimeout;
47    }
48
49    public boolean isResetElementCount()
50    {
51       return this.resetElementCount_;
52    }
53
54    public void setResetElementCount(boolean resetElementCount)
55    {
56       this.resetElementCount_ = resetElementCount;
57    }
58
59    public int getElementDifference()
60    {
61       return elementDifference_;
62    }
63
64    public void setElementDifference(int elementDifference_)
65    {
66       this.elementDifference_ = elementDifference_;
67    }
68
69    public Fqn getFqn()
70    {
71       return fqn_;
72    }
73
74    public void setFqn(Fqn fqn)
75    {
76       this.fqn_ = fqn;
77    }
78
79    public void setEventType(NodeEventType event)
80    {
81       type_ = event;
82    }
83
84    public NodeEventType getEventType()
85    {
86       return type_;
87    }
88
89    public String JavaDoc toString()
90    {
91       return "EvictedEN[fqn=" + fqn_ + " event=" + type_ + " diff=" + elementDifference_ + "]";
92    }
93 }
94
Popular Tags