Package org.apache.bsf.util.event
Class EventAdapterRegistry
- java.lang.Object
-
- org.apache.bsf.util.event.EventAdapterRegistry
-
public class EventAdapterRegistry extends java.lang.ObjectThe EventAdapterRegistry is the registry of event adapters. If a desired adapter is not found, the adapter will be dynamically generated when lookup is attempted. Set thedynamicproperty tofalseto disable this feature.This implementation first looks for an adapter in its lookup table and if it doesn't find one looks for a standard implementation of that adapter in the org.apache.bsf.util.event.adapters package with a standard naming convention. The naming convention it assumes is the following: for event listener type a.b.c.FooListener, it loads an adapter of type org.apache.bsf.util.event.adapters.a_b_c_FooAdapter. If both the loading and the dynamic generation fail, then a
nullis returned.- Author:
- Sanjiva Weerawarana, Matthew J. Duftler
- See Also:
EventAdapter
-
-
Constructor Summary
Constructors Constructor Description EventAdapterRegistry()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Classlookup(java.lang.Class listenerType)static voidregister(java.lang.Class listenerType, java.lang.Class eventAdapterClass)static voidsetClassLoader(java.lang.ClassLoader cloader)Class loader to use to load event adapter classes.static voidsetDynamic(boolean dynamic)Indicates whether or not to dynamically generate adapters; default istrue.
-
-
-
Method Detail
-
lookup
public static java.lang.Class lookup(java.lang.Class listenerType)
-
register
public static void register(java.lang.Class listenerType, java.lang.Class eventAdapterClass)
-
setClassLoader
public static void setClassLoader(java.lang.ClassLoader cloader)
Class loader to use to load event adapter classes.
-
setDynamic
public static void setDynamic(boolean dynamic)
Indicates whether or not to dynamically generate adapters; default istrue.If the
dynamicproperty is set to true, and theClassLoaderis unable to resolve an adapter, one will be dynamically generated.- Parameters:
dynamic- whether or not to dynamically generate adapters.
-
-