KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > rpc > JEJBResponse


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JEJBResponse.java 1133 2006-10-04 14:30:41Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.rpc;
27
28 import org.objectweb.easybeans.rpc.api.EJBResponse;
29 import org.objectweb.easybeans.rpc.api.RPCException;
30
31 /**
32  * Implementation of the EJBResponse interface.
33  * @author Florent Benoit
34  */

35 public class JEJBResponse implements EJBResponse {
36
37     /**
38      * Id for serializable class.
39      */

40     private static final long serialVersionUID = 5854172126038516858L;
41
42     /**
43      * Value of the response.
44      */

45     private Object JavaDoc value;
46
47     /**
48      * Bean id.
49      */

50     private Long JavaDoc beanId = null;
51
52     /**
53      * RPC Exception (if any).
54      */

55     private RPCException rpcException;
56
57     /**
58      * Bean removed ?
59      */

60     private boolean removed = false;
61
62     /**
63      * Gets the value.
64      * @return value of response.
65      */

66     public Object JavaDoc getValue() {
67         return value;
68     }
69
70     /**
71      * Sets the value of the response.
72      * @param value response's value.
73      */

74     public void setValue(final Object JavaDoc value) {
75        this.value = value;
76     }
77
78
79     /**
80      * @return id of the bean.
81      */

82     public Long JavaDoc getBeanId() {
83         return beanId;
84     }
85
86     /**
87      * Sets the bean Id.
88      * @param beanId the id of the bean.
89      */

90     public void setBeanId(final Long JavaDoc beanId) {
91         this.beanId = beanId;
92     }
93
94     /**
95      * @return RPC exception of the invocation (if any).
96      */

97     public RPCException getRPCException() {
98         return rpcException;
99     }
100
101
102     /**
103      * Sets the RPC Exception (if any).
104      * @param rpcException the given exception
105      */

106     public void setRPCException(final RPCException rpcException) {
107         this.rpcException = rpcException;
108     }
109
110     /**
111      * @return true if the bean has been removed
112      */

113     public boolean isRemoved() {
114         return removed;
115     }
116
117     /**
118      * Sets the removed flag.
119      * @param removed if bean has been removed.
120      */

121     public void setRemoved(final boolean removed) {
122         this.removed = removed;
123     }
124
125 }
126
Popular Tags