org.restlet.ext.spring
Class SpringContext

java.lang.Object
  extended by org.springframework.core.io.DefaultResourceLoader
      extended by org.springframework.context.support.AbstractApplicationContext
          extended by org.springframework.context.support.GenericApplicationContext
              extended by org.restlet.ext.spring.SpringContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver

public class SpringContext
extends GenericApplicationContext

Spring application context based on a Restlet context. Here is an example illustrating the various ways to use this class:

 SpringContext springContext = new SpringContext(getContext());
 springContext.getPropertyConfigRefs().add("war://config/database.properties");
 springContext.getXmlConfigRefs().add("war://config/applicationContext.xml");
 springContext.getXmlConfigRefs().add(
         "file:///C/myApp/config/applicationContext.xml");
 springContext.getXmlConfigRefs().add(
         "clap://thread/config/applicationContext.xml");
 

Author:
Jerome Louvel

Field Summary
 
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
 
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, LOAD_TIME_WEAVER_BEAN_NAME
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
 
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
 
Constructor Summary
SpringContext(Context restletContext)
          Constructor.
 
Method Summary
 java.util.List<java.lang.String> getPropertyConfigRefs()
          Returns the modifiable list of configuration URIs for beans definitions via property representations.
 Context getRestletContext()
          Returns the parent Restlet context.
 java.util.List<java.lang.String> getXmlConfigRefs()
          Returns the modifiable list of configuration URIs for beans definitions via XML representations.
 void refresh()
           
 
Methods inherited from class org.springframework.context.support.GenericApplicationContext
closeBeanFactory, getBeanDefinition, getBeanFactory, getDefaultListableBeanFactory, getResource, getResources, isAlias, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBeanDefinition, removeAlias, removeBeanDefinition, setParent, setResourceLoader
 
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, cancelRefresh, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getStartupDate, getType, initApplicationEventMulticaster, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setId, start, stop, toString
 
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResourceByPath, setClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames
 
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases
 
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader
 

Constructor Detail

SpringContext

public SpringContext(Context restletContext)
Constructor.

Parameters:
restletContext - The parent Restlet context.
Method Detail

getPropertyConfigRefs

public java.util.List<java.lang.String> getPropertyConfigRefs()
Returns the modifiable list of configuration URIs for beans definitions via property representations.

Returns:
The modifiable list of configuration URIs.

getRestletContext

public Context getRestletContext()
Returns the parent Restlet context.

Returns:
The parent Restlet context.

getXmlConfigRefs

public java.util.List<java.lang.String> getXmlConfigRefs()
Returns the modifiable list of configuration URIs for beans definitions via XML representations.

Returns:
The modifiable list of configuration URIs.

refresh

public void refresh()
Specified by:
refresh in interface ConfigurableApplicationContext
Overrides:
refresh in class AbstractApplicationContext


Copyright © 2005-2008 Noelios Technologies.