Guest User

Untitled

a guest
Jan 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. @Dependent
  2. @Named("BatchletTest")
  3. public class BatchletTest extends AbstractBatchlet{
  4.  
  5.  
  6. public BatchletTest() {
  7. }
  8.  
  9. @Inject
  10. ReportService service;
  11.  
  12. @Override
  13. public String process() throws Exception {
  14. System.out.println(service);
  15. return null;
  16. }
  17. }
  18.  
  19. <job id="test-job" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
  20. <step id="testStep">
  21. <batchlet ref="com.gam.mcs.mcidms.core.v2.job.BatchletTest" />
  22. </step>
  23. </job>
  24.  
  25. @Singleton
  26. @Startup
  27. @TransactionAttribute(TransactionAttributeType.SUPPORTS)
  28. public class StartupBean {
  29.  
  30. private Logger logger = LoggerFactory.getLogger(StartupBean.class);
  31.  
  32. @PostConstruct
  33. private void startup() throws Exception {
  34. long executionId = BatchRuntime.getJobOperator().start("test-job", new Properties());
  35. System.out.println("myJob started, execution ID = " + executionId);
  36.  
  37. }
  38.  
  39. }
  40.  
  41. @Stateless
  42. public class ReportService {
  43. .....
  44. }
Add Comment
Please, Sign In to add comment