|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.neeve.toa.TopicOrientedApplication
com.neeve.managed.toa.hk2.AbstractHK2TopicOrientedApplication
public abstract class AbstractHK2TopicOrientedApplication
The AbstractHK2TopicOrientedApplication is the base class for TOA Applications that want to leverage the
HK2 Dependency Injection Framework. HK2 provides a light-weight but powerful dependency injection
mechanism. The AbstractHK2TopicOrientedApplication integrates HK2 with Talon Application Server and the Hornet Application
Framework so that HK2 can be used to discover Talon Managed Objects and Hornet Applications gain access to a
Application ServiceLocator. Hornet Applications that want to leverage HK2 must extend this
class and not TopicOrientedApplication.
com.neeve.managed.toa.hk2| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.neeve.toa.TopicOrientedApplication |
|---|
TopicOrientedApplication.ChannelJoin |
| Field Summary |
|---|
| Fields inherited from class com.neeve.toa.TopicOrientedApplication |
|---|
_tracer |
| Constructor Summary | |
|---|---|
AbstractHK2TopicOrientedApplication()
|
|
| Method Summary | |
|---|---|
protected abstract List<Binder> |
getApplicationModules()
Get the Application Modules. |
protected ServiceLocator |
getApplicationServiceLocator()
Return the Application ServiceLocator. |
protected ManagedObjectLocator |
getManagedObjectLocator()
Subclasses may override this method to change the strategy for locating an application's managed objects. |
protected abstract String |
getName()
Get the Application Name. |
protected void |
onEngineDescriptorInjected(AepEngineDescriptor engineDescriptor)
The AbstractHK2TopicOrientedApplication extends the life-cycle of the TopicOrientedApplication to allow for the
creation of an HK2 ServiceLocator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractHK2TopicOrientedApplication()
| Method Detail |
|---|
protected void onEngineDescriptorInjected(AepEngineDescriptor engineDescriptor)
throws Exception
AbstractHK2TopicOrientedApplication extends the life-cycle of the TopicOrientedApplication to allow for the
creation of an HK2 ServiceLocator. The construction of the
Application ServiceLocator happens early, during the AepEngineDescriptor customization
phase so that components and/or services can be given the chance to participate in the initialization of the Application and
the AEP Engine. Specifically, when this method is invoked two things happen (after the standard TopicOrientedApplication life-cycle):
AepEngineDescriptor is injected the AbstractHK2TopicOrientedApplication will construct the
Application ServiceLocator. After this point the Application may use the
Application Service Locator to retrieve Services or other information (such as Configuration) from the ServiceLocator.
injected into this
instance. These injected dependencies will be satisfied based upon the standard HK2 injection strategy. Note that only after this
point will injected dependencies be available.
onEngineDescriptorInjected in class TopicOrientedApplicationengineDescriptor - the AepEngineDescriptor
Exception - An application throwing an exception from this method will cause loading of the application to fail.protected ManagedObjectLocator getManagedObjectLocator()
TopicOrientedApplication
The default implementation returns a new instance of DefaultManagedObjectLocator.
This is called prior to locating and parsing an application's service model and also prior to construction of the
application's underlying AepEngine At this point the SrvAppLoader will have been injected via
TopicOrientedApplication.onAppLoaderInjected(SrvAppLoader) and the AepEngineDescriptor will have been injected via
TopicOrientedApplication.onEngineDescriptorInjected(AepEngineDescriptor) so they may be used to figure out information about
the application's identity.
getManagedObjectLocator in class TopicOrientedApplicationManagedObjectLocator to use to load the application's services.DefaultManagedObjectLocatorprotected ServiceLocator getApplicationServiceLocator()
HK2 ServiceLocator.
The Application ServiceLocator has a name that is the same as the
Application Name. All the the Application Modules will be bound into the
Application ServiceLocator. The Application ServiceLocator can be used (via the standard HK2 API) to retrieve any services or
components that are configured in any of the Application Modules.
IllegalStateException - if the Application ServiceLocator is not available. This may happen if onEngineDescriptorInjected(AepEngineDescriptor)
has not been invoked yet or if the Application has been shutdownprotected abstract List<Binder> getApplicationModules()
Application ServiceLocator. This list may be empty but it must not be null.
protected abstract String getName()
ServiceLocator
for the Application. The Application Name will be made available to components and services and can also be used to support qualified
injection. The Application Name must not be null and must not be an empty string or a string that contains only whitespace.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||