Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.component » [javadoc | source]

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements. See the NOTICE file distributed with this
    4    * work for additional information regarding copyright ownership. The ASF
    5    * licenses this file to You under the Apache License, Version 2.0 (the
    6    * "License"); you may not use this file except in compliance with the License.
    7    * You may obtain a copy of the License at
    8    * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
    9    * or agreed to in writing, software distributed under the License is
   10    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   11    * KIND, either express or implied. See the License for the specific language
   12    * governing permissions and limitations under the License.
   13    */
   14   package org.apache.webbeans.component;
   15   
   16   import java.lang.reflect.Method;
   17   import java.util.Set;
   18   
   19   import javax.enterprise.context.spi.CreationalContext;
   20   
   21   /**
   22    * Defines contract for beans that coud have observable
   23    * method.
   24    * 
   25    * @version $Rev: 794377 $ $Date: 2009-07-15 22:40:48 +0300 (Wed, 15 Jul 2009) $
   26    *
   27    * @param <T> bean type
   28    */
   29   public interface InjectionTargetBean<T>
   30   {
   31       /**
   32        * Returns set of observable methods.
   33        * 
   34        * @return set of observable methods
   35        */
   36       public Set<Method> getObservableMethods();
   37   
   38       /**
   39        * Adds new observer method.
   40        * 
   41        * @param observerMethod observer method
   42        */
   43       public void addObservableMethod(Method observerMethod);
   44       
   45       /**
   46        * Inject JavaEE resources.
   47        * 
   48        * @param instance bean instance
   49        * @param creationalContext creational context
   50        */
   51       public void injectResources(T instance, CreationalContext<T> creationalContext);
   52       
   53       /**
   54        * Inject fields of the bean instance.
   55        * 
   56        * @param instance bean instance
   57        * @param creationalContext creational context
   58        */
   59       public void injectFields(T instance, CreationalContext<T> creationalContext);
   60       
   61       /**
   62        * Inject initializer methods of the bean instance.
   63        * 
   64        * @param instance bean instance
   65        * @param creationalContext creational context
   66        */
   67       public void injectMethods(T instance, CreationalContext<T> creationalContext);
   68       
   69       /**
   70        * Calls post constrcut method.
   71        * 
   72        * @param instance bean instance
   73        */
   74       public void postConstruct(T instance);
   75       
   76       /**
   77        * Calls predestroy method.
   78        * 
   79        * @param instance bean instance
   80        */
   81       public void preDestroy(T instance);
   82           
   83       
   84       /**
   85        * Returns true if coming from <pre>@Realization</pre>.
   86        * 
   87        * @return true if coming from <pre>@Realization</pre>
   88        */
   89       @Deprecated //Removed from specification
   90       public boolean isFromRealizes();
   91       
   92       /**
   93        * Set its realized.
   94        * 
   95        * @param realized is realized
   96        */
   97       @Deprecated //Removed from specification
   98       public void setFromRealizes(boolean realized);
   99   }

Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.component » [javadoc | source]