01: /*
02: * All content copyright (c) 2003-2006 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: * Event fires when trying to share a non-portable object.
10: */
11: public class NonPortableObjectEvent extends AbstractApplicationEvent {
12:
13: private static final long serialVersionUID = 1323477247234324L;
14: private NonPortableReason nonPortableReason;
15:
16: public NonPortableObjectEvent(NonPortableEventContext context,
17: NonPortableReason nonPortableReason) {
18: super (context);
19: this .nonPortableReason = nonPortableReason;
20: }
21:
22: /**
23: * @return Event-specific context
24: */
25: public NonPortableEventContext getNonPortableEventContext() {
26: return (NonPortableEventContext) getApplicationEventContext();
27: }
28:
29: /**
30: * @return Get reason why object is non-portable
31: */
32: public NonPortableReason getNonPortableEventReason() {
33: return nonPortableReason;
34: }
35:
36: public String getMessage() {
37: return getNonPortableEventReason().getMessage();
38: }
39: }
|