public interface EventHandlersConfiguration extends FabricEventSink
Title: Open Service Framework
Description: This interface defines a way to configure Service Event Handlers
in
the Event Handler Registry
.
An Event Handler
is a method defined on a particular class that conforms to a specific set of rules regarding its
signature, return value types and exception handling. If a given Service implementation class has configured one or more such
methods as event handlers their definitions are entered into the Service Configuration Object
and loaded into the
service's run-time registry during service execution. Further configuration details may be found in EventHandler
.
A Service instance is executed in a Service Hosting Container
. The container communicates with the Service by
creating and passing an instance of the ServiceContext
to the Service at the time when it is loaded.
A given context implementation will inspect the Service's InvokeMode
by calling the
ConfigurationObject.getInvokeMode()
method. Once the mode is established the context
constructs an appropriate instance of the dispatcher capable of using the correct method invoking strategy.
An Event Handler
method is invoked by a run-time delegate constructed by using the Java Reflection API
. All
configuration and validation likewise occurs by using reflection and probing the Service for well formed methods with correct signatures.
This approach has the advantage of not being dependent on vendor specific interfaces and allows the same introspection techniques to
easily incorporate arbitrary Java Beans
into the framework. The Invoke Delegate
serves as a proxy mechanism representing a given Event Handler
. Handlers are assembled into a Map and used by the
dispatcher instance to perform all method calls and exception handling.
Copyright: Copyright (c) 2009
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
void |
addEventHandler(EventHandler evh)
Add an
Event Handler method to the service configuration. |
boolean |
existsEventHandler(java.lang.String evhMethodName)
Returns
true if an Event Handler with a given method name is
registered with this service. |
EventHandler |
getEventHandler(java.lang.String evhMethodName)
Retuns the
Event Handler with a specified name. |
java.util.List |
getEventHandlers()
Returns all registered
Event Handler instances for this service. |
boolean |
hasEventHandlers()
Returns
true if any Event Handler methods are registered for this service. |
java.util.List |
listEventHandlers()
Retuns all the
Event Handler names for this service. |
void |
removeAllEventHandlers()
Removes all registered
Event Handler instances for this service. |
void |
removeEventHandler(java.lang.String evhMethodName)
Remove an
Event Handler method from the service configuration. |
hasSinkEvents, listSinkEvents
void addEventHandler(EventHandler evh) throws ServiceConfigurationException
Event Handler
method to the service configuration. Multiple calls to add a handler with the same method
name will result in overlaying the previous handler with the same name. Currently only one handler may be specified for a
given method regardless of the methods signature. Multiple definitions of the same method are not supported.evh
- EventHandler Event handler definition.ServiceConfigurationException
void removeEventHandler(java.lang.String evhMethodName) throws ServiceConfigurationException
Event Handler
method from the service configuration. Attempting to remove a handler that does
not exist will result in no action and no exception.evhMethodName
- String The name of the method associated with the handler.ServiceConfigurationException
EventHandler getEventHandler(java.lang.String evhMethodName) throws ServiceConfigurationException
Event Handler
with a specified name.evhMethodName
- String The name of the method associated with the handler.ServiceConfigurationException
java.util.List getEventHandlers()
Event Handler
instances for this service.java.util.List listEventHandlers()
Event Handler
names for this service.void removeAllEventHandlers()
Event Handler
instances for this service.boolean hasEventHandlers()
true
if any Event Handler
methods are registered for this service.boolean existsEventHandler(java.lang.String evhMethodName)
true
if an Event Handler
with a given method name is
registered with this service.evhMethodName
- StringCopyright © 2015-2024 StreamScape Technologies. All rights reserved.