01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of 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,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.mock.core;
16:
17: import org.araneaframework.Environment;
18: import org.araneaframework.InputData;
19: import org.araneaframework.OutputData;
20: import org.araneaframework.Path;
21: import org.araneaframework.core.BaseApplicationService;
22:
23: /**
24: * @author "Toomas Römer" <toomas@webmedia.ee>
25: *
26: */
27: public class MockEventfulStandardService extends BaseApplicationService {
28: private boolean actionCalled = false;
29: private boolean destroyCalled = false;
30:
31: private transient Path path;
32: private transient InputData input;
33: private transient OutputData output;
34:
35: protected Object getActionId(InputData input) {
36: return input.getScopedData(getScope().toPath()).get(
37: ACTION_HANDLER_ID_KEY);
38: }
39:
40: public void action(Path path, InputData input, OutputData output)
41: throws Exception {
42: actionCalled = true;
43: this .path = path;
44: this .input = input;
45: this .output = output;
46: }
47:
48: public void destroy() {
49: destroyCalled = true;
50: }
51:
52: public Environment getTheEnvironment() {
53: return getEnvironment();
54: }
55:
56: public InputData getInput() {
57: return input;
58: }
59:
60: public OutputData getOutput() {
61: return output;
62: }
63:
64: public Path getPath() {
65: return path;
66: }
67:
68: public boolean getActionCalled() {
69: return actionCalled;
70: }
71:
72: public boolean getDestroyCalled() {
73: return destroyCalled;
74: }
75: }
|