You must be logged in to do that
Last updated July 21, 2011 14:26, by wigforss
Feedicon  

Ka-Event

ka-event is a simple annotation-driven event-listener Framework for Java 1.5+, with Spring and Guice Support. Ka-Event is based on the concepts of elf but modernized to fit in a Java 1.5+ / Spring environment. Annotations and Generics is used to configure events minimizing the configuration effort for Java Developer.

Both XML and programmatically configuration are supported.

For a quick start have a look at the basic configuration.

Modules

Motivation

Using the standard listener pattern which comes with many of the core Java API classes, where every class handles its own listener registries and are responsible for invoking the listener method on the listeners might not be the best solution in many situations.

Take a look at a small example with 4 objects.

Some cons with this approach may be:

  • Listener registry code duplicated
  • Listener invocation code duplicated
  • Object will be tightly coupled.
  • The over all object graph might be hard to manage when hundred or thousands of objects is interconnected in a gigantic web.
  • Invocation is usually synchronous.

By centralizing this into one Event Dispatcher singleton object. Most of these issues can be handled.

By introducing channels, objects needs to be aware of the event dispatcher and a channel name and nothing else.

Some pros with this approach

  • Centralized registries and invocation code.
  • Run-time choice of synchronous or asynchronous invocation.
  • Loose coupling possible through channels.
  • Easy to manage, one object to inspect the Event Dispatcher.
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close