01: /*
02: * $Id: TestController.java 911 2007-02-20 13:53:49Z hengels $
03: * (c) Copyright 2004 con:cern development team.
04: *
05: * This file is part of con:cern (http://concern.org).
06: *
07: * con:cern is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU Lesser General Public License
09: * as published by the Free Software Foundation; either version 2.1
10: * of the License, or (at your option) any later version.
11: *
12: * Please see COPYING for the complete licence.
13: */
14: package org.concern.controller.test;
15:
16: import org.concern.UnknownSubjectException;
17: import org.concern.controller.*;
18:
19: import javax.transaction.TransactionManager;
20:
21: /**
22: * @author hengels
23: * @version $Revision: 911 $
24: */
25: public class TestController extends Controller {
26: public void executeSynchronousActivity(String userValue,
27: String activityName) throws ActivityExecutionException,
28: UnknownSubjectException {
29: AbstractSynchronousActivity activity = (AbstractSynchronousActivity) activitiesByName
30: .get(activityName);
31: activity.execute(userValue);
32: }
33:
34: public void executeListener(String userValue, String listenerName)
35: throws ActivityExecutionException, UnknownSubjectException {
36: AbstractListener listener = (AbstractListener) listenersByName
37: .get(listenerName);
38: listener.notify(userValue);
39: }
40:
41: public TransactionManager getTransactionManager() {
42: return transactionManager;
43: }
44:
45: public Activity getActivityByName(String name) {
46: return activitiesByName.get(name);
47: }
48:
49: public Event getEventByName(String name) {
50: return eventsByName.get(name);
51: }
52:
53: public Listener getListenerByName(String name) {
54: return listenersByName.get(name);
55: }
56:
57: public Condition getConditionByName(String name) {
58: return conditionsByName.get(name);
59: }
60: }
|