KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > sandesha > samples > RMSampleService


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.samples;
19
20 import java.util.HashMap JavaDoc;
21 import java.util.Map JavaDoc;
22
23 /**
24  * This is the service that is used for the interop testing. Two operations, ping and echoString
25  * are defined as per the interop scenarios.
26  *
27  * @author Jaliya Ekanayake
28  */

29 public class RMSampleService {
30     private static Map JavaDoc sequences = new HashMap JavaDoc();
31
32     public String JavaDoc echoString(String JavaDoc text, String JavaDoc sequence) {
33
34         if (sequences.get(sequence) != null) {
35             text = (String JavaDoc) sequences.get(sequence) + text;
36             sequences.put(sequence, new String JavaDoc(text));
37         } else {
38             sequences.put(sequence, (new String JavaDoc(text)));
39
40         }
41         return text;
42     }
43
44     public void ping(String JavaDoc text) {
45         //Just accept the message and do some processing
46
}
47 }
48
Popular Tags