01: /*
02: * $Id: EchoImpl.java,v 1.2 2007/03/12 10:46:14 agoubard Exp $
03: */
04: package com.mycompany.allinone.api;
05:
06: /**
07: * Implementation of the <code>Echo</code> function.
08: *
09: * @version $Revision: 1.2 $ $Date: 2007/03/12 10:46:14 $
10: * @author John Doe (<a href="mailto:john.doe@mycompany.com">john.doe@mycompany.com</a>)
11: */
12: public final class EchoImpl extends Echo {
13:
14: /**
15: * Constructs a new <code>EchoImpl</code> instance.
16: *
17: * @param api
18: * the API to which this function belongs, guaranteed to be not
19: * <code>null</code>.
20: */
21: public EchoImpl(APIImpl api) {
22: super (api);
23: }
24:
25: /**
26: * Calls this function. If the function fails, it may throw any kind of
27: * exception. All exceptions will be handled by the caller.
28: *
29: * @param request
30: * the request, never <code>null</code>.
31: *
32: * @return
33: * the result of the function call, should never be <code>null</code>.
34: *
35: * @throws Throwable
36: * if anything went wrong.
37: */
38: public Result call(Request request) throws Throwable {
39: SuccessfulResult result = new SuccessfulResult();
40: if (request.isSetIn()) {
41: result.setOut(request.getIn());
42: }
43: return result;
44: }
45: }
|