当前位置: 首页>>代码示例>>Java>>正文


Java BatchProperty类代码示例

本文整理汇总了Java中javax.batch.api.BatchProperty的典型用法代码示例。如果您正苦于以下问题:Java BatchProperty类的具体用法?Java BatchProperty怎么用?Java BatchProperty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BatchProperty类属于javax.batch.api包,在下文中一共展示了BatchProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBatchPropertyValue

import javax.batch.api.BatchProperty; //导入依赖的package包/类
private String getBatchPropertyValue(String name) throws IllegalArgumentException, IllegalAccessException {
    Field[] fields = MyBatchletWithPropertiesImpl.class.getDeclaredFields();
    
    for (Field field: fields) {
        BatchProperty batchProperty = field.getAnnotation(BatchProperty.class);
        if (batchProperty != null) {
            if (!batchProperty.name().equals("") && batchProperty.name().equals(name)){
                return (String)field.get(this);
            } else if (field.getName().equals(name)){
                return (String)field.get(this);
            }
        } 
    }
    
    return null;
    
}
 
开发者ID:WASdev,项目名称:standards.jsr352.tck,代码行数:18,代码来源:MyBatchletWithPropertiesImpl.java

示例2: getBatchDataConsumerMap

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public BatchDataConsumerMap getBatchDataConsumerMap(final InjectionPoint injectionPoint)
{
    logger.log(Level.FINE, "BatchDataConsumerMap.getBatchDataConsumerMap");

    synchronized (_syncObject)
    {
        if (_instance == null)
            _instance = new BatchDataConsumerMap();
    }

    logger.log(Level.FINE, "BatchDataConsumerMap.getBatchDataConsumerMap: returns = " + _instance);

    return _instance;
}
 
开发者ID:arjuna-technologies,项目名称:JEEBatch_DataBroker_Support,代码行数:17,代码来源:BatchDataConsumerMap.java

示例3: getBatchDataProviderMap

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public BatchDataProviderMap getBatchDataProviderMap(final InjectionPoint injectionPoint)
{
    logger.log(Level.FINE, "BatchDataProviderMap.getBatchDataProviderMap");

    synchronized (_syncObject)
    {
        if (_instance == null)
            _instance = new BatchDataProviderMap();
    }

    logger.log(Level.FINE, "BatchDataProviderMap.getBatchDataProviderMap: returns = " + _instance);

    return _instance;
}
 
开发者ID:arjuna-technologies,项目名称:JEEBatch_DataBroker_Support,代码行数:17,代码来源:BatchDataProviderMap.java

