public static Class<?> getRealClassFromClass(Class<?> cls) { return getRealClassFromClass(null, cls); }
public static Class<?> getRealClassFromClass(Class<?> cls) { return getRealClassFromClass(null, cls); }
public static Class<?> getRawResponseClass(Object targetObject) { if (targetObject != null) { Class<?> targetClass = targetObject.getClass(); return ClassHelper.getRealClassFromClass(targetClass); } return null; }
public static Class<?> getRawResponseClass(Object targetObject) { if (targetObject != null) { Class<?> targetClass = targetObject.getClass(); return ClassHelper.getRealClassFromClass(targetClass); } else { return null; } }
protected boolean nonProxyClass(String beanName) { // JAX-RS runtime needs to be able to access the real component class to introspect it for // JAX-RS annotations; the following check ensures that the valid proxified components // are accepted while the client proxies are ignored. Class<?> type = ClassHelper.getRealClassFromClass(applicationContext.getType(beanName)); if (Proxy.isProxyClass(type) && applicationContext.isSingleton(beanName)) { type = ClassHelper.getRealClass(applicationContext.getBean(beanName)); } if (Proxy.isProxyClass(type)) { LOG.fine("Can not determine the real class of the component '" + beanName + "'"); return false; } return true; } protected boolean matchesComponentName(String beanName, Set<String> componentScanBeansSet) {
private void init() { Class<?> type = ClassHelper.getRealClassFromClass(ac.getType(beanId)); if (Proxy.isProxyClass(type)) { type = ClassHelper.getRealClass(ac.getBean(beanId)); } c = ResourceUtils.findResourceConstructor(type, !isSingleton()); if (c == null) { throw new RuntimeException("Resource class " + type + " has no valid constructor"); } postConstructMethod = ResourceUtils.findPostConstructMethod(type, postConstructMethodName); preDestroyMethod = ResourceUtils.findPreDestroyMethod(type, preDestroyMethodName); isSingleton = ac.isSingleton(beanId); if (!isSingleton) { isPrototype = ac.isPrototype(beanId); } }
private void init() { type = ClassHelper.getRealClassFromClass(ac.getType(beanId)); if (Proxy.isProxyClass(type)) { type = ClassHelper.getRealClass(ac.getBean(beanId)); } isSingleton = ac.isSingleton(beanId); postConstructMethod = ResourceUtils.findPostConstructMethod(type, postConstructMethodName); preDestroyMethod = ResourceUtils.findPreDestroyMethod(type, preDestroyMethodName); if (isSingleton()) { try { singletonInstance = ac.getBean(beanId); } catch (BeansException ex) { // ignore for now, try resolving resource constructor later } if (singletonInstance != null) { return; } } else { isPrototype = ac.isPrototype(beanId); } c = ResourceUtils.findResourceConstructor(type, !isSingleton()); if (c == null) { throw new RuntimeException("Resource class " + type + " has no valid constructor"); } }
private void init() { Class<?> type = ClassHelper.getRealClassFromClass(blueprintContainer.getComponentInstance(beanId) .getClass()); if (Proxy.isProxyClass(type)) { type = ClassHelper.getRealClass(blueprintContainer.getComponentInstance(beanId)); } c = ResourceUtils.findResourceConstructor(type, !isSingleton()); if (c == null) { throw new RuntimeException("Resource class " + type + " has no valid constructor"); } postConstructMethod = ResourceUtils.findPostConstructMethod(type); preDestroyMethod = ResourceUtils.findPreDestroyMethod(type); Object component = blueprintContainer.getComponentMetadata(beanId); if (component instanceof BeanMetadata) { BeanMetadata local = (BeanMetadata) component; isSingleton = BeanMetadata.SCOPE_SINGLETON.equals(local.getScope()) || (local.getScope() == null && local.getId() != null); } }
private void init() { Class<?> type = ClassHelper.getRealClassFromClass(blueprintContainer.getComponentInstance(beanId) .getClass()); if (Proxy.isProxyClass(type)) { type = ClassHelper.getRealClass(blueprintContainer.getComponentInstance(beanId)); } c = ResourceUtils.findResourceConstructor(type, !isSingleton()); if (c == null) { throw new RuntimeException("Resource class " + type + " has no valid constructor"); } postConstructMethod = ResourceUtils.findPostConstructMethod(type); preDestroyMethod = ResourceUtils.findPreDestroyMethod(type); Object component = blueprintContainer.getComponentMetadata(beanId); if (component instanceof BeanMetadata) { BeanMetadata local = (BeanMetadata) component; isSingleton = BeanMetadata.SCOPE_SINGLETON.equals(local.getScope()) || (local.getScope() == null && local.getId() != null); } }