KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > wssample > servlets > ws > JaxRpcEndpoint


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@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: JaxRpcEndpoint.java,v 1.2 2004/05/13 13:38:11 sauthieg Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.wssample.servlets.ws;
26
27 import org.objectweb.jonas.common.Log;
28
29 import org.objectweb.util.monolog.api.BasicLevel;
30 import org.objectweb.util.monolog.api.Logger;
31
32 /**
33  * Service implementation of JaxRpcEndpointInterface. This class is a JaxRpc
34  * endpoint. It is declared in the web.xml. And it will run inside the web
35  * container.
36  *
37  * Notice that a default class constructor is REQUIRED.
38  * Notice that JaxRpcEndpoint does not implements JaxRpcEndpointInterface
39  * This is not a requirement.
40  *
41  * This JAXRPC service endpoint class may implements <code>javax.xml.rpc.server.ServiceLifecycle</code>
42  * interface.
43  *
44  * @see org.objectweb.wssample.servlets.ws.JaxRpcEndpointInterface
45  *
46  * @author Guillaume Sauthier
47  */

48 public class JaxRpcEndpoint {
49
50     /**
51      * return value of getCotes()
52      */

53     private static final int GET_COTES_VALUE = 12;
54
55     /**
56      * logger
57      */

58     private static Logger logger = Log.getLogger(Log.JONAS_WS_PREFIX);
59
60     /**
61      * default constructor needed for JaxRpc Service Endpoint.
62      */

63     public JaxRpcEndpoint() {
64     }
65
66     /**
67      * @param name String to append to "Hello "
68      * @return Returns "Hello " + name
69      */

70     public String JavaDoc sayHello(String JavaDoc name) {
71         logger.log(BasicLevel.INFO, "sayHello(" + name + ") invoked.");
72         return "Hello " + name;
73     }
74
75     /**
76      * @return Returns an arbitrary integer
77      */

78     public int getCotes() {
79         logger.log(BasicLevel.INFO, "getCotes() invoked.");
80         return GET_COTES_VALUE;
81     }
82
83 }
Popular Tags