示例4: produceProperty

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public String produceProperty(final InjectionPoint injectionPoint) {
    if (injectionPoint != null && ProxyFactory.getInjectionReferences() != null) {
        final BatchProperty batchPropAnnotation = injectionPoint.getAnnotated().getAnnotation(BatchProperty.class);
        final String batchPropName;
        if (batchPropAnnotation.name().equals("")) {
            batchPropName = injectionPoint.getMember().getName();
        } else {
            batchPropName = batchPropAnnotation.name();
        }

        return DependencyInjections.getPropertyValue(ProxyFactory.getInjectionReferences().getProps(), batchPropName);
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:17,代码来源:BatchProducerBean.java

示例5: findPropertyFields

import javax.batch.api.BatchProperty; //导入依赖的package包/类
/**
 * 
 * @param delegate
 *            An instance of the batch artifact
 * @return A map of Fields annotated with @BatchProperty.
 */
private static Map<String, Field> findPropertyFields(Object delegate) {

    HashMap<String, Field> propertyMap = null;
    // Go through declared field annotations
    for (final Field field : delegate.getClass().getDeclaredFields()) {
        AccessController.doPrivileged(new PrivilegedAction<Object>() {
            public Object run() {
                field.setAccessible(true); // ignore java accessibility
                return null;
            }
        });

        BatchProperty batchPropertyAnnotation = field.getAnnotation(BatchProperty.class);
        if (batchPropertyAnnotation != null) {
            if (propertyMap == null) {
                propertyMap = new HashMap<String, Field>();
            }
            // If a name is not supplied the batch property name defaults to
            // the field name
            String batchPropName = null;
            if (batchPropertyAnnotation.name().equals("")) {
                batchPropName = field.getName();
            } else {
                batchPropName = batchPropertyAnnotation.name();
            }

            // Check if we have already used this name for a property.
            if (propertyMap.containsKey(batchPropName)) {
                throw new IllegalBatchPropertyException("There is already a batch property with this name: " + batchPropName);
            }

            propertyMap.put(batchPropName, field);
        }

    }
    return propertyMap;
}
 
开发者ID:WASdev,项目名称:standards.jsr352.jbatch,代码行数:44,代码来源:DependencyInjectionUtility.java

示例6: produceProperty

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@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;
}
 
开发者ID:WASdev,项目名称:standards.jsr352.jbatch,代码行数:30,代码来源:BatchProducerBean.java

示例7: getString

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public String getString(InjectionPoint injectionPoint) {
    BatchProperty annotation = injectionPoint.getAnnotated().getAnnotation(BatchProperty.class);

    if (annotation.name().equals("region")) {
        return "EU";
    }

    return "test";
}
 
开发者ID:radcortez,项目名称:wow-auctions,代码行数:12,代码来源:BatchUnitTestProducer.java

示例8: findPropertyFields

import javax.batch.api.BatchProperty; //导入依赖的package包/类
/**
 * @param delegate An instance of the batch artifact
 * @return A map of Fields annotated with @BatchProperty.
 */
private static Map<String, Field> findPropertyFields(final Object delegate) {
    Map<String, Field> propertyMap = null;

    Class<?> current = delegate.getClass();
    while (current.getName().contains("$$")) { // remove common proxies
        current = current.getSuperclass();
    }

    while (current != null && current != Object.class) {
        for (final Field field : current.getDeclaredFields()) {
            setAccessible(field);

            final BatchProperty batchPropertyAnnotation = field.getAnnotation(BatchProperty.class);
            if (batchPropertyAnnotation != null) {
                if (propertyMap == null) {
                    propertyMap = new HashMap<String, Field>();
                }
                // If a name is not supplied the batch property name defaults to
                // the field name
                String batchPropName = null;
                if (batchPropertyAnnotation.name().equals("")) {
                    batchPropName = field.getName();
                } else {
                    batchPropName = batchPropertyAnnotation.name();
                }

                // Check if we have already used this name for a property.
                if (propertyMap.containsKey(batchPropName)) {
                    throw new IllegalBatchPropertyException("There is already a batch property with this name: " + batchPropName);
                }

                propertyMap.put(batchPropName, field);
            }

        }
        current = current.getSuperclass();
    }
    return propertyMap;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:44,代码来源:DependencyInjections.java

示例9: produceIntProperty

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public Integer produceIntProperty(final InjectionPoint injectionPoint) {
    final String v = produceProperty(injectionPoint);
    if (v != null) {
        return DependencyInjections.convertTo(v, Integer.class, Integer.class);
    }
    return 0;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:10,代码来源:BatchProducerBean.java

示例10: produceDoubleProperty

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public Double produceDoubleProperty(final InjectionPoint injectionPoint) {
    final String v = produceProperty(injectionPoint);
    if (v != null) {
        return DependencyInjections.convertTo(v, Double.class, Double.class);
    }
    return 0.;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:10,代码来源:BatchProducerBean.java

示例11: produceFloatProperty

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public Float produceFloatProperty(final InjectionPoint injectionPoint) {
    final String v = produceProperty(injectionPoint);
    if (v != null) {
        return DependencyInjections.convertTo(v, Float.class, Float.class);
    }
    return 0.f;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:10,代码来源:BatchProducerBean.java

示例12: produceShortProperty

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public Short produceShortProperty(final InjectionPoint injectionPoint) {
    final String v = produceProperty(injectionPoint);
    if (v != null) {
        return DependencyInjections.convertTo(v, Short.class, Short.class);
    }
    return 0;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:10,代码来源:BatchProducerBean.java

示例13: produceBooleanProperty

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public Boolean produceBooleanProperty(final InjectionPoint injectionPoint) {
    final String v = produceProperty(injectionPoint);
    if (v != null) {
        return DependencyInjections.convertTo(v, Boolean.class, Boolean.class);
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:10,代码来源:BatchProducerBean.java

示例14: produceLongProperty

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public Long produceLongProperty(final InjectionPoint injectionPoint) {
    final String v = produceProperty(injectionPoint);
    if (v != null) {
        return DependencyInjections.convertTo(v, Long.class, Long.class);
    }
    return 0L;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:10,代码来源:BatchProducerBean.java

示例15: produceByteProperty

import javax.batch.api.BatchProperty; //导入依赖的package包/类
@Produces
@BatchProperty
public Byte produceByteProperty(final InjectionPoint injectionPoint) {
    final String v = produceProperty(injectionPoint);
    if (v != null) {
        return DependencyInjections.convertTo(v, Byte.class, Byte.class);
    }
    return 0;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:10,代码来源:BatchProducerBean.java


注:本文中的javax.batch.api.BatchProperty类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。