-
1. Re: Inject Seam Component To Quartz Job
itays100 Dec 23, 2013 4:31 PM (in response to itays100)Hello,
I would like to share my solution for this problem.
Because there is an issue to inject seam component into Quartz job I have added the following code
to the execute method as follow:
public void execute(JobExecutionContext arg0) throws JobExecutionException {
Lifecycle.beginCall();
EntityManager entityManager = (EntityManager) Component.getInstance("entityManager");
entityManager.getTransaction().begin();
MyDao myDao = (MyDao)org.jboss.seam.Component.getInstance("myDao");
dataFeedDao.setEntityManager(entityManager);
The MyDao is used as a Seam component and being injected to other Seam component and
the only time I used dataFeedDao.setEntityManager(entityManager) is in Quartz job.
Hope this help someone.