toolbox.services
Class ServiceResolver

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

public class ServiceResolver
extends BaseResolver
implements DependencyResolver

DependencyResolver implementation to resolve Service dependencies.


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

ServiceResolver

public ServiceResolver()
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 a ServiceRegistry and Service using the provided configuration. 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
  • serviceRegistry - String
  • serviceName - String
Throws:
ServiceException - if an exception occurs while trying to resolve the dependency.