The inject manager isn't adding this class to the registered beans. I
have seen a few issues with Generic classes with matching classes but
this ones seems pretty straight forward.

Does anything anyone know why this isn't picked up and registered in
the inject manager?

@New
public class InjectBeanHelper<T> {

        @Current Manager mgr;
        
        public InjectBeanHelper(){}
        
        @SuppressWarnings("unchecked")
        public T getInstance(String clazz){
                T o = null;
                Class<? extends T> tc = null;
                try {
                        tc = (Class<? extends T>) Class.forName(clazz);
                        o = (T)mgr.getInstanceByType(tc);
                }catch(ClassNotFoundException e){}
                
                if(o==null) o = (T)mgr.getInstanceByName(clazz);
                
                return o;               
        }
        public T getInstance(Class<? extends T> clazz){
                return this.mgr.getInstanceByType(clazz);
        }
}

I'm still working against trunk :)


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to