com.neeve.managed.hk2
Class HK2ManagedObjectLocator

java.lang.Object
  extended by com.neeve.managed.hk2.HK2ManagedObjectLocator
All Implemented Interfaces:
ManagedObjectLocator

public class HK2ManagedObjectLocator
extends Object
implements ManagedObjectLocator

A ManagedObjectLocator that uses Binder HK2 Modules to discover the Managed objects in the TopicOrientedApplication.


Field Summary
protected static Tracer tracer
           
 
Constructor Summary
HK2ManagedObjectLocator(TopicOrientedApplication application, String applicationName, List<Binder> applicationModules)
           
 
Method Summary
protected  List<Binder> createPlatformModules()
          Construct the Platform Modules.
protected  ServiceLocator createServiceLocator(String applicationName)
          Construct the ServiceLocator for the TopicOrientedApplication.
 void destroy()
          Destroy the Application Service Locator and any Managed Objects it may have created.
 ServiceLocator getAppplicationServiceLocator()
          Get the Application Service Locator.
 void locateManagedObjects(Set<Object> managedObjects)
          Populates the set of managed objects for a TopicOrientedApplication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracer

protected static final Tracer tracer
Constructor Detail

HK2ManagedObjectLocator

public HK2ManagedObjectLocator(TopicOrientedApplication application,
                               String applicationName,
                               List<Binder> applicationModules)
Method Detail

locateManagedObjects

public void locateManagedObjects(Set<Object> managedObjects)
                          throws Exception
Description copied from interface: ManagedObjectLocator
Populates the set of managed objects for a TopicOrientedApplication.

It is illegal to add null objects to the set of managed objects - doing so will caus application load to fail with an exception.

Specified by:
locateManagedObjects in interface ManagedObjectLocator
Parameters:
managedObjects - The collection into which to add the service urls.
Throws:
Exception

createPlatformModules

protected List<Binder> createPlatformModules()
Construct the Platform Modules. These are the modules that are logically provided by the Platform and should be included by default in every TopicOrientedApplication.

Returns:
the platform modules

createServiceLocator

protected ServiceLocator createServiceLocator(String applicationName)
Construct the ServiceLocator for the TopicOrientedApplication.

Parameters:
applicationName - The human-readable name of the TopicOrientedApplication. This should be used as the name for the ServiceLocator.
Returns:
the ServiceLocator for the TopicOrientedApplication

destroy

public void destroy()
Destroy the Application Service Locator and any Managed Objects it may have created.


getAppplicationServiceLocator

public ServiceLocator getAppplicationServiceLocator()
Get the Application Service Locator. Each TopicOrientedApplication is provided with its own ServiceLocator that will be different from that used by any other TopicOrientedApplication.

Returns:
the Application Service Locator


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.