com.xenonsoft.bridgetown.app
Class WebApplicationAssembler

java.lang.Object
  extended bycom.xenonsoft.bridgetown.soa.impl.AbstractServiceAssembler
      extended bycom.xenonsoft.bridgetown.soa.impl.AOPAbstractServiceAssembler
          extended bycom.xenonsoft.bridgetown.soa.impl.AOPServiceAssemblerImpl
              extended bycom.xenonsoft.bridgetown.app.WebApplicationAssembler
All Implemented Interfaces:
IApplicationAssembler, IDisposable, IServiceAssembler, IServiceObjectFactory, IStartable, java.io.Serializable

public class WebApplicationAssembler
extends AOPServiceAssemblerImpl
implements IApplicationAssembler

This application assembler is a service assembly specifically designed for a web application. It loads a series of configurations from the servlet context resources and create an assembly. Each configuration is merged with the previous.

Definitions in the first configuration are overriden by the later ones, if specified.

In order to use this class, the resource URI must be retrieved first. Assembly configuration are normally set as file resource relative the wep application context. Typically these resource URI are defined in a servlet or a context listener. The WebApplicationAssemblerContextListener is convenience class that allows these configurations to be loaded. It also set creates a WebApplicationAssembler object and stores it into the application scope.

Version:
$Id: WebApplicationAssembler.java,v 1.5 2005/02/23 01:29:20 peter_pilgrim Exp $
Author:
Peter Pilgrim, Aug 23, 2004 9:50:46 PM
See Also:
WebApplicationAssemblerContextListener, setAssembler(ServletContext, WebApplicationAssembler), getAssembler(ServletContext), Serialized Form

Field Summary
static java.lang.String STORAGE_ATTRIBUTE
          The attribute name that the web application assembler is saved and retrieved under.
 
Fields inherited from class com.xenonsoft.bridgetown.soa.impl.AbstractServiceAssembler
assembly, beanPropertyValueResolver, classLoader, instanceCache, proxyBeanBuilder
 
Constructor Summary
WebApplicationAssembler()
          Default constructor
WebApplicationAssembler(javax.servlet.ServletContext newContext)
          Standard constructor
 
Method Summary
static WebApplicationAssembler getAssembler(javax.servlet.ServletContext servletContext)
          Retrieve the web application assembler from the servlet context (JSP application scope)
 javax.servlet.ServletContext getServletContext()
          Gets the servletContext
 void load(IConfigLoader[] configLoaderList)
          Loads the array configurations into the assembler factory, replacing the current configuration if it exists.
 void load(java.lang.String[] contextUrls)
          A convenience method that loads assembly configuration from an array of servlet context relative URIs.
protected static void setAssembler(javax.servlet.ServletContext servletContext, WebApplicationAssembler assembler)
          Saves the supplied web application assembler into the servlet context (JSP application scope)
 void setServletContext(javax.servlet.ServletContext servletContext)
          Sets the servletContext
 
Methods inherited from class com.xenonsoft.bridgetown.soa.impl.AOPServiceAssemblerImpl
getName, getName, getService
 
Methods inherited from class com.xenonsoft.bridgetown.soa.impl.AOPAbstractServiceAssembler
configureParameterBeanReferences, createBeanBuilder, getAopWeaver, setAopWeaver, start, weavePointcut
 
Methods inherited from class com.xenonsoft.bridgetown.soa.impl.AbstractServiceAssembler
checkFactory, configureServiceBeanProperties, configureServiceBeanReferences, containsContext, containsService, createRetrieveServiceBean, createServiceBean, createServiceBean, createServiceBean, dispose, fixupServiceBeanReferences, getAssemblyConfig, getBeanPropertyValueResolver, getClassListFromNameList, getClassLoader, getContextConfig, getContextNameList, getProxyBeanBuilder, getServiceConfig, getServiceNameList, getServicesConfig, invokeServiceBeanMethod, invokeServiceBeanMethods, load, merge, recursiveCreateServiceBean, resolveValueReferences, setBeanPropertyValueResolver, setClassLoader, setProxyBeanBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.xenonsoft.bridgetown.soa.IServiceAssembler
getAssemblyConfig, getBeanPropertyValueResolver, getClassLoader, load, merge, setBeanPropertyValueResolver, setClassLoader
 
Methods inherited from interface com.xenonsoft.bridgetown.soa.IServiceObjectFactory
containsContext, containsService, getContextNameList, getName, getName, getService, getServiceNameList
 
Methods inherited from interface com.xenonsoft.bridgetown.soa.IStartable
start
 
Methods inherited from interface com.xenonsoft.bridgetown.soa.IDisposable
dispose
 

Field Detail

STORAGE_ATTRIBUTE

public static final java.lang.String STORAGE_ATTRIBUTE
The attribute name that the web application assembler is saved and retrieved under.

Constructor Detail

WebApplicationAssembler

public WebApplicationAssembler()
Default constructor


WebApplicationAssembler

public WebApplicationAssembler(javax.servlet.ServletContext newContext)
Standard constructor

Parameters:
newContext - the servlet context reference to save
Method Detail

getServletContext

public javax.servlet.ServletContext getServletContext()
Gets the servletContext

Returns:
Returns the servletContext.

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Sets the servletContext

Parameters:
servletContext - the new value for servletContext

load

public void load(IConfigLoader[] configLoaderList)
Loads the array configurations into the assembler factory, replacing the current configuration if it exists.

This method merges the configurations into one or another, with the definitions in the last configuration overriding any previously set definitions.

Specified by:
load in interface IApplicationAssembler
Parameters:
configLoaderList - the array of configuration loaders
Throws:
AssemblyConfigException - if the factory cannot read the assembly configuration
AssemblyFactoryException - if the factory cannot create the service assembly
See Also:
com.xenonsoft.bridgetown.soa.IApplicationAssembler#load(com.xenonsoft.bridgetown.soa.config.IConfigLoader[]), IServiceAssembler.merge(IConfigLoader, boolean)

load

public void load(java.lang.String[] contextUrls)
A convenience method that loads assembly configuration from an array of servlet context relative URIs. Each URI must be relative to the web application context. That is the assembly cannot load configuration external to the web apps!

See Also:
load(IConfigLoader[])

setAssembler

protected static void setAssembler(javax.servlet.ServletContext servletContext,
                                   WebApplicationAssembler assembler)
Saves the supplied web application assembler into the servlet context (JSP application scope)

Parameters:
servletContext - the servlet context
assembler - the application assembler

getAssembler

public static WebApplicationAssembler getAssembler(javax.servlet.ServletContext servletContext)
Retrieve the web application assembler from the servlet context (JSP application scope)

Parameters:
servletContext - the servlet context
Returns:
the application assembler


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.