public static Class<?> tryToLoadClassForName(String proxyClassName, Class<?> targetClass) { if (MAGIC_IN_PROGRESS.get()) { return null; } return org.apache.deltaspike.core.util.ClassUtils.tryToLoadClassForName(proxyClassName, targetClass); }
public static void changeAndThrowException(Throwable throwable, String customMessage) { Throwable newThrowable = createNewException(throwable, customMessage); //Attention: helper which allows to use a trick to throw a cached checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(newThrowable); }
/** * Instantiate a new {@link InjectableMethod}. * * @param method the method which will be injected upon a call to * {@link #invoke(Object, CreationalContext)} * @param declaringBean the bean which defines the injectable method * @param beanManager the {@link BeanManager} to use to obtain the parameter values */ public InjectableMethod(AnnotatedMethod<X> method, Bean<?> declaringBean, BeanManager beanManager) { this(method, createInjectionPoints(method, declaringBean, beanManager), beanManager); }
/** * Add info about an Extension to our storage * This method is usually called during boostrap via {@code @Observes BeforeBeanDiscovery}. */ public static synchronized void addExtension(Extension extension) { if (usingParentExtension()) { removeAbandonedExtensions(); ClassLoader classLoader = ClassUtils.getClassLoader(null); extensionStorage.add(new ExtensionStorageInfo(classLoader, extension)); } }
public static boolean isNotEmpty(String text) { return !isEmpty(text); } }
/** * Checks if the given class has a method with the same signature, taking in to account generic types * @param targetClass * @param method * @return if it contains a method with the same signature. */ public static boolean containsPossiblyGenericMethod(Class<?> targetClass, Method method) { return extractPossiblyGenericMethod(targetClass, method) != null; }
/** * Checks if the given class contains a method with the same signature. * * @param targetClass The class to check * @param method The source method * @return if it contains a method with the same signature. */ public static boolean containsMethod(Class<?> targetClass, Method method) { return extractMethod(targetClass, method) != null; }
private static synchronized void lazyInit() { // switch into paranoia mode if (projectStageProducer != null) { return; } projectStageProducer = new ProjectStageProducer(); projectStageProducer.initProjectStage(); }
public Type getResolvedType() { if (type instanceof Class<?>) { Class<?> clazz = (Class<?>) type; return resolveType(clazz); } return type; }
public static RuntimeException throwAsRuntimeException(Throwable throwable) { //Attention: helper which allows to use a trick to throw // a catched checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(throwable); return null; //not needed due to the helper trick, but it's easier for using it }
protected ClassLoader classLoader() { return AggregatedClassLoader.newInstance(); } }
/** * Add info about an Extension to our storage * This method is usually called during boostrap via {@code @Observes BeforeBeanDiscovery}. */ public static synchronized void addExtension(Extension extension) { if (usingParentExtension()) { removeAbandonedExtensions(); ClassLoader classLoader = ClassUtils.getClassLoader(null); extensionStorage.add(new ExtensionStorageInfo(classLoader, extension)); } }
/** * Tries to load a class based on the given name and interface or abstract class. * @param name name of the concrete class * @param targetType target type (interface or abstract class) * @param <T> current type * @return loaded class or null if it isn't in the classpath */ public static <T> Class<T> tryToLoadClassForName(String name, Class<T> targetType) { return (Class<T>) tryToLoadClassForName(name); }
public static boolean isNotEmpty(String text) { return !isEmpty(text); } }
/** * Checks if the given class has a method with the same signature, taking in to account generic types * @param targetClass * @param method * @return if it contains a method with the same signature. */ public static boolean containsPossiblyGenericMethod(Class<?> targetClass, Method method) { return extractPossiblyGenericMethod(targetClass, method) != null; }
public static void changeAndThrowException(Throwable throwable, String customMessage) { Throwable newThrowable = createNewException(throwable, customMessage); //Attention: helper which allows to use a trick to throw a cached checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(newThrowable); }
private static synchronized void lazyInit() { // switch into paranoia mode if (projectStageProducer != null) { return; } projectStageProducer = new ProjectStageProducer(); projectStageProducer.initProjectStage(); }
protected ClassLoader classLoader() { return AggregatedClassLoader.newInstance(); } }
/** * Tries to load a class based on the given name and interface or abstract class. * @param name name of the concrete class * @param targetType target type (interface or abstract class) * @param classLoader The {@link ClassLoader}. * @param <T> current type * @return loaded class or null if it isn't in the classpath */ public static <T> Class<T> tryToLoadClassForName(String name, Class<T> targetType, ClassLoader classLoader) { return (Class<T>) tryToLoadClassForName(name, classLoader); }
public static void changeAndThrowException(Throwable throwable, String customMessage) { Throwable newThrowable = createNewException(throwable, customMessage); //Attention: helper which allows to use a trick to throw a cached checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(newThrowable); }