com.xenonsoft.bridgetown.soa
Interface IServiceAssembler

All Superinterfaces:
IDisposable, IServiceObjectFactory, IStartable
All Known Subinterfaces:
IApplicationAssembler
All Known Implementing Classes:
AbstractServiceAssembler, ApplicationAssemblerImpl, WebApplicationAssembler

public interface IServiceAssembler
extends IServiceObjectFactory, IStartable, IDisposable

This is an interface contract for a Service assembler object. This type of object stands as a classic IoC assembler. User is can provide more control over the service object factory, by defining a class loader instance. It is able to load the configuration from an external resource with the help of a IConfigLoader object. The configuration are also mergeable with this class. The user is also able to override and set a bean property resolver object IBeanPropertyValueResolver to interpret tokenised property settings.

Please also read

Version:
$Id: IServiceAssembler.java,v 1.5 2005/03/29 23:41:24 peter_pilgrim Exp $
Author:
Peter Pilgrim, July 2004

Method Summary
 AssemblyConfig getAssemblyConfig()
          Retrieve the root assembly configuration
 IBeanPropertyValueResolver getBeanPropertyValueResolver()
          Gets the beanPropertyValueResolver for this assembly factory
 java.lang.ClassLoader getClassLoader()
          Gets the current class loader for the assembly factory.
 void load(IConfigLoader configLoader)
          Load the configuration for this service assembly
 void merge(IConfigLoader configLoader, boolean override)
          Merge the supplied reference service assembly into the current existing configuration.
 void setBeanPropertyValueResolver(IBeanPropertyValueResolver beanPropertyValueResolver)
          Sets the beanPropertyValueResolver for this assembly factory
 void setClassLoader(java.lang.ClassLoader classLoader)
          Sets the class loader for the assembly factory.
 
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
 

Method Detail

setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)
Sets the class loader for the assembly factory. This method allows an application to set an alternative class loader for the service assembly factory. Ideally the class loader should be set before the assembly is started, where service beans are instantiated and their dependencies injected.

Parameters:
classLoader - the class loader

getClassLoader

public java.lang.ClassLoader getClassLoader()
Gets the current class loader for the assembly factory.

Returns:
the current classLoader the class loader
See Also:
setClassLoader(ClassLoader)

load

public void load(IConfigLoader configLoader)
Load the configuration for this service assembly

Parameters:
configLoader - the configuration loader
Throws:
AssemblyConfigException - if the factory cannot read the assembly configuration
AssemblyFactoryException - if the factory cannot create the service assembly
See Also:
merge(IConfigLoader, boolean)

merge

public void merge(IConfigLoader configLoader,
                  boolean override)
Merge the supplied reference service assembly into the current existing configuration.

Here are the suggested cases for a merge algorithm. Of course implementer are free to invent a new style of merging algorithm as long as it is very well documented, and perhaps if it is so radical then provide a separate Java interface as well as unit tests

  1. There is no current assembly service configuration. The behaviour is exactly the same as load( IConfigLoader )
  2. The reference context does NOT exist in the current service assembly. If the caller indicated s/he wants to override then therefore simply add the reference context to the current assembly.
  3. A service bean in the reference assembly does not exist in current assembly, so add the reference service to the current assembly.
  4. If the service bean in the reference assembly does does exist in the current assembly, and the caller has indicated s/he wants to the reference to override, then replace the current service definition with the reference definition.

Parameters:
configLoader - the configuration loader
override - true if the configuration context should override the existing configuration
Throws:
AssemblyConfigException - if the factory cannot read the assembly configuration
AssemblyFactoryException - if the factory cannot create the service assembly
See Also:
load(IConfigLoader)

getAssemblyConfig

public AssemblyConfig getAssemblyConfig()
Retrieve the root assembly configuration


getBeanPropertyValueResolver

public IBeanPropertyValueResolver getBeanPropertyValueResolver()
Gets the beanPropertyValueResolver for this assembly factory

Returns:
Returns the beanPropertyValueResolver.

setBeanPropertyValueResolver

public void setBeanPropertyValueResolver(IBeanPropertyValueResolver beanPropertyValueResolver)
Sets the beanPropertyValueResolver for this assembly factory

Parameters:
beanPropertyValueResolver - The beanPropertyValueResolver to set.


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.