001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JEJBResponse.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.rpc;
025:
026: import org.ow2.easybeans.rpc.api.EJBResponse;
027: import org.ow2.easybeans.rpc.api.RPCException;
028:
029: /**
030: * Implementation of the EJBResponse interface.
031: * @author Florent Benoit
032: */
033: public class JEJBResponse implements EJBResponse {
034:
035: /**
036: * Id for serializable class.
037: */
038: private static final long serialVersionUID = 5854172126038516858L;
039:
040: /**
041: * Value of the response.
042: */
043: private Object value;
044:
045: /**
046: * Bean id.
047: */
048: private Long beanId = null;
049:
050: /**
051: * RPC Exception (if any).
052: */
053: private RPCException rpcException;
054:
055: /**
056: * Bean removed ?
057: */
058: private boolean removed = false;
059:
060: /**
061: * Gets the value.
062: * @return value of response.
063: */
064: public Object getValue() {
065: return value;
066: }
067:
068: /**
069: * Sets the value of the response.
070: * @param value response's value.
071: */
072: public void setValue(final Object value) {
073: this .value = value;
074: }
075:
076: /**
077: * @return id of the bean.
078: */
079: public Long getBeanId() {
080: return beanId;
081: }
082:
083: /**
084: * Sets the bean Id.
085: * @param beanId the id of the bean.
086: */
087: public void setBeanId(final Long beanId) {
088: this .beanId = beanId;
089: }
090:
091: /**
092: * @return RPC exception of the invocation (if any).
093: */
094: public RPCException getRPCException() {
095: return rpcException;
096: }
097:
098: /**
099: * Sets the RPC Exception (if any).
100: * @param rpcException the given exception
101: */
102: public void setRPCException(final RPCException rpcException) {
103: this .rpcException = rpcException;
104: }
105:
106: /**
107: * @return true if the bean has been removed
108: */
109: public boolean isRemoved() {
110: return removed;
111: }
112:
113: /**
114: * Sets the removed flag.
115: * @param removed if bean has been removed.
116: */
117: public void setRemoved(final boolean removed) {
118: this.removed = removed;
119: }
120:
121: }
|