KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > remoting > Callback


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.remoting;
8
9 import java.util.Map JavaDoc;
10
11
12 /**
13  * @author <a HREF="mailto:tom.elrod@jboss.com">Tom Elrod</a>
14  */

15 public class Callback extends InvocationRequest
16 {
17    static final long serialVersionUID = -4778964132014467531L;
18
19    public final static String JavaDoc CALLBACK_HANDLE_OBJECT_KEY = "callback_handle_object";
20    public final static String JavaDoc SERVER_LOCATOR_KEY = "server_locator";
21
22    public Callback ( Object JavaDoc callbackPayload)
23    {
24       super(callbackPayload);
25    }
26
27    public Object JavaDoc getCallbackHandleObject()
28    {
29       Object JavaDoc handleObject = null;
30       Map JavaDoc returnPayload = getReturnPayload();
31       if(returnPayload != null)
32       {
33          handleObject = returnPayload.get(CALLBACK_HANDLE_OBJECT_KEY);
34       }
35       return handleObject;
36    }
37
38    public Object JavaDoc getCallbackObject()
39    {
40       return getParameter();
41    }
42
43    public InvokerLocator getServerLocator()
44    {
45       InvokerLocator locator = null;
46       Map JavaDoc returnPayload = getReturnPayload();
47       if(returnPayload != null)
48       {
49          locator = (InvokerLocator)returnPayload.get(SERVER_LOCATOR_KEY);
50       }
51       return locator;
52    }
53 }
Popular Tags