The Component interface provides a standard way to dynamically create and initialize an object. Component-based objects also have access to a Session, which allow each component to access all components registered to it's Session. Parameters for a component are defined as static strings Note: A
| 16 | * @see Session |
| 17 | */ |
| 18 | public interface Component { |
| 19 | /** |
| 20 | * Returns a name for the component. These names are not guaranteed to be unique, and are |
| 21 | * intended for display and logging. Generally this is the class name of the |
| 22 | * Component object, without package information. |
| 23 | * |
| 24 | * @return name of the component |
| 25 | */ |
| 26 | String getName(); |
| 27 | |
| 28 | /** |
| 29 | * Returns the parameters used to initialize this Component, and can also be used |
| 30 | * to modify parameters. |
| 31 | * |
| 32 | * @return map of parameter name to parameter value |
| 33 | */ |
| 34 | Map<String, String> getParameters(); |
| 35 | |
| 36 | /** |
| 37 | * Returns the Session used to initialize this Component. The |
| 38 | * returned session is also used to locate other components if needed. |
| 39 | * |
| 40 | * @return this component's session |
| 41 | */ |
| 42 | Session getSession(); |
| 43 | |
| 44 | /** |
| 45 | * Component lifecycle hook. After creating a Component object, this method should be called to set any |
| 46 | * parameters used by the component. Component implementations typically have |
| 47 | * required parameter checking and code to start timers and threads within this method. |
| 48 | * |
| 49 | * @param session the component uses this object to access other components |
| 50 | * @param parameters configuration values for the component |
| 51 | * @throws OpenAS2Exception If an error occurs while initializing the component |
| 52 | * @see Session |
| 53 | */ |
| 54 | void init(Session session, Map<String, String> parameters) throws OpenAS2Exception; |
| 55 | |
| 56 | /** |
| 57 | * Component lifecycle hook. If lifecycle of {@link Component} requires a destroy function this method can be used. |
| 58 | * |
| 59 | * @throws Exception Something went wrong |
| 60 | * @see #init(Session, Map) |
| 61 | * @see Session |
| 62 | */ |
| 63 | void destroy() throws Exception; |
| 64 | } |
no outgoing calls
no test coverage detected