org.apache.openejb
Class Extensions

java.lang.Object
  extended by org.apache.openejb.Extensions

public final class Extensions
extends Object

The Extensions API mimics the equivalent CDI Extension/@Observes API

Via the Extensions/@Obverves API it is possible to listen for any number of internal events fired by OpenEJB/TomEE during the life of the server and deployment of applications.

Extensions are any java class that have one or more @Observes methods using the following format:

- public void (@Observes event)

Extensions can be registered in any number of ways:

1. Via a META-INF/org.apache.openejb.extension text file containing the name of exactly one 2. Via a tag in the server's openejb.xml or tomee.xml configuration file 3. Via a tag in a META-INF/resources.xml in the application 4. Directly calling SystemInstance#addObserver(Object)

See Also:
ObserverManager, Observes, SystemInstance.fireEvent(Object), SystemInstance.addObserver(Object)

Nested Class Summary
static class Extensions.Finder
           
 
Method Summary
static void addExtensions(ClassLoader loader, Collection<String> classes)
           
static void addExtensions(Collection<Class<?>> classes)
           
static Collection<Class<?>> findExtensions(Extensions.Finder finder)
           
static void installExtensions(Extensions.Finder finder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findExtensions

public static Collection<Class<?>> findExtensions(Extensions.Finder finder)

installExtensions

public static void installExtensions(Extensions.Finder finder)

addExtensions

public static void addExtensions(ClassLoader loader,
                                 Collection<String> classes)

addExtensions

public static void addExtensions(Collection<Class<?>> classes)


Copyright © 1999–2015 The Apache Software Foundation. All rights reserved.