org.abstracthorizon.extend.support.spring.server
Class SpringBasedServerApplicationContext

java.lang.Object
  extended by org.springframework.core.io.DefaultResourceLoader
      extended by org.springframework.context.support.AbstractApplicationContext
          extended by org.springframework.context.support.AbstractRefreshableApplicationContext
              extended by org.springframework.context.support.AbstractXmlApplicationContext
                  extended by org.abstracthorizon.extend.support.spring.server.SpringBasedServerApplicationContext
All Implemented Interfaces:
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver

public class SpringBasedServerApplicationContext
extends AbstractXmlApplicationContext

Servers application context

Author:
Daniel Sendula

Field Summary
static String SERVER_CONFIG
          Server config protocol url
protected static int SERVER_CONFIG_LEN
          Server config protocol url len
static String SERVER_DATA
          Server data protocol url
protected static int SERVER_DATA_LEN
          Server data protocol url len
static String SERVER_DEPLOY
          Server deploy protocol url
protected static int SERVER_DEPLOY_LEN
          Server deploy protocol url len
static String SERVER_LOCATION
          Server location protocol url
protected static int SERVER_LOCATION_LEN
          Server location protocol url len
static String SERVER_PREFIX
          Server protocol url prefix
protected  URL serverConfigFile
          Server's config file location
protected  URL serverConfigLocation
          Server's config location
protected  URL serverDataLocation
          Server's data location
protected  URL serverDeployLocation
          Server's deploy location
protected  URL serverLocation
          Server's location
 
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.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
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
SpringBasedServerApplicationContext()
          Empty constructor
SpringBasedServerApplicationContext(URL serverLocation)
          Constructor
 
Method Summary
protected  String[] getConfigLocations()
          Returns server's config location
 Resource getResource(String location)
          Returns resource.
 URL getServerConfigFile()
          Returns server's config file
 URL getServerConfigLocation()
          Returns server's config location
 URL getServerDataLocation()
          Returns server's data location
 URL getServerDeployLocation()
          Returns server's deploy location
 URL getServerLocation()
          Returns server's location
protected  Resource makeURLResource(URL url, String location)
          Creates URL resource
 void refresh()
          Sets class loader from this classes class loader
 void setServerConfigFile(URL serverConfigFile)
          Sets server's config file
 void setServerConfigLocation(URL serverConfigLocation)
          Sets server's config location
 void setServerDataLocation(URL serverDataLocation)
          Sets server's data location
 void setServerDeployLocation(URL serverDeployLocation)
          Sets server's deploy location
 void setServerLocation(URL serverLocation)
          Sets server's location
 
Methods inherited from class org.springframework.context.support.AbstractXmlApplicationContext
getConfigResources, initBeanDefinitionReader, loadBeanDefinitions, loadBeanDefinitions
 
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, refreshBeanFactory
 
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getDisplayName, getInternalParentBeanFactory, getInternalParentMessageSource, getLifecycleBeans, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, initApplicationEventMulticaster, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent, 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.core.io.ResourceLoader
getClassLoader
 

Field Detail

SERVER_PREFIX

public static final String SERVER_PREFIX
Server protocol url prefix

See Also:
Constant Field Values

SERVER_LOCATION

public static final String SERVER_LOCATION
Server location protocol url

See Also:
Constant Field Values

SERVER_LOCATION_LEN

protected static final int SERVER_LOCATION_LEN
Server location protocol url len


SERVER_DATA

public static final String SERVER_DATA
Server data protocol url

See Also:
Constant Field Values

SERVER_DATA_LEN

protected static final int SERVER_DATA_LEN
Server data protocol url len


SERVER_DEPLOY

public static final String SERVER_DEPLOY
Server deploy protocol url

See Also:
Constant Field Values

SERVER_DEPLOY_LEN

protected static final int SERVER_DEPLOY_LEN
Server deploy protocol url len


SERVER_CONFIG

public static final String SERVER_CONFIG
Server config protocol url

See Also:
Constant Field Values

SERVER_CONFIG_LEN

protected static final int SERVER_CONFIG_LEN
Server config protocol url len


serverLocation

protected URL serverLocation
Server's location


serverConfigLocation

protected URL serverConfigLocation
Server's config location


serverConfigFile

protected URL serverConfigFile
Server's config file location


serverDataLocation

protected URL serverDataLocation
Server's data location


serverDeployLocation

protected URL serverDeployLocation
Server's deploy location

Constructor Detail

SpringBasedServerApplicationContext

public SpringBasedServerApplicationContext()
Empty constructor


SpringBasedServerApplicationContext

public SpringBasedServerApplicationContext(URL serverLocation)
Constructor

Parameters:
serverConfigLocation - server's config location
Method Detail

refresh

public void refresh()
Sets class loader from this classes class loader

Specified by:
refresh in interface ConfigurableApplicationContext
Overrides:
refresh in class AbstractApplicationContext

getConfigLocations

protected String[] getConfigLocations()
Returns server's config location

Overrides:
getConfigLocations in class AbstractXmlApplicationContext
Returns:
server's config location

getServerLocation

public URL getServerLocation()
Returns server's location

Returns:
server's location

setServerLocation

public void setServerLocation(URL serverLocation)
Sets server's location

Parameters:
serverLocation - server's location

getServerConfigLocation

public URL getServerConfigLocation()
Returns server's config location

Returns:
server's config location

setServerConfigLocation

public void setServerConfigLocation(URL serverConfigLocation)
Sets server's config location

Parameters:
serverConfigLocation - server's config location

getServerConfigFile

public URL getServerConfigFile()
Returns server's config file

Returns:
server's config file

setServerConfigFile

public void setServerConfigFile(URL serverConfigFile)
Sets server's config file

Parameters:
serverConfigFile - server's config file

getServerDataLocation

public URL getServerDataLocation()
Returns server's data location

Returns:
server's data location

setServerDataLocation

public void setServerDataLocation(URL serverDataLocation)
Sets server's data location

Parameters:
serverDataLocation - server's data location

getServerDeployLocation

public URL getServerDeployLocation()
Returns server's deploy location

Returns:
server's deploy location

setServerDeployLocation

public void setServerDeployLocation(URL serverDeployLocation)
Sets server's deploy location

Parameters:
serverDataLocation - server's deploy location

getResource

public Resource getResource(String location)
Returns resource. This is wrapper over spring's own implementaiton to add new URL types:

Specified by:
getResource in interface ResourceLoader
Overrides:
getResource in class DefaultResourceLoader

makeURLResource

protected Resource makeURLResource(URL url,
                                   String location)
                            throws MalformedURLException
Creates URL resource

Parameters:
url - url
Returns:
URL resource
Throws:
MalformedURLException


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.