toolbox.services
Class FactoryResolver

Package class diagram package FactoryResolver
java.lang.Object
  extended by toolbox.services.BaseResolver
      extended by toolbox.services.FactoryResolver
All Implemented Interfaces:
DependencyResolver

public class FactoryResolver
extends BaseResolver
implements DependencyResolver

DependencyResolver implementation to resolve ObjectFactory dependencies.


Constructor Summary
FactoryResolver()
          Default constructor.
 
Method Summary
 void resolve(java.lang.Object svcInstance, java.lang.Class svcClass, java.util.Map config)
          Resolve the service dependency as described in the given dependency config parameters.
 
Methods inherited from class toolbox.services.BaseResolver
invokeServiceMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryResolver

public FactoryResolver()
Default constructor.

Method Detail

resolve

public void resolve(java.lang.Object svcInstance,
                    java.lang.Class svcClass,
                    java.util.Map config)
             throws ServiceException
Resolve the service dependency as described in the given dependency config parameters. This implementation will attempt to obtain an Object instance using the configured ObjecFactory. If the dependency is resolved successfully it is injected into the given service instance.

Specified by:
resolve in interface DependencyResolver
Parameters:
svcInstance - Service instance for which the dependency must be resolved.
svcClass - Class that defines the service type.
config - Map containing the dependency configuration. The map will contain the follwing keys:
  • useServiceClassLoader - Boolean
  • type - String
  • home - String
  • class - String
  • serviceMethod - String
  • factoryName - String
  • factoryClass - String
  • factoryConfig - String
Throws:
ServiceException - if an exception occurs while trying to resolve the dependency.