myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: @Singleton @Lock(READ) to resolve, Could not instantiate converter ...
Date Sat, 13 Apr 2013 18:05:13 GMT
Yes, that's how I linked my database layer to my converters in JSF 1.x
-- using the Java
API to pull the database beans out of the JSF context.

On Sat, Apr 13, 2013 at 1:04 PM, Howard W. Smith, Jr.
<smithh032772@gmail.com> wrote:
> On Sat, Apr 13, 2013 at 1:00 PM, José Luis Cetina <maxtorzito@gmail.com>wrote:
>
>> When i dont want to use codi I use jndi lookup, it is to easy to use and
>> portable. I create a simple method for retrive my ejbs without using codi
>> instead i use jndi using only the name of the ejb class.
>>
>
> Recently, I added the following after listening in on that other/earlier
> topic/thread on myfaces or openejb list. The code below allowed me to
> remove CODI dependency. :)
>
>     /*
>      *
> http://docs.oracle.com/javaee/6/api/javax/enterprise/inject/spi/BeanManager.html
>      * http://struberg.wordpress.com/2012/03/20/why-is-openwebbeans-so-fast/
>      */
>     @SuppressWarnings("unchecked")
>     public <T> T getBean(Class<T> type) {
>         Bean<T> bean = (Bean<T>)
> beanManager.resolve(beanManager.getBeans(type));
>         CreationalContext<T>  creationalContext =
>                               beanManager.createCreationalContext(bean);
>
>         return (T) beanManager.getReference(bean, type, creationalContext);
>     }

Mime
View raw message