/** * 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); } }
/** * 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); } }
/** * 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); } }
ClassAnalyzer analyzer = Utilities.getClassAnalyzer(locator, analyzerName, collector); if (analyzer == null) { myConstructor = null;
ClassAnalyzer analyzer = Utilities.getClassAnalyzer(locator, analyzerName, collector); if (analyzer == null) { myConstructor = null;
ClassAnalyzer analyzer = Utilities.getClassAnalyzer(locator, analyzerName, collector); if (analyzer == null) { myConstructor = null;
ClassAnalyzer analyzer = Utilities.getClassAnalyzer(locator, analyzerName, collector); if (analyzer == null) { myConstructor = null;
/** * Just creates the thing, doesn't try to do anything else * @param createMe The thing to create * @param locator The locator to find the injection points with * @param strategy The strategy to use for analyzing the class * @return The constructed thing, no further injection is performed */ @SuppressWarnings("unchecked") public static <T> T justCreate(Class<T> createMe, ServiceLocatorImpl locator, String strategy) { if (createMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Constructor<?> c = getConstructor(createMe, analyzer, collector); collector.throwIfErrors(); List<SystemInjecteeImpl> injectees = getConstructorInjectees(c, null); validateSelfInjectees(null, injectees, collector); collector.throwIfErrors(); Object args[] = new Object[injectees.size()]; for (SystemInjecteeImpl injectee : injectees) { InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null); } try { return (T) ReflectionHelper.makeMe(c, args, locator.getNeutralContextClassLoader()); } catch (Throwable th) { throw new MultiException(th); } }
/** * Just creates the thing, doesn't try to do anything else * @param createMe The thing to create * @param locator The locator to find the injection points with * @param strategy The strategy to use for analyzing the class * @return The constructed thing, no further injection is performed */ @SuppressWarnings("unchecked") public static <T> T justCreate(Class<T> createMe, ServiceLocatorImpl locator, String strategy) { if (createMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Constructor<?> c = getConstructor(createMe, analyzer, collector); collector.throwIfErrors(); List<SystemInjecteeImpl> injectees = getConstructorInjectees(c, null); validateSelfInjectees(null, injectees, collector); collector.throwIfErrors(); Object args[] = new Object[injectees.size()]; for (SystemInjecteeImpl injectee : injectees) { InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null); } try { return (T) ReflectionHelper.makeMe(c, args, locator.getNeutralContextClassLoader()); } catch (Throwable th) { throw new MultiException(th); } }
/** * Just creates the thing, doesn't try to do anything else * @param createMe The thing to create * @param locator The locator to find the injection points with * @param strategy The strategy to use for analyzing the class * @return The constructed thing, no further injection is performed */ @SuppressWarnings("unchecked") public static <T> T justCreate(Class<T> createMe, ServiceLocatorImpl locator, String strategy) { if (createMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Constructor<?> c = getConstructor(createMe, analyzer, collector); collector.throwIfErrors(); List<SystemInjecteeImpl> injectees = getConstructorInjectees(c, null); validateSelfInjectees(null, injectees, collector); collector.throwIfErrors(); Object args[] = new Object[injectees.size()]; for (SystemInjecteeImpl injectee : injectees) { InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null); } try { return (T) ReflectionHelper.makeMe(c, args, locator.getNeutralContextClassLoader()); } catch (Throwable th) { throw new MultiException(th); } }
/** * Just creates the thing, doesn't try to do anything else * @param createMe The thing to create * @param locator The locator to find the injection points with * @param strategy The strategy to use for analyzing the class * @return The constructed thing, no further injection is performed */ @SuppressWarnings("unchecked") public static <T> T justCreate(Class<T> createMe, ServiceLocatorImpl locator, String strategy) { if (createMe == null) throw new IllegalArgumentException(); Collector collector = new Collector(); ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors(); Constructor<?> c = getConstructor(createMe, analyzer, collector); collector.throwIfErrors(); List<SystemInjecteeImpl> injectees = getConstructorInjectees(c, null); validateSelfInjectees(null, injectees, collector); collector.throwIfErrors(); Object args[] = new Object[injectees.size()]; for (SystemInjecteeImpl injectee : injectees) { InjectionResolver<?> resolver = locator.getPerLocatorUtilities().getInjectionResolver(locator, injectee); args[injectee.getPosition()] = resolver.resolve(injectee, null); } try { return (T) ReflectionHelper.makeMe(c, args, locator.getNeutralContextClassLoader()); } catch (Throwable th) { throw new MultiException(th); } }
ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors();
ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors();
ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors();
ClassAnalyzer analyzer = getClassAnalyzer(locator, strategy, collector); collector.throwIfErrors();