Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2010, Red Hat, Inc., and individual contributors
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package javax.enterprise.inject.spi;
 

The event type of the second event fired by the container when it has fully completed the bean discovery process, validated that there are no definition errors relating to the discovered beans, and registered Bean and ObserverMethod objects for the discovered beans, but before detecting deployment problems.

A portable extension may take advantage of this event to register beans, interceptors, decorators, observer methods and custom context objects with the container.

     void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager manager) { ... }
 

If any observer method of the AfterBeanDiscovery event throws an exception, the exception is treated as a definition error by the container.

Author(s):
David Allen
 
 public interface AfterBeanDiscovery {
    
Registers a definition error with the container, causing the container to abort deployment after all observers have been notified.

Parameters:
t The definition error as a java.lang.Throwable
Throws:
java.lang.IllegalStateException if called outside of the observer method invocation
 
     public void addDefinitionError(Throwable t);

    
Fires an event of type ProcessBean containing the given Bean and then registers the Bean with the container, thereby making it available for injection into other beans. The given Bean may implement Interceptor or javax.decorator.Decorator.

Parameters:
bean The bean to add to the deployment
Throws:
java.lang.IllegalStateException if called outside of the observer method invocation
 
     public void addBean(Bean<?> bean);

    
Fires an event of type ProcessObserverMethod containing the given ObserverMethod and then registers the ObserverMethod with the container, thereby making it available for event notifications.

Parameters:
observerMethod The custom observer method to add to the deployment
Throws:
java.lang.IllegalStateException if called outside of the observer method invocation
 
     public void addObserverMethod(ObserverMethod<?> observerMethod);

    
Registers a custom javax.enterprise.context.spi.Context object with the container.

Parameters:
context The custom context to add to the deployment
Throws:
java.lang.IllegalStateException if called outside of the observer method invocation
 
     public void addContext(Context context);

    
Obtain the AnnotatedType that may be used to read the annotations of the given class or interface as defined during container initialization.

Parameters:
<T> the class or interface
type the java.lang.Class object
id the type identifier. If null, the fully qualifier class name of type is used
Returns:
the AnnotatedType
Throws:
java.lang.IllegalStateException if called outside of the observer method invocation
Since:
1.1
 
     public <T> AnnotatedType<T> getAnnotatedType(Class<T> typeString id);

    
Obtain the AnnotatedTypes that may be used to read the annotations of the given class or interface as defined during container initialization.

Parameters:
<T> the class or interface
type the java.lang.Class object
Returns:
the AnnotatedTypes
Throws:
java.lang.IllegalStateException if called outside of the observer method invocation
Since:
1.1
    public <T> Iterable<AnnotatedType<T>> getAnnotatedTypes(Class<T> type);
New to GrepCode? Check out our FAQ X