[weld-dev] Offering beans post container initialization?

Dan Allen dan.j.allen at gmail.com
Wed Mar 9 15:18:13 EST 2011


Also forgot to attach the code snippet:

  protected void injectNonContextualInstance(BeanManager manager, Object
instance)
   {
      CreationalContext<Object> creationalContext =
 manager.createCreationalContext(null);
      InjectionTarget<Object> injectionTarget = (InjectionTarget<Object>)
manager.createInjectionTarget(
            manager.createAnnotatedType(instance.getClass()));
      injectionTarget.inject(instance, creationalContext);
   }

-Dan

On Wed, Mar 9, 2011 at 15:15, Dan Allen <dan.j.allen at gmail.com> wrote:

> On Wed, Mar 9, 2011 at 15:14, Dan Allen <dan.j.allen at gmail.com> wrote:
>
>> Yes. What you want to accomplish is called "injecting into a
>> non-contextual instance", or in other words "injecting into a non-bean
>> instance". The object is an injection target.
>>
>> I meant: in other words, "injecting into a non-managed instance".
>
> --
> Dan Allen
> Principal Software Engineer, Red Hat | Author of Seam in Action
> Registered Linux User #231597
>
> http://www.google.com/profiles/dan.j.allen#about
> http://mojavelinux.com
> http://mojavelinux.com/seaminaction
>
>


-- 
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://www.google.com/profiles/dan.j.allen#about
http://mojavelinux.com
http://mojavelinux.com/seaminaction
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20110309/a557f53c/attachment.html 


More information about the weld-dev mailing list