T - Component class that you want listen.
EXAMPLES
@Component
class MyContextListener implement ContextListener<MyComponent>
{
public void preCreateComponent(Class<MyComponent>; component)
{
//only is call when MyComponent is pre create
}
public void preInitComponent(Class<MyComponent> component)
{
//only is call when MyComponent is pre init
}
public void postInitComponent(Class<MyComponent> component)
{
//only is call when MyComponent is post init
}
}
If you want to listen to all components use Object
@Component
class MyContextListener implement ContextListener<Object>
{
public void preCreateComponent(Class<Object> component)
{
//is call for each component pre create
}
public void preInitComponent(Class<Object> component)
{
//is call for each component pre init
}
public void postInitComponent(Class<Object> component)
{
//is call for each component post init
}
}
public interface ContextListener<T>
IocContext. This interfaz is mean to be
implemented in order for the container to call his methods upon the events
that take place on the IocContext
The context listener will be any component that implements the interface ContextListener, the framework must search all ContextListener implementations via the standard way of components resolution and call the 3 methods of the interface in the propper place.
| Modifier and Type | Method and Description |
|---|---|
void |
postInitComponent(Class<T> clazz,
T instance)
Will be called after the components dependencies injection.
|
void |
preCreateComponent(Class<T> clazz)
Will be called before a component is created
|
void |
preInitComponent(Class<T> clazz,
T instance)
Will be called after the component has been instantiate and before
injecting the components dependencies
|
void preCreateComponent(Class<T> clazz)
clazz - The component classvoid preInitComponent(Class<T> clazz, T instance)
clazz - The component classinstance - The component instanceCopyright © 2015–2019 Bridje Framework. All rights reserved.