/** * Figures out the correct class loader to use for a proxy for a given bean */ public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) { Class<?> superClass = typeInfo.getSuperClass(); if (superClass.getName().startsWith(JAVA)) { ClassLoader cl = proxyServices.getClassLoader(proxiedType); if (cl == null) { cl = Thread.currentThread().getContextClassLoader(); } return cl; } return Container.instance(contextId).services().get(ProxyServices.class).getClassLoader(superClass); }
/** * Figures out the correct class loader to use for a proxy for a given bean */ public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) { Class<?> superClass = typeInfo.getSuperClass(); if (superClass.getName().startsWith(JAVA)) { ClassLoader cl = proxyServices.getClassLoader(proxiedType); if (cl == null) { cl = Thread.currentThread().getContextClassLoader(); } return cl; } return Container.instance(contextId).services().get(ProxyServices.class).getClassLoader(superClass); }
/** * Figures out the correct class loader to use for a proxy for a given bean */ public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) { Class<?> superClass = typeInfo.getSuperClass(); if (superClass.getName().startsWith(JAVA)) { ClassLoader cl = proxyServices.getClassLoader(proxiedType); if (cl == null) { cl = Thread.currentThread().getContextClassLoader(); } return cl; } return Container.instance(contextId).services().get(ProxyServices.class).getClassLoader(superClass); }
addInterfacesFromTypeClosure(typeClosure, proxiedBeanType); TypeInfo typeInfo = TypeInfo.of(typeClosure); Class<?> superClass = typeInfo.getSuperClass(); superClass = superClass == null ? Object.class : superClass; if (forceSuperClass || (superClass.equals(Object.class) && additionalInterfaces.isEmpty())) {
addInterfacesFromTypeClosure(typeClosure, proxiedBeanType); TypeInfo typeInfo = TypeInfo.of(typeClosure); Class<?> superClass = typeInfo.getSuperClass(); superClass = superClass == null ? Object.class : superClass; if (forceSuperClass || (superClass.equals(Object.class) && additionalInterfaces.isEmpty())) {
/** * Figures out the correct class loader to use for a proxy for a given bean */ public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) { Class<?> superClass = typeInfo.getSuperClass(); if (superClass.getName().startsWith(JAVA)) { ClassLoader cl = proxyServices.getClassLoader(proxiedType); if (cl == null) { cl = Thread.currentThread().getContextClassLoader(); } return cl; } return Container.instance(contextId).services().get(ProxyServices.class).getClassLoader(superClass); }
/** * Figures out the correct class loader to use for a proxy for a given bean */ public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) { Class<?> superClass = typeInfo.getSuperClass(); if (superClass.getName().startsWith(JAVA)) { ClassLoader cl = proxyServices.getClassLoader(proxiedType); if (cl == null) { cl = Thread.currentThread().getContextClassLoader(); } return cl; } return Container.instance(contextId).services().get(ProxyServices.class).getClassLoader(superClass); }
/** * Figures out the correct class loader to use for a proxy for a given bean */ public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo) { Class<?> superClass = typeInfo.getSuperClass(); if (superClass.getName().startsWith(JAVA)) { ClassLoader cl = Container.instance(contextId).services().get(ProxyServices.class).getClassLoader(proxiedType); if (cl == null) { cl = Thread.currentThread().getContextClassLoader(); } return cl; } return Container.instance(contextId).services().get(ProxyServices.class).getClassLoader(superClass); }
private <T> T createClientProxy(Bean<T> bean, Set<Type> types) { BeanIdentifier id = Container.instance(contextId).services().get(ContextualStore.class).putIfAbsent(bean); if (id == null) { throw BeanLogger.LOG.beanIdCreationFailed(bean); } BeanInstance beanInstance = new ContextBeanInstance<T>(bean, id, contextId); TypeInfo typeInfo = TypeInfo.of(types); T proxy = new ClientProxyFactory<T>(contextId, typeInfo.getSuperClass(), types, bean).create(beanInstance); BeanLogger.LOG.createdNewClientProxyType(proxy.getClass(), bean, id); return proxy; }
private <T> T createClientProxy(Bean<T> bean, Set<Type> types) { BeanIdentifier id = Container.instance(contextId).services().get(ContextualStore.class).putIfAbsent(bean); if (id == null) { throw BeanLogger.LOG.beanIdCreationFailed(bean); } BeanInstance beanInstance = new ContextBeanInstance<T>(bean, id, contextId); TypeInfo typeInfo = TypeInfo.of(types); T proxy = new ClientProxyFactory<T>(contextId, typeInfo.getSuperClass(), types, bean).create(beanInstance); BeanLogger.LOG.createdNewClientProxyType(proxy.getClass(), bean, id); return proxy; }
protected static Class<?> computeInstanceType(Set<Type> types) { TypeInfo typeInfo = TypeInfo.of(types); Class<?> superClass = typeInfo.getSuperClass(); if (superClass.equals(Object.class)) { superClass = typeInfo.getSuperInterface(); } return superClass; } }
protected static Class<?> computeInstanceType(Set<Type> types) { TypeInfo typeInfo = TypeInfo.of(types); Class<?> superClass = typeInfo.getSuperClass(); if (superClass.equals(Object.class)) { superClass = typeInfo.getSuperInterface(); } return superClass; } }
protected static Class<?> computeInstanceType(Set<Type> types) { TypeInfo typeInfo = TypeInfo.of(types); Class<?> superClass = typeInfo.getSuperClass(); if (superClass.equals(Object.class)) { superClass = typeInfo.getSuperInterface(); } return superClass; } }
private <T> T createClientProxy(Bean<T> bean, Set<Type> types) { BeanIdentifier id = Container.instance(contextId).services().get(ContextualStore.class).putIfAbsent(bean); if (id == null) { throw BeanLogger.LOG.beanIdCreationFailed(bean); } BeanInstance beanInstance = new ContextBeanInstance<T>(bean, id, contextId); TypeInfo typeInfo = TypeInfo.of(types); T proxy = new ClientProxyFactory<T>(contextId, typeInfo.getSuperClass(), types, bean).create(beanInstance); BeanLogger.LOG.createdNewClientProxyType(proxy.getClass(), bean, id); return proxy; }
protected static Class<?> computeInstanceType(Set<Type> types) { TypeInfo typeInfo = TypeInfo.of(types); Class<?> superClass = typeInfo.getSuperClass(); if (superClass.equals(Object.class)) { superClass = typeInfo.getSuperInterface(); } return superClass; } }
private <T> T createClientProxy(Bean<T> bean, Set<Type> types) { BeanIdentifier id = Container.instance(contextId).services().get(ContextualStore.class).putIfAbsent(bean); if (id == null) { throw BeanLogger.LOG.beanIdCreationFailed(bean); } BeanInstance beanInstance = new ContextBeanInstance<T>(bean, id, contextId); TypeInfo typeInfo = TypeInfo.of(types); T proxy = new ClientProxyFactory<T>(contextId, typeInfo.getSuperClass(), types, bean).create(beanInstance); BeanLogger.LOG.createdNewClientProxyType(proxy.getClass(), bean, id); return proxy; }
private <T> T createClientProxy(Bean<T> bean, Set<Type> types) { BeanIdentifier id = Container.instance(contextId).services().get(ContextualStore.class).putIfAbsent(bean); if (id == null) { throw BeanLogger.LOG.beanIdCreationFailed(bean); } BeanInstance beanInstance = new ContextBeanInstance<T>(bean, id, contextId); TypeInfo typeInfo = TypeInfo.of(types); T proxy = new ClientProxyFactory<T>(contextId, typeInfo.getSuperClass(), types, bean).create(beanInstance); BeanLogger.LOG.createdNewClientProxyType(proxy.getClass(), bean, id); return proxy; }
protected static Class<?> computeInstanceType(Set<Type> types) { TypeInfo typeInfo = TypeInfo.of(types); Class<?> superClass = typeInfo.getSuperClass(); if (superClass.equals(Object.class)) { superClass = typeInfo.getSuperInterface(); } return superClass; } }
protected static Class<?> computeInstanceType(Set<Type> types) { TypeInfo typeInfo = TypeInfo.of(types); Class<?> superClass = typeInfo.getSuperClass(); if (superClass.equals(Object.class)) { superClass = typeInfo.getSuperInterface(); } return superClass; } }
private <T> T createClientProxy(Bean<T> bean, Set<Type> types) { BeanIdentifier id = Container.instance(contextId).services().get(ContextualStore.class).putIfAbsent(bean); if (id == null) { throw BeanLogger.LOG.beanIdCreationFailed(bean); } BeanInstance beanInstance = new ContextBeanInstance<T>(bean, id, contextId); TypeInfo typeInfo = TypeInfo.of(types); T proxy = new ClientProxyFactory<T>(contextId, typeInfo.getSuperClass(), types, bean).create(beanInstance); BeanLogger.LOG.createdNewClientProxyType(proxy.getClass(), bean, id); return proxy; }