KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > event > RefreshEvent


1 //$Id: RefreshEvent.java,v 1.6 2005/05/27 03:53:58 oneovthafew Exp $
2
package org.hibernate.event;
3
4 import org.hibernate.LockMode;
5
6 /**
7  * Defines an event class for the refreshing of an object.
8  *
9  * @author Steve Ebersole
10  */

11 public class RefreshEvent extends AbstractEvent {
12
13     private Object JavaDoc object;
14     private LockMode lockMode = LockMode.READ;
15
16     public RefreshEvent(Object JavaDoc object, EventSource source) {
17         super(source);
18         if (object == null) {
19             throw new IllegalArgumentException JavaDoc("Attempt to generate refresh event with null object");
20         }
21         this.object = object;
22     }
23
24     public RefreshEvent(Object JavaDoc object, LockMode lockMode, EventSource source) {
25         this(object, source);
26         if (lockMode == null) {
27             throw new IllegalArgumentException JavaDoc("Attempt to generate refresh event with null lock mode");
28         }
29         this.lockMode = lockMode;
30     }
31
32     public Object JavaDoc getObject() {
33         return object;
34     }
35
36     public LockMode getLockMode() {
37         return lockMode;
38     }
39 }
40
Popular Tags