@Override public Injectee apply(CacheKey cacheKey) { Injectee injectee = cacheKey.getInjectee(); if (injectee.getParent() != null) { if (Field.class.isAssignableFrom(injectee.getParent().getClass())) { Field f = (Field) injectee.getParent(); if (foreignRequestScopedComponents.get().contains(f.getDeclaringClass())) { final Class<?> clazz = f.getType(); if (serviceLocator.getServiceHandle(clazz).getActiveDescriptor().getScopeAnnotation() == RequestScoped.class) { final AbstractActiveDescriptor<Object> descriptor = BuilderHelper.activeLink(clazz) .to(clazz) .in(RequestScoped.class) .build(); return new DescriptorOverridingInjectee(injectee, descriptor); } } } } return injectee; } });
@Override public Injectee apply(CacheKey cacheKey) { Injectee injectee = cacheKey.getInjectee(); if (injectee.getParent() != null) { if (Field.class.isAssignableFrom(injectee.getParent().getClass())) { Field f = (Field) injectee.getParent(); if (foreignRequestScopedComponents.get().contains(f.getDeclaringClass())) { final Class<?> clazz = f.getType(); if (serviceLocator.getServiceHandle(clazz).getActiveDescriptor().getScopeAnnotation() == RequestScoped.class) { final AbstractActiveDescriptor<Object> descriptor = BuilderHelper.activeLink(clazz) .to(clazz) .in(RequestScoped.class) .build(); return new DescriptorOverridingInjectee(injectee, descriptor); } } } } return injectee; } });
@Override public Class<? extends Annotation> getScope() { Class<? extends Annotation> scope = descriptor.getScopeAnnotation(); if (scope == null || scope.equals(PerLookup.class)) { scope = Dependent.class; } return scope; }
@Override public Class<? extends Annotation> getScopeAnnotation() { checkState(); if (activeDescriptor != null) { return activeDescriptor.getScopeAnnotation(); } return scope; }
@Override public Class<? extends Annotation> getScopeAnnotation() { checkState(); if (activeDescriptor != null) { return activeDescriptor.getScopeAnnotation(); } return scope; }
@Override public Class<? extends Annotation> getScopeAnnotation() { checkState(); if (activeDescriptor != null) { return activeDescriptor.getScopeAnnotation(); } return scope; }
@Override public Class<? extends Annotation> getScopeAnnotation() { checkState(); if (activeDescriptor != null) { return activeDescriptor.getScopeAnnotation(); } return scope; }
@Override public Class<? extends Annotation> getScopeAnnotation() { ensureInitialized(); return descriptor.getScopeAnnotation(); }
@Override public Class<? extends Annotation> getScopeAnnotation() { ensureInitialized(); return descriptor.getScopeAnnotation(); }
@Override public Class<? extends Annotation> getScopeAnnotation() { ensureInitialized(); return descriptor.getScopeAnnotation(); }
@Override public Class<? extends Annotation> getScopeAnnotation() { ensureInitialized(); return descriptor.getScopeAnnotation(); }
@Override public boolean isActive() { // No lock needed, nothing changes state if (serviceDestroyed) return false; if (serviceSet) return true; try { Context<?> context = locator.resolveContext(root.getScopeAnnotation()); return context.containsKey(root); } catch (IllegalStateException ise) { return false; } }
@Override public boolean isActive() { // No lock needed, nothing changes state if (serviceDestroyed) return false; if (serviceSet) return true; try { Context<?> context = locator.resolveContext(root.getScopeAnnotation()); return context.containsKey(root); } catch (IllegalStateException ise) { return false; } }
@Override public boolean isActive() { // No lock needed, nothing changes state if (serviceDestroyed) return false; if (serviceSet) return true; try { Context<?> context = locator.resolveContext(root.getScopeAnnotation()); return context.containsKey(root); } catch (IllegalStateException ise) { return false; } }
@Override public boolean isActive() { // No lock needed, nothing changes state if (serviceDestroyed) return false; if (serviceSet) return true; try { Context<?> context = locator.resolveContext(root.getScopeAnnotation()); return context.containsKey(root); } catch (IllegalStateException ise) { return false; } }
private static void checkReifiedDescriptor(ActiveDescriptor<?> d) { if (d.isProxiable() == null) return; if (!d.isProxiable()) return; // Now check to see if the scope is unproxiable if (Utilities.isUnproxiableScope(d.getScopeAnnotation())) throw new IllegalArgumentException(); }
private static void checkReifiedDescriptor(ActiveDescriptor<?> d) { if (d.isProxiable() == null) return; if (!d.isProxiable()) return; // Now check to see if the scope is unproxiable if (Utilities.isUnproxiableScope(d.getScopeAnnotation())) throw new IllegalArgumentException(); }
private static void checkReifiedDescriptor(ActiveDescriptor<?> d) { if (d.isProxiable() == null) return; if (!d.isProxiable()) return; // Now check to see if the scope is unproxiable if (Utilities.isUnproxiableScope(d.getScopeAnnotation())) throw new IllegalArgumentException(); }
private static void checkReifiedDescriptor(ActiveDescriptor<?> d) { if (d.isProxiable() == null) return; if (!d.isProxiable()) return; // Now check to see if the scope is unproxiable if (Utilities.isUnproxiableScope(d.getScopeAnnotation())) throw new IllegalArgumentException(); }
private Object internalInvoke(Object target, Method method, Method proceed, Object[] params) throws Throwable { Context<?> context; Object service; context = locator.resolveContext(descriptor.getScopeAnnotation()); service = context.findOrCreate(descriptor, root); if (service == null) { throw new MultiException(new IllegalStateException("Proxiable context " + context + " findOrCreate returned a null for descriptor " + descriptor + " and handle " + root)); } if (method.getName().equals(PROXY_MORE_METHOD_NAME)) { // We did what we came here to do return service; } if (isEquals(method) && (params.length == 1) && (params[0] != null) && (params[0] instanceof ProxyCtl)) { ProxyCtl equalsProxy = (ProxyCtl) params[0]; params = new Object[1]; params[0] = equalsProxy.__make(); } return ReflectionHelper.invoke(service, method, params, locator.getNeutralContextClassLoader()); }