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


Java StepContext类代码示例

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


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

示例1: getTransactionManager

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
@Override
public TransactionManagerAdapter getTransactionManager(StepContext stepContext) throws TransactionManagementException {
    logger.entering(CLASSNAME, "getTransactionManager", stepContext);

    TransactionManagerAdapter transactionManager = null;

    // get the JTA tran manager if we are in Java EE
    if (! this.batchConfig.isJ2seMode()) {
        // use the container JNDI java:comp/UserTransaction
        logger.fine("getting transaction object from JNDI java:comp/UserTransaction");
        transactionManager = new JTAUserTransactionAdapter("java:comp/UserTransaction");
    } 
    else if (this.batchConfig.isJ2seMode()) { 
    // If we are in J2SE mode use the non-transactional manager
    
        // java environment is Java SE
        // NoOp transaction manager
        logger.fine("J2SE mode non-transactional manager");
        transactionManager = new DefaultNonTransactionalManager();
    }

    logger.exiting(CLASSNAME, "getTransactionManager", transactionManager);
    return transactionManager;
}
 
开发者ID:WASdev,项目名称:standards.jsr352.jbatch,代码行数:25,代码来源:BatchTransactionServiceImpl.java

示例2: newInstance

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
public static <T> GroovyInstance<T> newInstance(final Class<T> expected, final String path, final JobContext jobContext, final StepContext stepContext)
        throws IllegalAccessException, InstantiationException {
    if (path == null) {
        throw new BatchRuntimeException("no script configured expected");
    }
    final File script = new File(path);
    if (!script.exists()) {
        throw new BatchRuntimeException("Can't find script: " + path);
    }

    final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
    final GroovyClassLoader loader = new GroovyClassLoader(tccl);

    final Class<?> clazz;
    try {
        clazz = loader.parseClass(script);
    } catch (final IOException e) {
        throw new BatchRuntimeException(e);
    }

    final T delegate = expected.cast(clazz.newInstance());
    injectIfBatcheeIfAvailable(tccl, delegate, jobContext, stepContext);
    return new GroovyInstance<T>(loader, delegate);
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:25,代码来源:Groovys.java

示例3: InjectionReferences

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
public InjectionReferences(JobContext jobContext, StepContext stepContext, 
        List<Property> props) {

    this.jobContext = jobContext;
    this.stepContext = stepContext;
    this.props = props;
}
 
开发者ID:WASdev,项目名称:standards.jsr352.jbatch,代码行数:8,代码来源:InjectionReferences.java

示例4: getStepContext

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
@Produces
@Dependent
public StepContext getStepContext() {
	if (ProxyFactory.getInjectionReferences() != null) {
		return ProxyFactory.getInjectionReferences().getStepContext();
	} else {
		return null;
	}
}
 
开发者ID:WASdev,项目名称:standards.jsr352.jbatch,代码行数:10,代码来源:BatchProducerBean.java

示例5: getStepContext

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
@Produces
public StepContext getStepContext() {
    if (ProxyFactory.getInjectionReferences() != null) {
        return ProxyFactory.getInjectionReferences().getStepContext();
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:8,代码来源:BatchProducerBean.java

示例6: injectIfBatcheeIfAvailable

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
private static <T> void injectIfBatcheeIfAvailable(final ClassLoader tccl, final T delegate, final JobContext jobContext, final StepContext stepContext) {
    try {
        final Class<?> dependencyInjections = tccl.loadClass("org.apache.batchee.container.util.DependencyInjections");
        final Class<?> injectionReferences = tccl.loadClass("org.apache.batchee.container.proxy.InjectionReferences");
        final Method inject = dependencyInjections.getMethod("injectReferences", Object.class, injectionReferences);
        final Constructor<?> injectionReferencesConstructor = injectionReferences.getConstructors()[0]; // there is a unique constructor
        inject.invoke(null, delegate, injectionReferencesConstructor.newInstance(jobContext, stepContext, null));
    } catch (final Throwable th) {
        // no-op: BatchEE is not available, injections will not be available
    }
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:12,代码来源:Groovys.java

示例7: currentKey

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
@Override
protected Long currentKey() {
    StepContext stepContext = getContextResolver().getStepContext();
    if (stepContext == null) {
        return null;
    }

    return stepContext.getStepExecutionId();
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:10,代码来源:StepContextImpl.java

示例8: getStepContext

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
@Override
public StepContext getStepContext() {

    InjectionReferences references = getInjectionReferences();
    if (references != null) {
        return references.getStepContext();
    }

    return null;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:11,代码来源:ThreadLocalContextResolver.java

示例9: getStepContext

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
public StepContext getStepContext() {
    return stepContext;
}
 
开发者ID:WASdev,项目名称:standards.jsr352.jbatch,代码行数:4,代码来源:InjectionReferences.java

示例10: getStepContext

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
protected StepContext getStepContext() {
    return stepCtx;
}
 
开发者ID:WASdev,项目名称:sample.batch.bonuspayout,代码行数:4,代码来源:ValidationReader.java

示例11: getTransactionManager

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
@Override
public TransactionManagerAdapter getTransactionManager(StepContext stepContext)
{
    return mockTxAdapter;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:6,代码来源:MockTransactionManagerService.java

示例12: getTransactionManager

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
@Override
public TransactionManagerAdapter getTransactionManager(final StepContext stepContext) throws TransactionManagementException {
    // Doesn't currently make use of stepContext but keeping signature
    return  getTransactionManager();
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:6,代码来源:DefaultBatchTransactionService.java

示例13: getStepContext

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
@Override
public StepContext getStepContext() {
    return resolve(StepContext.class);
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:5,代码来源:DynamicContextResolver.java

示例14: getTransactionManager

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
@Override
public TransactionManagerAdapter getTransactionManager(StepContext stepContext) {
    UserTransaction ut = ThreadExecutorEjb.getUserTransaction();

    return new UserTransactionTxAdapter(ut);
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:7,代码来源:UserTransactionTransactionService.java

示例15: getStepContext

import javax.batch.runtime.context.StepContext; //导入依赖的package包/类
/**
 * @return the current {@link StepContext} for this {@link Thread}
 */
StepContext getStepContext();
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:5,代码来源:ContextResolver.java


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