|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.toa.TopicOrientedApplication
public abstract class TopicOrientedApplication
Base class for topic oriented applications.
TopicOrientedApplication
class reserves usage of several AepEngine features for its
own use:
TopicOrientedApplication
reserves the sole right to set AepEngine.setPredispatchMessageHandler(IAepPredispatchMessageHandler)
.
Applications may register delegate handlers via addPredispatchMessageHandler(IAepPredispatchMessageHandler)
.
TopicOrientedApplication
reserves the sole right to set AepEngine.setPostdispatchMessageHandler(IAepPostdispatchMessageHandler)
.
Applications may register delegate handlers via addPostdispatchMessageHandler(IAepPostdispatchMessageHandler)
.
AppInjectionPoint
TopicOrientedApplication
currently implements these injection points, Subclasses may
override the following methods instead:
AppInitializer
, use onAppFinalized()
AppFinalizer
, use onAppFinalized()
AppEventHandlerContainersAccessor
, @AppStatContainersAccessor
and @AppCommandHandlerContainersAccessor
TopicOrientedApplication
implements the accessors for application event
and command handlers, and instead exposes a single collection point for all objects of interest to the server for introspect
via a ManagedObjectLocator
. The default ManagedObjectLocator
SrvAppLoader
into a AppInjectionPoint
annotated method to let the application first see the server and its SrvConfigAppDescriptor
.
The SrvAppLoader provides the application with the ability to inspect the identity of the server in which it is being launched.
AppInjectionPoint
for SrvAppLoader
,
subclasses can instead override onAppLoaderInjected(SrvAppLoader)
.
AepEngineDescriptor
into an AppInjectionPoint
annotated method to let the app customize its AepEngine
. The application may
augment the AepEngineDescriptor
, and to inspect the configuration of the application being launched.
AppInjectionPoint
for AepEngineDescriptor
,
subclasses can instead override onEngineDescriptorInjected(AepEngineDescriptor)
.
getManagedObjectLocator()
and call its ManagedObjectLocator.locateManagedObjects(Set)
method to find objects that expose
AppCommandHandler
or EventHandler
annotations.
TopicOrientedApplication
implements AppCommandHandlerContainersAccessor
and AppEventHandlerContainersAccessor
methods that
pass the objects returned from the application's ManagedObjectLocator
, so it is illegal for subclasses to use these annotations
getServiceDefinitionLocator()
and invoke its ServiceDefinitionLocator.locateServices(Set)
. TopicOrientedApplication
parses the
service models returned by the ServiceDefinitionLocator
and based on interest defined by the application's EventHandler
s determines which
channels to join.
onConfigured()
. At this point the application can call getServiceModels()
or getServiceModel(String)
to examine the parsed
service model.
AppStateFactoryAccessor
annotated method to retrieve the application's state factory (for use with state replication engines).
AepEngineDescriptor
, IAepApplicationStateFactory
, and EventHandler
s, registering the
SrvAppLoader
as a IAepWatcher
for the engine.
AepEngine
into a AppInjectionPoint
annotated method to provide the application access to its AepEngine
.
AppInjectionPoint
for AepEngine
,
subclasses can instead override onEngineInjected(AepEngine)
. In most cases, the application should not use the AepEngine
directly and instead use the
corresponding facilities provided by TopicOrientedApplication
(MessageSender
, MessageInjector
, EngineClock
etc).
AppStat
. This implies that by the time the call to onEngineInjected(AepEngine)
returns,
all application defined stats should have been constucted by the application.
onAppInitialized()
to indicate that the applications has been successfully initialized.
TopicOrientedApplication
utilizes the AppInitializer
annotation to implement this, applications must not use the AppInitializer
annotation.
AppMain
annotation, spin up Main Thread for the application when the AepEngine becomes Primary and invoke it.
For an application that is responsive (i.e. reacts to messages), an application may register additional Aep LifecycleEvent
EventHandler
s to
respond to various application lifecycle events (see link below)
onAppFinalized()
method on the app and join its AppMain
n thread if started.
TopicOrientedApplication
utilizes the AppFinalizer
annotation to implement this, applications must not use the AppInitializer
annotation.
AepEngine
lifecycle, see
X Application Lifecycle)
TopicOrientedApplication
to support clustering, subclasses
must be annotated with an AppHAPolicy
annotation.
Field Summary | |
---|---|
protected static Tracer |
_tracer
|
Constructor Summary | |
---|---|
protected |
TopicOrientedApplication()
Default constructor. |
Method Summary | |
---|---|
protected void |
addAppCommandHandlerContainers(Set<Object> containers)
This method may be overridden by subclasses to add additional objects that contain methods with AppCommandHandler annotations. |
protected void |
addAppStatContainers(Set<Object> containers)
This method may be overridden by subclasses to add additional objects that contain methods with AppStat annotations. |
protected void |
addChannelFilterProviders(Set<Object> containers)
This method may be overridden by subclasses to add additional objects that implement ChannelFilterProvider . |
protected void |
addChannelInitialKeyResolutionTableProviders(Set<Object> containers)
This method may be overridden by subclasses to add additional objects that implement ChannelQosProvider . |
protected void |
addChannelQosProviders(Set<Object> containers)
This method may be overridden by subclasses to add additional objects that implement ChannelQosProvider . |
protected void |
addHandlerContainers(Set<Object> containers)
This method may be overridden by subclasses to add additional objects that contain methods with EventHandler annotations. |
void |
addPostdispatchMessageHandler(IAepPostdispatchMessageHandler handler)
Adds a message handler to be invoked after 'normal' message handler dispatch. |
void |
addPredispatchMessageHandler(IAepPredispatchMessageHandler handler)
Adds a message handler to be invoked before 'normal' message handler dispatch. |
protected void |
addTopicResolverProviders(Set<Object> containers)
This method may be overridden by subclasses to add additional objects that implement TopicResolverProvider . |
protected String |
getChannelFilter(ToaService serviceName,
ToaServiceChannel channelName)
This method may be overridden by subclasses to associate a channel filter with the application. |
protected MessageChannel.Qos |
getChannelQos(ToaService service,
ToaServiceChannel channel)
This method may be overridden by subclasses to specify the MessageChannel.Qos for
the provided service channel. |
Configurer |
getConfigurer()
Returns this application's bootstrap configurer. |
AepEngine |
getEngine()
Returns this application's AepEngine . |
EngineClock |
getEngineClock()
Return an interface which may be used to get the AepEngine
time. |
protected Properties |
getInitialChannelKeyResolutionTable(ToaService service,
ToaServiceChannel channel)
This method may be overridden by subclasses to perform initial key resolution on a channel at the time it is configured which allows all or a portion of a channel's dynamic key parts to be determined statically at configuration time by returning a initial Key Resolution Table (KRT). |
protected ManagedObjectLocator |
getManagedObjectLocator()
Subclasses may override this method to change the strategy for locating an application's managed objects. |
MessageInjector |
getMessageInjector()
Returns the MessageSender implementation which is this class. |
MessageSender |
getMessageSender()
Returns the MessageSender implementation which is this class. |
protected ServiceDefinitionLocator |
getServiceDefinitionLocator()
Subclasses may override this method to change the way service xmls are located. |
protected ToaService |
getServiceModel(String fullServiceName)
Looks up a parsed service model by fully qualified name. |
protected Collection<ToaService> |
getServiceModels()
Returns the application's parsed service definitions. |
protected TopicResolver<?> |
getTopicResolver(ToaService serviceName,
ToaServiceChannel channelName,
Class<?> messageType)
This method may be overridden by subclasses to return a TopicResolver for
messages of the given type sent on the given channel. |
void |
injectMessage(IRogMessage message)
Enqueue a message into an application's AepEngine 's event multiplexer. |
void |
injectMessage(IRogMessage message,
boolean nonBlocking)
Enqueue a message into an application's AepEngine 's event multiplexer. |
void |
injectMessage(IRogMessage message,
boolean nonBlocking,
int delay)
Enqueue a message into an application's AepEngine 's event multiplexer. |
protected void |
onAppFinalized()
This is called after the application's AepEngine has been successfully created
and injected into the application. |
protected void |
onAppInitialized()
This is called after the application's AepEngine has been successfully created
and injected into the application. |
protected void |
onAppLoaderInjected(SrvAppLoader loader)
Called when the SrvAppLoader is injected into the application. |
protected void |
onConfigured()
Called after configuration of messaging and services has been successfully completed. |
protected void |
onEngineDescriptorInjected(AepEngineDescriptor engineDescriptor)
Called when the AepEngineDescriptor is injected into the application. |
protected void |
onEngineInjected(AepEngine engine)
Called when the AepEngine is injected into the application. |
void |
sendMessage(IRogMessage message)
Sends a message using the message's default channel. |
void |
sendMessage(IRogMessage message,
MessageChannel.RawKeyResolutionTable rawKeyResolutionTable)
Sends a message using the provide zero garbage key resolution table. |
void |
sendMessage(IRogMessage message,
Properties keyResolutionTable)
Sends a message using the provided key resolution table. |
void |
sendMessage(IRogMessage message,
String topic)
Sends a message using the given topic as the channel key. |
void |
sendMessage(IRogMessage message,
XString topic)
Sends a message using the given topic as the channel key (zero garbage variant). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Tracer _tracer
Constructor Detail |
---|
protected TopicOrientedApplication()
Method Detail |
---|
protected void addHandlerContainers(Set<Object> containers)
EventHandler
annotations.
This method is called by the DefaultManagedObjectLocator
, if an application
provides its own ManagedObjectLocator
then it is up to that locator as
to whether or not this method will be invoked.
This method is called by the application during the configuration phase
allowing the application subclass to register event handler containers
by adding objects having methods annotated with EventHandler
that
will serve as the application's message and event handlers.
This class is automatically added as an event handler container, subclasses should not add itself to the set.
containers
- Objects with EventHandler
methods should be added to this set.protected void addAppCommandHandlerContainers(Set<Object> containers)
AppCommandHandler
annotations.
This method is called by the DefaultManagedObjectLocator
, if an application
provides its own ManagedObjectLocator
then it is up to that locator as
to whether or not this method will be invoked.
This method is called by the application during the configuration phase
allowing the application subclass to register command handler containers
by adding objects having methods annotated with AppCommandHandler
that
will serve as the application's command handlers.
This class is automatically added as an command handler container, subclasses should not add itself to the set.
containers
- Objects with AppCommandHandler
methods should be added to this set.protected void addAppStatContainers(Set<Object> containers)
AppStat
annotations.
This method is called by the DefaultManagedObjectLocator
, if an application
provides its own ManagedObjectLocator
then it is up to that locator as
to whether or not this method will be invoked.
This method is called by the application during the configuration phase
allowing the application subclass to register command handler containers
by adding objects having methods annotated with AppStat
that
will serve as the application's command handlers.
This class is automatically added as an command handler container, subclasses should not add itself to the set.
containers
- Objects with AppStat
should be added to this set.protected void addChannelFilterProviders(Set<Object> containers)
ChannelFilterProvider
.
This method is called by the DefaultManagedObjectLocator
, if an application
provides its own ManagedObjectLocator
then it is up to that locator as
to whether or not this method will be invoked.
This method is called by the application during the configuration phase
allowing the application subclass to register ChannelFilterProvider
s
The default implementation of this method adds a filter provider that calls
getChannelFilter(ToaService, ToaServiceChannel)
containers
- Objects implementing ChannelFilterProvider
should be added to this set.protected void addTopicResolverProviders(Set<Object> containers)
TopicResolverProvider
.
This method is called by the DefaultManagedObjectLocator
, if an application
provides its own ManagedObjectLocator
then it is up to that locator as
to whether or not this method will be invoked.
This method is called by the application during the configuration phase
allowing the application subclass to register TopicResolverProvider
s
The default implementation of this method adds 2 TopicResolverProvider
s:
GeneratedTopicResolverProvider
which will search the classpath for channel resolvers
generated by the ToaCodeGenerator
.
getChannelFilter(ToaService, ToaServiceChannel)
, allowing
subclasses to return a TopicResolver
.
containers
- Objects implementing ChannelFilterProvider
should be added to this set.protected TopicResolver<?> getTopicResolver(ToaService serviceName, ToaServiceChannel channelName, Class<?> messageType)
TopicResolver
for
messages of the given type sent on the given channel.
This method will not be called unless addTopicResolverProviders(Set)
is
called on this class. This is done by the DefaultManagedObjectLocator
,
but may not be called if the application defines its own ManagedObjectLocator
.
serviceName
- The service name.channelName
- The name of the channel to filter.messageType
- The concrete class of the message.
TopicResolver
for the message when it is sent of the given channel.protected String getChannelFilter(ToaService serviceName, ToaServiceChannel channelName)
This method will not be called unless addChannelFilterProviders(Set)
is
called on this class. This is done by the DefaultManagedObjectLocator
,
but may not be called if the application defines its own ManagedObjectLocator
.
serviceName
- The service name.channelName
- The name of the channel to filter.
protected void addChannelQosProviders(Set<Object> containers)
ChannelQosProvider
.
This method is called by the DefaultManagedObjectLocator
, if an application
provides its own ManagedObjectLocator
then it is up to that locator as
to whether or not this method will be invoked.
This method is called by the application during the configuration phase
allowing the application subclass to register ChannelQosProvider
s
The default implementation of this method adds a ChannelQosProvider
that calls
getChannelFilter(ToaService, ToaServiceChannel)
on this class.
containers
- Objects implementing ChannelQosProvider
should be added to this set.protected MessageChannel.Qos getChannelQos(ToaService service, ToaServiceChannel channel)
MessageChannel.Qos
for
the provided service channel.
The default implementation returns null which in the absense of .
This method will not be called unless addChannelQosProviders(Set)
is
called on this class. This is done by the DefaultManagedObjectLocator
,
but may not be called if the application defines its own ManagedObjectLocator
.
service
- The servicechannel
- The channel.
protected void addChannelInitialKeyResolutionTableProviders(Set<Object> containers)
ChannelQosProvider
.
This method is called by the DefaultManagedObjectLocator
, if an application
provides its own ManagedObjectLocator
then it is up to that locator as
to whether or not this method will be invoked.
This method is called by the application during the configuration phase
allowing the application subclasses to register ChannelInitialKeyResolutionTableProvider
s
The default implementation of this method adds a ChannelQosProvider
that calls
getInitialChannelKeyResolutionTable(ToaService, ToaServiceChannel)
on this class.
containers
- Objects implementing ChannelInitialKeyResolutionTableProvider
should be added to this set.protected Properties getInitialChannelKeyResolutionTable(ToaService service, ToaServiceChannel channel)
This method will not be called unless addChannelQosProviders(Set)
is
called on this class. This is done by the DefaultManagedObjectLocator
,
but may not be called if the application defines its own ManagedObjectLocator
.
Example:
Given:With the above KRT, the channel would be intialized with a key of
- A channel, channel1 with a configured key of: ORDERS/${Region}/${Product}
- An initial KRT returned by this method of: {"Region": "US", "HostName": MyPC}
ORDERS/US/${Product}
. The dynamic 'Region' portion of the key has become static while the 'Product' portion remains dynamic and eligible for substitution with a runtime KRT or from values reflected from a message reflector.
NOTE:
The returned key resolution table is not used for individual send calls, if
the channel key still contains dynamic portions then dynamic key resolution
can be done on a per send basis using either the message's message reflector
or a key resolution table provide as a argument to the send call.
If more than one service share the same channel on the same bus, they will share the same channel key; at this time it is not possible to perform individual channel key resolution on a per service basis. In this sense the initial channel key resolution is global to a channel name. The serviceName is provided here as a hint to assist the application in locating a key resolution table for a channel.
service
- The service name.channel
- The channel for which to perform key resolution
protected ServiceDefinitionLocator getServiceDefinitionLocator()
The default implementation returns a new instance of DefaultServiceDefinitionLocator
.
This is called prior to constructing the application's underlying AepEngine
at this
point the SrvAppLoader
will have been injected via onAppLoaderInjected(SrvAppLoader)
and the AepEngineDescriptor
will have been injected via onEngineDescriptorInjected(AepEngineDescriptor)
so they may be used to figure out information about the application's identity.
ServiceDefinitionLocator
to use to load the application's services.DefaultServiceDefinitionLocator
protected ManagedObjectLocator getManagedObjectLocator()
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
onAppLoaderInjected(SrvAppLoader)
and the AepEngineDescriptor
will have been injected via
onEngineDescriptorInjected(AepEngineDescriptor)
so they may be used to figure out information about
the application's identity.
ManagedObjectLocator
to use to load the application's services.DefaultManagedObjectLocator
public final AepEngine getEngine()
AepEngine
. The engine is injected
just before the application is initialized, and this method will return
null before that occurs.
TopicOrientedApplication
subclasses should use the processing facilities
provided by this class for most operations, and only utilize the underlying
AepEngine
for functionality not provided by TOA. In particular,
all message sends should go through this application's MessageSender
api
and message injection should be done through the MessageInjector
unless
there is a compelling reason to bypass TOA.
AepEngine
public final EngineClock getEngineClock()
AepEngine
time.
The default implementation of EngineClock
returned simply
make a pass through call to the AepEngine.getEngineTime()
unless the engine for this application has not yet been set in
which case the returned clock will just return System.currentTimeMillis()
.
EngineClock
.public final Configurer getConfigurer()
For applications launched from the talon server Main
class this will
return the external Configurer
for the application. For an embedded
Talon server constructed by user code this will return whatever object the application
passed to the SrvController.setBootstrapConfigurer(Object)
.
The talon server injects the Configurer immediately after instantiating the TopicOrientedApplication.
protected final Collection<ToaService> getServiceModels()
An application's service definitions are parsed just after the application
calls addHandlerContainers(Set)
.
The returned collection must not be modified.
IllegalStateException
- if services have not yet been parsed.protected final ToaService getServiceModel(String fullServiceName)
An application's service definitions are parsed just after the application
calls addHandlerContainers(Set)
.
The returned ToaService must not be modified.
null
if no model was parsed.
IllegalStateException
- if services have not yet been parsed.public final MessageSender getMessageSender()
MessageSender
implementation which is this class.
This method is useful for dependency injection frameworks.
Note that the
thread safety of the returned implementation is the same as that of using
this class directly ... send calls are not thread safe and may only be
called from an EventHandler
, or in a non concurrent fashion by
an unsolicited 'sender' thread if this is a purely producer application.
public final void sendMessage(IRogMessage message)
MessageSender
AepEngine.sendMessage(MessageChannel, IRogMessage)
,
with the message channel resolved based on this application's service definition for the message type and the provided message.
sendMessage
in interface MessageSender
message
- The message to send.AepEngine.sendMessage(MessageChannel, IRogMessage)
public final void sendMessage(IRogMessage message, String topic)
MessageSender
AepEngine.sendMessage(MessageChannel, IRogMessage, String, Properties)
,
with the message channel resolved based on this application's service definition for the message type, the provided message, the provided
topic as the channel key, and no key resolution table.
sendMessage
in interface MessageSender
message
- The message to send.AepEngine.sendMessage(MessageChannel, IRogMessage)
public final void sendMessage(IRogMessage message, Properties keyResolutionTable)
MessageSender
AepEngine.sendMessage(MessageChannel, IRogMessage, Properties)
,
with the message channel resolved based on this application's service definition for the message type, the provided message,
key, and the provided message key.
sendMessage
in interface MessageSender
message
- The message to send.AepEngine.sendMessage(MessageChannel, IRogMessage)
public final void sendMessage(IRogMessage message, XString topic)
MessageSender
AepEngine.sendMessage(MessageChannel, IRogMessage, XString, MessageChannel.RawKeyResolutionTable)
,
with the message channel resolved based on this application's service definition for the message type, the provided message, the provided
topic as the channel key, and no key resolution table.
sendMessage
in interface MessageSender
message
- The message to send.AepEngine.sendMessage(MessageChannel, IRogMessage)
public final void sendMessage(IRogMessage message, MessageChannel.RawKeyResolutionTable rawKeyResolutionTable)
MessageSender
AepEngine.sendMessage(MessageChannel, IRogMessage, MessageChannel.RawKeyResolutionTable)
,
with the message channel resolved based on this application's service definition for the message type, the provided message,
and no key resolution table.
sendMessage
in interface MessageSender
message
- The message to send.AepEngine.sendMessage(MessageChannel, IRogMessage)
public final MessageInjector getMessageInjector()
MessageSender
implementation which is this class.
This method is useful for dependency injection frameworks.
Note that the
thread safety of the returned implementation is the same as that of using
this class directly ... send calls are not thread safe and may only be
called from an EventHandler
, or in a non concurrent fashion by
an unsolicited 'sender' thread if this is a purely producer application.
public final void injectMessage(IRogMessage message)
MessageInjector
AepEngine
's event multiplexer.
This method is the same as MessageInjector.injectMessage(IRogMessage, boolean)
with
a value of false for nonBlocking.
injectMessage
in interface MessageInjector
message
- The message to enqueue.public final void injectMessage(IRogMessage message, boolean nonBlocking)
MessageInjector
AepEngine
's event multiplexer.
This method is the same as MessageInjector.injectMessage(IRogMessage, boolean)
with
a value of false for nonBlocking and a delay of 0.
injectMessage
in interface MessageInjector
message
- The message to enqueue.public final void injectMessage(IRogMessage message, boolean nonBlocking, int delay)
MessageInjector
AepEngine
's event multiplexer.
This method enqueues a message into an engine's event multiplexer event loop and returns to the caller. The message is then dispatched subsequently using the normal message dispatch mechanisms.
AepEngine.waitForMessagingToStart()
to avoid
an injected message being discarded while an engine is transitioning to a started,
primary role.
It is important to note that message injection is thus effectively a BestEffor
operation because injections of message that are in the event multiplexer queue
at the time of failure will be lost
IRogNode.dispose()
on the message once it has been dispatched,
so an application must call MessageView.acquire()
if it will hold on to
a (read-only) reference to the message.
injectMessage
in interface MessageInjector
message
- The IRogMessage to enqueue.nonBlocking
- Indicates whether the multiplexing should be a
non-blocking action or not. If blocking, then the calling thread
will block if the main multiplexer queue is full and wait until
space is available. If non-blocking, then the method will not
wait but rather enque the message in a multiplexer feeder queue
and return.delay
- The delay in milliseconds at which the message should be injected.protected void onEngineDescriptorInjected(AepEngineDescriptor engineDescriptor) throws Exception
AepEngineDescriptor
is injected into the application.
This is called prior to creating the engine allowing applications to further customize
the AepEngine
prior to its construction.
Because TopicOrientedApplication
already provides an AppInjectionPoint
for AepEngineDescriptor
,
this method provides subclasses with a means to listen for AepEngineDescriptor
injection.
engineDescriptor
- the AepEngineDescriptor
Exception
- An application throwing an exception from this method will cause loading of the application to fail.protected void onConfigured() throws Exception
At this point the AepEngine
is still not available, but ToaService
s and the
the Configurer
are.
Applications may override this method to examine either of these objects.
Exception
- An application throwing an exception from this method will cause loading of the application to fail.protected void onEngineInjected(AepEngine engine) throws Exception
AepEngine
is injected into the application.
This is called after the AepEngine
has been created, but before it is started.
Because TopicOrientedApplication
already provides an AppInjectionPoint
for AepEngine
,
this method provides subclasses with a means to listen for AepEngine
injection.
engine
- the AepEngine
Exception
- An application throwing an exception from this method will cause loading of the application to fail.public final void addPredispatchMessageHandler(IAepPredispatchMessageHandler handler)
TopicOrientedApplication
messages are dispatched by the underlying
AepEngine
to @EventHandler
annotated methods exposed by the
application. This method, allows an applications to add generic pre dispatch handlers
to do pre processing before message dispatch to the 'normal' handlers.
If multiple pre dispatch message handlers are registered and one of them throws an
exception, remaining handlers will not be called and the engine will dispatch
an AepApplicationExceptionEvent
.
Handler addition is not permitted after the call to onEngineInjected(AepEngine)
and will thrown an IllegalStateException
.
IllegalStateException
- if this method is called after onEngineInjected(AepEngine)
.public final void addPostdispatchMessageHandler(IAepPostdispatchMessageHandler handler)
TopicOrientedApplication
messages are dispatched by the underlying
AepEngine
to @EventHandler
annotated methods exposed by the
application. This method, allows an applications to add generic post dispatch handlers
to do post processing after message dispatch to the 'normal' handlers.
If a message handler throws an exception prior to the IAepPostdispatchMessageHandler
being invoked, then the IAepPostdispatchMessageHandler
will not be invoked, and the
engine will instead dispatch an AepApplicationExceptionEvent
, so
an IAepPostdispatchMessageHandler may want to handle this event as well if it needs to
be notified in the event of an unsuccessful dispatch.
Handler addition is not permitted after the call to onEngineInjected(AepEngine)
and will thrown an IllegalStateException
.
IllegalStateException
- if this method is called after onEngineInjected(AepEngine)
.protected void onAppLoaderInjected(SrvAppLoader loader) throws Exception
This is called just after application class is constructed providing the means for an application to examine the configuration of the server that is loading it.
Because TopicOrientedApplication
already provides an AppInjectionPoint
for SrvAppLoader
,
this method provides subclasses with a means to listen for SrvAppLoader
injection.
loader
- the SrvAppLoader
Exception
- An application throwing an exception from this method will cause loading of the application to fail.protected void onAppInitialized() throws Exception
AepEngine
has been successfully created
and injected into the application. Subclasses may override this method
to do any final initialization prior to the application being started.
Exception
- An application throwing an exception from this method will cause loading of the application to fail.protected void onAppFinalized() throws Exception
AepEngine
has been successfully created
and injected into the application. Subclasses may override this method
to do any final initialization prior to the application being started.
Exception
- An application throwing an exception from this method will cause the app finalization to terminate with an error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |