1 package org.weda.action.impl;
2
3 import java.util.List;
4 import org.weda.action.ActionContainer;
5 import org.weda.action.ActionExecutionContext;
6 import org.weda.action.ActionRegistry;
7 import org.weda.action.ActionRegistryException;
8 import org.weda.action.ActionState;
9 import org.weda.action.ExecutedActionInfo;
10 import org.weda.enhance.InjectHivemindObject;
11
12 /**
13 *
14 * @author Mikhail Titov
15 */
16 public abstract class AbstractActionContainer implements ActionContainer{
17 @InjectHivemindObject()
18 private static ActionRegistry actionRegistry;
19 private String actionContainerName;
20
21 public ExecutedActionInfo executeAction(ActionExecutionContext context)
22 throws ActionRegistryException
23 {
24 context.setTargetObject(this);
25 return actionRegistry.executeAction(context);
26 }
27
28 public List<ActionState> getActionsStates()
29 throws ActionRegistryException
30 {
31 return actionRegistry.getActionsStates(this, this.getClass());
32 }
33
34 public ActionRegistry getActionRegistry() {
35 return actionRegistry;
36 }
37
38 public void setActionRegistry(ActionRegistry actionRegistry) {
39
40 }
41
42 public boolean hasRegisteredActions() {
43 return actionRegistry.hasRegisteredActions(this.getClass(), this);
44 }
45
46 public String getActionContainerName() {
47 return actionContainerName;
48 }
49
50 public void setActionContainerName(String actionContainerName) {
51 this.actionContainerName = actionContainerName;
52 }
53
54 }