01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.object.appevent;
05:
06: import com.tc.util.NonPortableReason;
07:
08: /**
09: * Context when a non-portable object is set as a root
10: */
11: public class NonPortableRootContext extends NonPortableEventContext {
12:
13: private static final long serialVersionUID = -556002400100752261L;
14:
15: public static final String ROOT_NAME_LABEL = "Non-portable root name";
16:
17: private final String rootName;
18:
19: public NonPortableRootContext(String threadName, String clientId,
20: String rootName, Object rootValue) {
21: super (rootValue, threadName, clientId);
22: this .rootName = rootName;
23: }
24:
25: /**
26: * @return Get root field name
27: */
28: public String getFieldName() {
29: return rootName;
30: }
31:
32: /**
33: * @return Get root field value being set
34: */
35: public Object getFieldValue() {
36: return getPojo();
37: }
38:
39: public void addDetailsTo(NonPortableReason reason) {
40: super.addDetailsTo(reason);
41: reason.addDetail(ROOT_NAME_LABEL, rootName);
42: }
43:
44: }
|