Search in sources :

Example 1 with ContextListManagedReferenceFactory

use of org.jboss.as.naming.ContextListManagedReferenceFactory in project wildfly by wildfly.

the class AbstractResourceInjectionServices method validateResourceInjectionPointType.

protected void validateResourceInjectionPointType(ManagedReferenceFactory fact, InjectionPoint injectionPoint) {
    if (!(fact instanceof ContextListManagedReferenceFactory) || injectionPoint == null) {
        // validation is skipped as we have no information about the resource type
        return;
    }
    final ContextListManagedReferenceFactory factory = (ContextListManagedReferenceFactory) fact;
    // the resource class may come from JBoss AS
    Class<?> resourceClass = org.jboss.as.weld.util.Reflections.loadClass(factory.getInstanceClassName(), factory.getClass().getClassLoader());
    // or it may come from deployment
    if (resourceClass == null) {
        resourceClass = org.jboss.as.weld.util.Reflections.loadClass(factory.getInstanceClassName(), module.getClassLoader());
    }
    if (resourceClass != null) {
        validateResourceInjectionPointType(resourceClass, injectionPoint);
    }
// otherwise, the validation is skipped as we have no information about the resource type
}
Also used : ContextListManagedReferenceFactory(org.jboss.as.naming.ContextListManagedReferenceFactory)

Aggregations

ContextListManagedReferenceFactory (org.jboss.as.naming.ContextListManagedReferenceFactory)1