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.callbacks;
17:
18: import java.io.Serializable;
19:
20: import edu.iu.uis.eden.messaging.AsynchronousCall;
21: import edu.iu.uis.eden.messaging.AsynchronousCallback;
22:
23: /**
24: * This is a description of what this class does - rkirkend don't forget to fill this in.
25: *
26: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
27: *
28: */
29: public class SimpleCallback implements AsynchronousCallback {
30:
31: private static final long serialVersionUID = -1097606463996858063L;
32:
33: private Serializable returnObject;
34: private AsynchronousCall methodCall;
35:
36: public void callback(Serializable returnObject,
37: AsynchronousCall methodCall) {
38: this .returnObject = returnObject;
39: this .methodCall = methodCall;
40: }
41:
42: public AsynchronousCall getMethodCall() {
43: return this .methodCall;
44: }
45:
46: public void setMethodCall(AsynchronousCall methodCall) {
47: this .methodCall = methodCall;
48: }
49:
50: public Serializable getReturnObject() {
51: return this .returnObject;
52: }
53:
54: public void setReturnObject(Serializable returnObject) {
55: this .returnObject = returnObject;
56: }
57:
58: public synchronized void waitForAsyncCall()
59: throws InterruptedException {
60: waitForAsyncCall(-1);
61: }
62:
63: public synchronized void waitForAsyncCall(long millis)
64: throws InterruptedException {
65: if (millis < 0) {
66: this .wait(30000);
67: } else {
68: this.wait(millis);
69: }
70: }
71:
72: }
|