org.apache.felix.eventadmin.impl
Class Configuration

java.lang.Object
  extended by org.apache.felix.eventadmin.impl.Configuration

public class Configuration
extends Object

The Configuration class encapsules the configuration for the event admin. The service knows about the following properties which are read at bundle startup:

org.apache.felix.eventadmin.CacheSize - The size of various internal caches.

The default value is 30. Increase in case of a large number (more then 100) of EventHandler services. A value less then 10 triggers the default value.

org.apache.felix.eventadmin.ThreadPoolSize - The size of the thread pool.

The default value is 10. Increase in case of a large amount of synchronous events where the EventHandler services in turn send new synchronous events in the event dispatching thread or a lot of timeouts are to be expected. A value of less then 2 triggers the default value. A value of 2 effectively disables thread pooling.

org.apache.felix.eventadmin.Timeout - The black-listing timeout in milliseconds

The default value is 5000. Increase or decrease at own discretion. A value of less then 100 turns timeouts off. Any other value is the time in milliseconds granted to each EventHandler before it gets blacklisted.

org.apache.felix.eventadmin.RequireTopic - Are EventHandler required to be registered with a topic?

The default is true. The specification says that EventHandler must register with a list of topics they are interested in. Setting this value to false will enable that handlers without a topic are receiving all events (i.e., they are treated the same as with a topic=*).

org.apache.felix.eventadmin.IgnoreTimeout - Configure EventHandlers to be called without a timeout.

If a timeout is configured by default all event handlers are called using the timeout. For performance optimization it is possible to configure event handlers where the timeout handling is not used - this reduces the thread usage from the thread pools as the timout handling requires an additional thread to call the event handler. However, the application should work without this configuration property. It is a pure optimization! The value is a list of string (separated by comma). If the string ends with a dot, all handlers in exactly this package are ignored. If the string ends with a star, all handlers in this package and all subpackages are ignored. If the string neither ends with a dot nor with a start, this is assumed to define an exact class name. These properties are read at startup and serve as a default configuration. If a configuration admin is configured, the event admin can be configured through the config admin.


Constructor Summary
Configuration(BundleContext bundleContext)
           
 
Method Summary
 void destroy()
          Called upon stopping the bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration(BundleContext bundleContext)
Method Detail

destroy

public void destroy()
Called upon stopping the bundle. This will block until all pending events are delivered. An IllegalStateException will be thrown on new events starting with the begin of this method. However, it might take some time until we settle down which is somewhat cumbersome given that the spec asks for return in a timely manner.



Copyright © 2013 The Apache Software Foundation. All Rights Reserved.