KickJava   Java API By Example, From Geeks To Geeks.

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


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

11 public class ReplicateEvent extends AbstractEvent {
12
13     private Object JavaDoc object;
14     private ReplicationMode replicationMode;
15     private String JavaDoc entityName;
16
17     public ReplicateEvent(Object JavaDoc object, ReplicationMode replicationMode, EventSource source) {
18         this(null, object, replicationMode, source);
19     }
20     
21     public ReplicateEvent(String JavaDoc entityName, Object JavaDoc object, ReplicationMode replicationMode, EventSource source) {
22         super(source);
23         this.entityName = entityName;
24
25         if ( object == null ) {
26             throw new IllegalArgumentException JavaDoc(
27                     "attempt to create replication strategy with null entity"
28             );
29         }
30         if ( replicationMode == null ) {
31             throw new IllegalArgumentException JavaDoc(
32                     "attempt to create replication strategy with null replication mode"
33             );
34         }
35
36         this.object = object;
37         this.replicationMode = replicationMode;
38     }
39
40     public Object JavaDoc getObject() {
41         return object;
42     }
43
44     public void setObject(Object JavaDoc object) {
45         this.object = object;
46     }
47
48     public ReplicationMode getReplicationMode() {
49         return replicationMode;
50     }
51
52     public void setReplicationMode(ReplicationMode replicationMode) {
53         this.replicationMode = replicationMode;
54     }
55
56     public String JavaDoc getEntityName() {
57         return entityName;
58     }
59     public void setEntityName(String JavaDoc entityName) {
60         this.entityName = entityName;
61     }
62 }
63
Popular Tags