All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.factories.scopes.ScopeDetector Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.factories.scopes;

import org.infinispan.commons.util.ReflectionUtil;

/**
 * Retrieves the declared scope of a component
 *
 * @author Manik Surtani
 * @since 4.0
 */
public class ScopeDetector {
   public static Scopes detectScope(Class clazz) {
      Scope s = ReflectionUtil.getAnnotation(clazz, Scope.class);
      if (s == null)
         return Scopes.getDefaultScope();
      else
         return s.value();
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy