01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package com.google.gwt.user.server.rpc;
17:
18: import com.google.gwt.user.client.rpc.ObjectGraphTestService;
19: import com.google.gwt.user.client.rpc.TestSetValidator;
20: import com.google.gwt.user.client.rpc.TestSetFactory.SerializableDoublyLinkedNode;
21:
22: /**
23: * TODO: document me.
24: */
25: public class ObjectGraphTestServiceImpl extends RemoteServiceServlet
26: implements ObjectGraphTestService {
27:
28: public SerializableDoublyLinkedNode echo_AcyclicGraph(
29: SerializableDoublyLinkedNode root) {
30: if (!TestSetValidator.isValidAcyclicGraph(root)) {
31: throw new RuntimeException();
32: }
33:
34: return root;
35: }
36:
37: public SerializableDoublyLinkedNode echo_ComplexCyclicGraph(
38: SerializableDoublyLinkedNode root) {
39: if (!TestSetValidator.isValidComplexCyclicGraph(root)) {
40: throw new RuntimeException();
41: }
42:
43: return root;
44: }
45:
46: public SerializableDoublyLinkedNode echo_TrivialCyclicGraph(
47: SerializableDoublyLinkedNode root) {
48: if (!TestSetValidator.isValidTrivialCyclicGraph(root)) {
49: throw new RuntimeException();
50: }
51:
52: return root;
53: }
54:
55: public SerializableDoublyLinkedNode echo_ComplexCyclicGraph(
56: SerializableDoublyLinkedNode node1,
57: SerializableDoublyLinkedNode node2) {
58: if (node1 != node2) {
59: throw new RuntimeException();
60: }
61:
62: return node1;
63: }
64: }
|