01: /**********************************************************************
02: Copyright (c) 2006 Andy Jefferson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15: Contributors:
16: ...
17: **********************************************************************/package org.jpox.jdo;
18:
19: import javax.jdo.listener.InstanceLifecycleEvent;
20:
21: /**
22: * Extension to InstanceLifecycleEvent where the event can relate to specific
23: * field providing access to the field names that are affected by this event.
24: *
25: * @version $Revision: 1.1 $
26: */
27: public class FieldInstanceLifecycleEvent extends InstanceLifecycleEvent {
28: /** Names of the fields affected. */
29: private String[] fieldNames;
30:
31: /**
32: * Constructor.
33: * @param obj The object on which the event occurs
34: * @param eventType Type of event
35: * @param otherObj The other object
36: * @param fieldNames Names of the fields affected
37: */
38: public FieldInstanceLifecycleEvent(Object obj, int eventType,
39: Object otherObj, String[] fieldNames) {
40: super (obj, eventType, otherObj);
41: this .fieldNames = fieldNames;
42: }
43:
44: /**
45: * Accessor for the field names affected by this event
46: * @return The field names
47: */
48: public String[] getFieldNames() {
49: return fieldNames;
50: }
51: }
|