Package com.logicaldoc.util.spring
Class Context
java.lang.Object
com.logicaldoc.util.spring.Context
- All Implemented Interfaces:
- EventListener,- org.springframework.beans.factory.Aware,- org.springframework.context.ApplicationContextAware,- org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
@ComponentScan(basePackages="com.logicaldoc",
               useDefaultFilters=false,
               includeFilters=)
@ImportResource("classpath:context.xml")
@Component("context")
public class Context
extends Object
implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
Main context
- Since:
- 3.0
- Author:
- Marco Meschieri - LogicalDOC
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidAdds an Listener to a particular Event given fromvoidclose()Closes this contextbooleancontainsBean(String id) Says if a bean is or not availablestatic Contextget()static <R> Rstatic Object<R> RRetrieves a bean registered in the Spring context using a class name.Retrieves a bean registered in the Spring context.Retrieves the collection of all the bean ids<R> List<R> getBeansOfType(Class<R> requiredType) Retrieves the list of bean of the same typeGets the registry with all the configuration properties for this contextorg.springframework.core.io.ResourcegetResource(String resourceLocation) Returns a Spring-Resourceorg.springframework.core.io.Resource[]getResources(String resourcePattern) booleanvoidonApplicationEvent(org.springframework.context.ApplicationEvent event) Processes a newly incoming event on appropriated events that registered itself on itvoidrefresh()Reloads the Spring application context.static voidRemoves a particular Listener from the listvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListenersupportsAsyncExecution
- 
Method Details- 
get
- 
get
- 
get
- 
isInitializedpublic boolean isInitialized()
- 
getPropertiesGets the registry with all the configuration properties for this context- Returns:
- the instance of ContextProperties in the application context
 
- 
setApplicationContextpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
- setApplicationContextin interface- org.springframework.context.ApplicationContextAware
- Throws:
- org.springframework.beans.BeansException
 
- 
getBeanRetrieves a bean registered in the Spring context.- Parameters:
- id- The bean identifier
- Returns:
- The bean instance
 
- 
containsBeanSays if a bean is or not available- Parameters:
- id- identifier of the bean
- Returns:
- true if the bean is available
 
- 
getBeanIdsRetrieves the collection of all the bean ids- Returns:
- the collection of ids of all the beans available in the application context
 
- 
getBeansOfTypeRetrieves the list of bean of the same type- Parameters:
- requiredType- class to use as filter
- Returns:
- the collection of bean instances
 
- 
getBeanRetrieves a bean registered in the Spring context using a class name. At first the fully qualified class name is checked, then if nothing was found the simple class name is used as bean id.- Parameters:
- requiredType- The bean identifier as class name
- Returns:
- The bean instance
 
- 
refreshpublic void refresh()Reloads the Spring application context.NOTE: use carefully, invoke only during setup when the config.xml is changed 
- 
addListenerAdds an Listener to a particular Event given from- Parameters:
- evt- the listener
- See Also:
 
- 
removeListenerRemoves a particular Listener from the list- Parameters:
- evt- the system event
 
- 
getResources
- 
getResourceReturns a Spring-Resource- Parameters:
- resourceLocation- name of the resource to retrieve
- Returns:
- the resource instance
 
- 
onApplicationEventpublic void onApplicationEvent(org.springframework.context.ApplicationEvent event) Processes a newly incoming event on appropriated events that registered itself on it- Specified by:
- onApplicationEventin interface- org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
- Parameters:
- event- the event to process
 
- 
closepublic void close()Closes this context
 
-