org.jboss.solder.exception.control.extension
Class CatchExtension

java.lang.Object
  extended by org.jboss.solder.exception.control.extension.CatchExtension
All Implemented Interfaces:
javax.enterprise.inject.spi.Extension, org.jboss.solder.exception.control.HandlerMethodContainer

public class CatchExtension
extends Object
implements javax.enterprise.inject.spi.Extension, org.jboss.solder.exception.control.HandlerMethodContainer

CDI extension to find handlers at startup.


Constructor Summary
CatchExtension()
           
 
Method Summary
<T> void
findHandlers(javax.enterprise.inject.spi.ProcessBean<?> pmb, javax.enterprise.inject.spi.BeanManager bm)
          Listener to ProcessBean event to locate handlers.
 Collection<org.jboss.solder.exception.control.HandlerMethod<? extends Throwable>> getHandlersForExceptionType(Type exceptionClass, javax.enterprise.inject.spi.BeanManager bm, Set<Annotation> handlerQualifiers, org.jboss.solder.exception.control.TraversalMode traversalMode)
          Obtains the applicable handlers for the given type or super type of the given type.
<T extends Throwable>
void
registerHandlerMethod(org.jboss.solder.exception.control.HandlerMethod<T> handlerMethod)
           
 void verifyInjectionPoints(javax.enterprise.inject.spi.AfterDeploymentValidation adv, javax.enterprise.inject.spi.BeanManager bm)
          Verifies all injection points for every handler are valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatchExtension

public CatchExtension()
Method Detail

findHandlers

public <T> void findHandlers(@Observes
                             javax.enterprise.inject.spi.ProcessBean<?> pmb,
                             javax.enterprise.inject.spi.BeanManager bm)
Listener to ProcessBean event to locate handlers.

Parameters:
pmb - Event from CDI SPI
bm - Activated Bean Manager
Throws:
TypeNotPresentException - if any of the actual type arguments refers to a non-existent type declaration when trying to obtain the actual type arguments from a ParameterizedType
MalformedParameterizedTypeException - if any of the actual type parameters refer to a parameterized type that cannot be instantiated for any reason when trying to obtain the actual type arguments from a ParameterizedType

verifyInjectionPoints

public void verifyInjectionPoints(@Observes
                                  javax.enterprise.inject.spi.AfterDeploymentValidation adv,
                                  javax.enterprise.inject.spi.BeanManager bm)
Verifies all injection points for every handler are valid.

Parameters:
adv - Lifecycle event
bm - BeanManager instance

getHandlersForExceptionType

public Collection<org.jboss.solder.exception.control.HandlerMethod<? extends Throwable>> getHandlersForExceptionType(Type exceptionClass,
                                                                                                                     javax.enterprise.inject.spi.BeanManager bm,
                                                                                                                     Set<Annotation> handlerQualifiers,
                                                                                                                     org.jboss.solder.exception.control.TraversalMode traversalMode)
Obtains the applicable handlers for the given type or super type of the given type. Also makes use of ExceptionHandlerComparator to order the handlers.

Parameters:
exceptionClass - Type of exception to narrow handler list
bm - active BeanManager
handlerQualifiers - additional handlerQualifiers to limit handlers
traversalMode - traversal limiter
Returns:
An order collection of handlers for the given type.

registerHandlerMethod

public <T extends Throwable> void registerHandlerMethod(org.jboss.solder.exception.control.HandlerMethod<T> handlerMethod)
Specified by:
registerHandlerMethod in interface org.jboss.solder.exception.control.HandlerMethodContainer


Copyright © 2008-2011 Seam Framework. All Rights Reserved.