private void methodMe(Map<SystemInjecteeImpl, Object> resolved, T t) throws Throwable { for (ResolutionInfo ri : myInitializers) { Method m = (Method) ri.baseElement; List<SystemInjecteeImpl> injectees = ri.injectees; Object args[] = new Object[injectees.size()]; for (Injectee injectee : injectees) { args[injectee.getPosition()] = resolved.get(injectee); } ReflectionHelper.invoke(t, m, args, locator.getNeutralContextClassLoader()); } }
private void methodMe(Map<SystemInjecteeImpl, Object> resolved, T t) throws Throwable { for (ResolutionInfo ri : myInitializers) { Method m = (Method) ri.baseElement; List<SystemInjecteeImpl> injectees = ri.injectees; Object args[] = new Object[injectees.size()]; for (Injectee injectee : injectees) { args[injectee.getPosition()] = resolved.get(injectee); } ReflectionHelper.invoke(t, m, args, locator.getNeutralContextClassLoader()); } }
private void methodMe(Map<SystemInjecteeImpl, Object> resolved, T t) throws Throwable { for (ResolutionInfo ri : myInitializers) { Method m = (Method) ri.baseElement; List<SystemInjecteeImpl> injectees = ri.injectees; Object args[] = new Object[injectees.size()]; for (Injectee injectee : injectees) { args[injectee.getPosition()] = resolved.get(injectee); } ReflectionHelper.invoke(t, m, args, locator.getNeutralContextClassLoader()); } }
private void methodMe(Map<SystemInjecteeImpl, Object> resolved, T t) throws Throwable { for (ResolutionInfo ri : myInitializers) { Method m = (Method) ri.baseElement; List<SystemInjecteeImpl> injectees = ri.injectees; Object args[] = new Object[injectees.size()]; for (Injectee injectee : injectees) { args[injectee.getPosition()] = resolved.get(injectee); } ReflectionHelper.invoke(t, m, args, locator.getNeutralContextClassLoader()); } }
private void postConstructMe(T t) throws Throwable { if (t == null) return; if (t instanceof PostConstruct) { ((PostConstruct) t).postConstruct(); return; } if (postConstructMethod == null) return; ReflectionHelper.invoke(t, postConstructMethod, new Object[0], locator.getNeutralContextClassLoader()); }
private void preDestroyMe(T t) throws Throwable { if (t == null) return; if (t instanceof PreDestroy) { ((PreDestroy) t).preDestroy(); return; } if (preDestroyMethod == null) return; ReflectionHelper.invoke(t, preDestroyMethod, new Object[0], locator.getNeutralContextClassLoader()); }
private void postConstructMe(T t) throws Throwable { if (t == null) return; if (t instanceof PostConstruct) { ((PostConstruct) t).postConstruct(); return; } if (postConstructMethod == null) return; ReflectionHelper.invoke(t, postConstructMethod, new Object[0], locator.getNeutralContextClassLoader()); }
private void postConstructMe(T t) throws Throwable { if (t == null) return; if (t instanceof PostConstruct) { ((PostConstruct) t).postConstruct(); return; } if (postConstructMethod == null) return; ReflectionHelper.invoke(t, postConstructMethod, new Object[0], locator.getNeutralContextClassLoader()); }
private void preDestroyMe(T t) throws Throwable { if (t == null) return; if (t instanceof PreDestroy) { ((PreDestroy) t).preDestroy(); return; } if (preDestroyMethod == null) return; ReflectionHelper.invoke(t, preDestroyMethod, new Object[0], locator.getNeutralContextClassLoader()); }
private void postConstructMe(T t) throws Throwable { if (t == null) return; if (t instanceof PostConstruct) { ((PostConstruct) t).postConstruct(); return; } if (postConstructMethod == null) return; ReflectionHelper.invoke(t, postConstructMethod, new Object[0], locator.getNeutralContextClassLoader()); }
private void preDestroyMe(T t) throws Throwable { if (t == null) return; if (t instanceof PreDestroy) { ((PreDestroy) t).preDestroy(); return; } if (preDestroyMethod == null) return; ReflectionHelper.invoke(t, preDestroyMethod, new Object[0], locator.getNeutralContextClassLoader()); }
private void preDestroyMe(T t) throws Throwable { if (t == null) return; if (t instanceof PreDestroy) { ((PreDestroy) t).preDestroy(); return; } if (preDestroyMethod == null) return; ReflectionHelper.invoke(t, preDestroyMethod, new Object[0], locator.getNeutralContextClassLoader()); }
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()); }
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()); }
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()); }
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()); }
/** * Post constructs the given object * * @param postMe post constructs the thing * @param locator The non-null service locator associated with the operation (for finding the strategy) * @param strategy The strategy to use for analyzing the class */ public static void justPostConstruct(Object postMe, ServiceLocatorImpl locator, String strategy) { if (postMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Class<?> baseClass = postMe.getClass(); Method postConstruct = getPostConstruct(baseClass, analyzer, collector); collector.throwIfErrors(); if (postConstruct == null) return; try { ReflectionHelper.invoke(postMe, postConstruct, new Object[0], locator.getNeutralContextClassLoader()); } catch (Throwable e) { throw new MultiException(e); } }
/** * Post constructs the given object * * @param postMe post constructs the thing * @param locator The non-null service locator associated with the operation (for finding the strategy) * @param strategy The strategy to use for analyzing the class */ public static void justPostConstruct(Object postMe, ServiceLocatorImpl locator, String strategy) { if (postMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Class<?> baseClass = postMe.getClass(); Method postConstruct = getPostConstruct(baseClass, analyzer, collector); collector.throwIfErrors(); if (postConstruct == null) return; try { ReflectionHelper.invoke(postMe, postConstruct, new Object[0], locator.getNeutralContextClassLoader()); } catch (Throwable e) { throw new MultiException(e); } }
/** * Pre Destroys the given object * * @param preMe pre destroys the thing * @param locator The non-null service locator associated with the operation (for finding the strategy) * @param strategy The strategy to use for analyzing the class */ public static void justPreDestroy(Object preMe, ServiceLocatorImpl locator, String strategy) { if (preMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); collector.throwIfErrors(); Class<?> baseClass = preMe.getClass(); Method preDestroy = getPreDestroy(baseClass, analyzer, collector); collector.throwIfErrors(); if (preDestroy == null) return; try { ReflectionHelper.invoke(preMe, preDestroy, new Object[0], locator.getNeutralContextClassLoader()); } catch (Throwable e) { throw new MultiException(e); } }
/** * Pre Destroys the given object * * @param preMe pre destroys the thing * @param locator The non-null service locator associated with the operation (for finding the strategy) * @param strategy The strategy to use for analyzing the class */ public static void justPreDestroy(Object preMe, ServiceLocatorImpl locator, String strategy) { if (preMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); collector.throwIfErrors(); Class<?> baseClass = preMe.getClass(); Method preDestroy = getPreDestroy(baseClass, analyzer, collector); collector.throwIfErrors(); if (preDestroy == null) return; try { ReflectionHelper.invoke(preMe, preDestroy, new Object[0], locator.getNeutralContextClassLoader()); } catch (Throwable e) { throw new MultiException(e); } }