@SuppressWarnings("unchecked")
    public static <T> T newInstance(String name, Class<?> objectType) {
        return (T) Proxy.newProxyInstance(
                ClassLoaderUtils.getClassLoader(),
                new Class[]{objectType},
                new LazyJndiResolver(name));
    }
@ SuppressWarnings ( "unchecked" ) public static < T > T newInstance ( String name , Class < ? > objectType ) { return ( T ) Proxy . newProxyInstance ( ClassLoaderUtils . getClassLoader ( ) , new Class [ ] { objectType } , new LazyJndiResolver ( name ) ) ; }
Creates a new Proxy instance

@param name       JNDI name of the object to be lazily looked up
@param objectType object type
@param <T>        typed parameter
@return Proxy object