KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > data > events > JahiaEvent


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12

13 // EV 12.01.2001
14
// SH 12.12.2001 Adding JahiaData reference, only for reasons of speed
15
// because in some cases we were recreating it instead of using the already
16
// existing one.
17
//
18

19 package org.jahia.data.events;
20
21 import java.util.Date JavaDoc;
22 import java.util.EventObject JavaDoc;
23
24 import org.jahia.data.JahiaData;
25 import org.jahia.params.ParamBean;
26
27 public class JahiaEvent extends EventObject JavaDoc {
28
29     private ParamBean jParams;
30     private Object JavaDoc theObj;
31     private long eventTime;
32     private JahiaData jData; // this may be null if no JahiaData is
33
// available.
34

35     /***
36      * constructor
37      * composes automatically the time when the event was triggered
38      *
39      * @param source the object that generated this event
40      * @param jParams a ParamBean object (with request and response)
41      * @param jData a JahiaData object, may be null if none is available
42      * @param objectID the object id targeted by this event (i.e. the field id)
43      *
44      */

45     public JahiaEvent (Object JavaDoc source,
46                        ParamBean jParams,
47                        JahiaData jData,
48                        Object JavaDoc theObj) {
49         super(source);
50         this.jParams = jParams;
51         this.eventTime = (new Date JavaDoc()).getTime();
52         this.theObj = theObj;
53         this.jData = jData;
54     } // end JahiaEvent
55

56     /***
57      * constructor
58      * composes automatically the time when the event was triggered
59      *
60      * @param source the object that generated this event
61      * @param jParams a ParamBean object (with request and response)
62      * @param objectID the object id targeted by this event (i.e. the field id)
63      *
64      */

65     public JahiaEvent (Object JavaDoc source,
66                        ParamBean jParams,
67                        Object JavaDoc theObj) {
68         super(source);
69         this.jParams = jParams;
70         this.eventTime = (new Date JavaDoc()).getTime();
71         this.theObj = theObj;
72         this.jData = null;
73     } // end JahiaEvent
74

75     public ParamBean getParams () {
76         return jParams;
77     }
78
79     public Object JavaDoc getObject () {
80         return theObj;
81     }
82
83     public long getEventTime () {
84         return eventTime;
85     }
86
87     public JahiaData getJahiaData () {
88         return jData;
89     }
90
91 } // end JahiaEvent
Popular Tags