toolbox.services
Class PojoResolver

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

public class PojoResolver
extends BaseResolver
implements DependencyResolver

DependencyResolver implementation to resolve plain Java Object dependencies.


Constructor Summary
PojoResolver()
          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

PojoResolver

public PojoResolver()
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 find a required Java Class and create an instance of it using the default constructor. 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
Throws:
ServiceException - if an exception occurs while trying to resolve the dependency.