KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > sandesha > interop > RMInteropService


1 /*
2 * Copyright 1999-2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 *
16 */

17
18 package org.apache.sandesha.interop;
19
20 import org.apache.axis.components.logger.LogFactory;
21 import org.apache.commons.logging.Log;
22
23 import java.util.HashMap JavaDoc;
24 import java.util.Map JavaDoc;
25
26 /**
27  * This is the service that is used for the interop testing. Two operations, ping and echoString
28  * are defined as per the interop scenarios.
29  *
30  * @author Jaliya Ekanayake
31  */

32 public class RMInteropService {
33     private static Map JavaDoc sequences = new HashMap JavaDoc();
34     private static final Log log = LogFactory.getLog(RMInteropService.class.getName());
35
36     public String JavaDoc echoString(String JavaDoc text, String JavaDoc sequence) {
37
38         if (sequences.get(sequence) != null) {
39             text = (String JavaDoc) sequences.get(sequence) + text;
40             sequences.put(sequence, new String JavaDoc(text));
41         } else {
42             sequences.put(sequence, (new String JavaDoc(text)));
43
44         }
45         log.debug("Echo Service " + text);
46         return text;
47     }
48
49     public void ping(String JavaDoc text) {
50         log.debug("Ping Service " + text);
51     }
52 }
53
Popular Tags