|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Component
Components are elementary building blocks of an application's structure. An object that represents a structural part (component) of an application may be embedded in a component. A component facilitates setting of properties as well as references to other components.
| Method Summary | |
|---|---|
Set<Class<?>> |
getInjectedInterfaces(String componentId)
|
Class<?>[] |
getInterfaces()
|
Properties |
getProperties()
|
Object |
getProxy(Class<?> interfaceClass)
|
Object |
invoke(String methodName,
Object... parameters)
|
void |
register(Component component)
Registers a component (as listener) in case the embedded object implements a method named 'register' with a suiting interface. |
void |
removeDependency(String componentId)
Removes previously injected proxies for a certain component. |
void |
setInvocationIntercepter(Class<?> interfaceClass,
InvocationHandler interceptor)
Sets intercepter for invocations of a particular interface to deal with cross-cutting concerns. |
void |
setProperties(Properties properties)
Injects properties into the embedded object. |
void |
setReference(Facade facade,
String componentId,
Class<?>... interfaces)
Sets a reference to a component if the embedded class contains an appropriate setter. |
void |
unregister(Component component)
Unregisters a previously registered component in case the embedded object implements a method named 'unregister' with a suitable interface. |
| Method Detail |
|---|
void setProperties(Properties properties)
properties - Properties getProperties()
Class<?>[] getInterfaces()
Object getProxy(Class<?> interfaceClass)
interfaceClass -
void setReference(Facade facade,
String componentId,
Class<?>... interfaces)
facade - facade that must expose a component with id componentId and given interfacescomponentId - ID of the componentinterfaces - the interfaces the component exposesvoid removeDependency(String componentId)
componentId - void register(Component component)
component - void unregister(Component component)
component - Set<Class<?>> getInjectedInterfaces(String componentId)
componentId -
void setInvocationIntercepter(Class<?> interfaceClass,
InvocationHandler interceptor)
interfaceClass - interface of which invocations must be interceptedinterceptor -
Object invoke(String methodName,
Object... parameters)
throws InvocationTargetException,
NoSuchMethodException,
IllegalArgumentException
methodName - name of a method declared by a component's interfaceparameters -
InvocationTargetException - in case the invoked method throws
NoSuchMethodException - in case no suitable method is found
IllegalArgumentException - in case the arguments can not be converted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||