public class Configuration
extends java.lang.Object
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.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 strings (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.
org.apache.felix.eventadmin.IgnoreTopic - Configure topics to be ignore and not delivered to registered handlers.
For performance optimization it is possible to configure topics which are ignored by the event admin implementation. In this case, a event is not delivered to registered event handlers.
The value is a list of strings (separated by comma). If a single value ends with a dot, all topics in exactly this package are ignored. If a single value ends with a star, all topics in this package and all sub packages are ignored. If a single value neither ends with a dot nor with a start, this is assumed to define an exact topic. A single star can be used to disable delivery completely.
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 and Description |
---|
Configuration(org.osgi.framework.BundleContext bundleContext) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called upon stopping the bundle.
|
public Configuration(org.osgi.framework.BundleContext bundleContext)
public void destroy()
Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.