public List<Property> getProps() { return injectionReferences == null ? null : injectionReferences.getProps(); }
public static void injectReferences(Object artifact, InjectionReferences injectionRefs) { if (logger.isLoggable(Level.FINE)) { logger.fine("Injecting references into: " + artifact); logger.fine("InjectionReferences = " + injectionRefs); } Map<String, Field> propertyMap = findPropertyFields(artifact); if (injectionRefs.getProps() != null) { injectProperties(artifact, injectionRefs.getProps(), propertyMap); } injectBatchContextFields(artifact, injectionRefs.getJobContext(), injectionRefs.getStepContext()); if (logger.isLoggable(Level.FINE)) { logger.exiting(sourceClass, "injectReferences"); } }
public static void injectReferences(Object artifact, InjectionReferences injectionRefs) { if (logger.isLoggable(Level.FINE)) { logger.fine("Injecting references into: " + artifact); logger.fine("InjectionReferences = " + injectionRefs); } Map<String, Field> propertyMap = findPropertyFields(artifact); if (injectionRefs.getProps() != null) { injectProperties(artifact, injectionRefs.getProps(), propertyMap); } injectBatchContextFields(artifact, injectionRefs.getJobContext(), injectionRefs.getStepContext()); if (logger.isLoggable(Level.FINE)) { logger.exiting(sourceClass, "injectReferences"); } }
public static void injectReferences(Object artifact, InjectionReferences injectionRefs) { if (logger.isLoggable(Level.FINE)) { logger.fine("Injecting references into: " + artifact); logger.fine("InjectionReferences = " + injectionRefs); } Map<String, Field> propertyMap = findPropertyFields(artifact); if (injectionRefs.getProps() != null) { injectProperties(artifact, injectionRefs.getProps(), propertyMap); } injectBatchContextFields(artifact, injectionRefs.getJobContext(), injectionRefs.getStepContext()); if (logger.isLoggable(Level.FINE)) { logger.exiting(sourceClass, "injectReferences"); } }
@Produces @Dependent @BatchProperty public String produceProperty(InjectionPoint injectionPoint) { //Seems like this is a CDI bug where null injection points are getting passed in. //We should be able to ignore these as a workaround. if (injectionPoint != null) { if (ProxyFactory.getInjectionReferences() == null) { return null; } BatchProperty batchPropAnnotation = injectionPoint.getAnnotated().getAnnotation(BatchProperty.class); // If a name is not supplied the batch property name defaults to // the field name String batchPropName = null; if (batchPropAnnotation.name().equals("")) { batchPropName = injectionPoint.getMember().getName(); } else { batchPropName = batchPropAnnotation.name(); } List<Property> propList = ProxyFactory.getInjectionReferences().getProps(); String propValue = DependencyInjectionUtility.getPropertyValue(propList, batchPropName); return propValue; } return null; }
@Produces @Dependent @BatchProperty public String produceProperty(InjectionPoint injectionPoint) { //Seems like this is a CDI bug where null injection points are getting passed in. //We should be able to ignore these as a workaround. if (injectionPoint != null) { if (ProxyFactory.getInjectionReferences() == null) { return null; } BatchProperty batchPropAnnotation = injectionPoint.getAnnotated().getAnnotation(BatchProperty.class); // If a name is not supplied the batch property name defaults to // the field name String batchPropName; if (batchPropAnnotation.name().equals("")) { batchPropName = injectionPoint.getMember().getName(); } else { batchPropName = batchPropAnnotation.name(); } List<Property> propList = ProxyFactory.getInjectionReferences().getProps(); return DependencyInjectionUtility.getPropertyValue(propList, batchPropName); } return null; }