Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Dependent
- @Named("BatchletTest")
- public class BatchletTest extends AbstractBatchlet{
- public BatchletTest() {
- }
- @Inject
- ReportService service;
- @Override
- public String process() throws Exception {
- System.out.println(service);
- return null;
- }
- }
- <job id="test-job" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
- <step id="testStep">
- <batchlet ref="com.gam.mcs.mcidms.core.v2.job.BatchletTest" />
- </step>
- </job>
- @Singleton
- @Startup
- @TransactionAttribute(TransactionAttributeType.SUPPORTS)
- public class StartupBean {
- private Logger logger = LoggerFactory.getLogger(StartupBean.class);
- @PostConstruct
- private void startup() throws Exception {
- long executionId = BatchRuntime.getJobOperator().start("test-job", new Properties());
- System.out.println("myJob started, execution ID = " + executionId);
- }
- }
- @Stateless
- public class ReportService {
- .....
- }
Add Comment
Please, Sign In to add comment