01: /*
02: * Copyright 2007 The Kuali Foundation
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package edu.iu.uis.eden.messaging;
17:
18: import java.io.Serializable;
19:
20: import org.kuali.bus.services.KSBServiceLocator;
21:
22: /**
23: * Holds message payload content. Needed to proxy the content so we don't have to
24: * take the hit when grabbing large amounts of persisted messages at time.
25: *
26: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
27: *
28: */
29: public class PersistedMassagePayload implements Serializable {
30:
31: private static final long serialVersionUID = 508778527504899029L;
32:
33: private Long routeQueueId;
34: private String payload;
35: private AsynchronousCall methodCall;
36: private PersistedMessage message;
37:
38: public PersistedMassagePayload() {
39: }
40:
41: public PersistedMassagePayload(AsynchronousCall methodCall,
42: PersistedMessage message) {
43: this .setPayload(KSBServiceLocator.getMessageHelper()
44: .serializeObject(methodCall));
45: this .methodCall = methodCall;
46: this .message = message;
47: }
48:
49: public String getPayload() {
50: return this .payload;
51: }
52:
53: public void setPayload(String payload) {
54: this .payload = payload;
55: }
56:
57: public Long getRouteQueueId() {
58: return this .routeQueueId;
59: }
60:
61: public void setRouteQueueId(Long routeQueueId) {
62: this .routeQueueId = routeQueueId;
63: }
64:
65: public AsynchronousCall getMethodCall() {
66: if (this .methodCall != null) {
67: return this .methodCall;
68: }
69: this .methodCall = (AsynchronousCall) KSBServiceLocator
70: .getMessageHelper().deserializeObject(getPayload());
71: return this .methodCall;
72: }
73:
74: public PersistedMessage getMessage() {
75: return this .message;
76: }
77:
78: public void setMessage(PersistedMessage message) {
79: this .message = message;
80: }
81:
82: public void setMethodCall(AsynchronousCall methodCall) {
83: this.methodCall = methodCall;
84: }
85:
86: }
|