01: package org.vraptor.plugin;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: import org.vraptor.VRaptorException;
07: import org.vraptor.webapp.PluginManager;
08: import org.vraptor.webapp.WebApplication;
09:
10: /**
11: * The default plugin manager.
12: *
13: * @author Guilherme Silveira
14: */
15: public class DefaultPluginManager implements PluginManager {
16:
17: private final List<VRaptorPlugin> plugins = new ArrayList<VRaptorPlugin>();
18:
19: public void register(VRaptorPlugin pluginClass) {
20: plugins.add(pluginClass);
21: }
22:
23: public List<VRaptorPlugin> getPlugins() {
24: return plugins;
25: }
26:
27: public void init(WebApplication application)
28: throws VRaptorException {
29: for (VRaptorPlugin plugin : this.plugins) {
30: plugin.init(application);
31: }
32: }
33:
34: }
|