KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > injection > EJBContextFieldInjector


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.ejb3.injection;
8
9 import org.jboss.ejb3.BeanContext;
10
11 import java.lang.reflect.Field JavaDoc;
12
13 /**
14  * Comment
15  *
16  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
17  * @version $Revision: 1.1.2.3 $
18  */

19 public class EJBContextFieldInjector implements Injector
20 {
21    private Field JavaDoc field;
22
23    public EJBContextFieldInjector(Field JavaDoc field)
24    {
25       this.field = field;
26    }
27
28    public void inject(BeanContext ctx)
29    {
30
31       try
32       {
33          field.set(ctx.getInstance(), ctx);
34       }
35       catch (IllegalAccessException JavaDoc e)
36       {
37          throw new RuntimeException JavaDoc(e);
38       }
39    }
40 }
41
Popular Tags