01: package org.vraptor.component;
02:
03: import java.util.Set;
04:
05: /**
06: * Component managers are capable of finding and dealing with business
07: * components/logics.
08: *
09: * @author Guilherme Silveira
10: */
11: public interface ComponentManager {
12:
13: /**
14: * Registers a new component
15: *
16: * @param type
17: * component class
18: * @throws InvalidComponentException
19: * invalid component
20: */
21: boolean register(String type) throws InvalidComponentException;
22:
23: /**
24: * Returns the business component
25: *
26: * @throws LogicNotFoundException
27: *
28: */
29: ComponentType getComponent(String name, String logic)
30: throws ComponentNotFoundException, LogicNotFoundException;
31:
32: /**
33: * Returns a list with all component classes.
34: *
35: * @return all components registered
36: */
37: Set<ComponentType> getComponents();
38:
39: /**
40: * Directly registers a component type.
41: *
42: * @param type
43: * the component type
44: * @throws LogicNotFoundException
45: */
46: void register(ComponentType type) throws LogicNotFoundException;
47:
48: ComponentType getComponentType(Class<?> type)
49: throws InvalidComponentException;
50:
51: }
|