Package org.quartz.jobs.ee.ejb
Class EJBInvokerJob
- java.lang.Object
-
- org.quartz.jobs.ee.ejb.EJBInvokerJob
-
- All Implemented Interfaces:
org.quartz.Job
- Direct Known Subclasses:
EJB3InvokerJob
public class EJBInvokerJob extends java.lang.Object implements org.quartz.JobA
Expects the properties corresponding to the following keys to be in theJobthat invokes a method on an EJB.JobDataMapwhen it executes:EJB_JNDI_NAME_KEY- the JNDI name (location) of the EJB's home interface.EJB_METHOD_KEY- the name of the method to invoke on the EJB.EJB_ARGS_KEY- an Object[] of the args to pass to the method (optional, if left out, there are no arguments).EJB_ARG_TYPES_KEY- an Class[] of the types of the args to pass to the method (optional, if left out, the types will be derived by calling getClass() on each of the arguments).
The following keys can also be used at need:INITIAL_CONTEXT_FACTORY- the context factory used to build the context.PROVIDER_URL- the name of the environment property for specifying configuration information for the service provider to use.
The result of the EJB method invocation will be available to
Job/TriggerListeners via.JobExecutionContext.getResult()
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCREDENTIALSstatic java.lang.StringEJB_ARG_TYPES_KEYstatic java.lang.StringEJB_ARGS_KEYstatic java.lang.StringEJB_JNDI_NAME_KEYstatic java.lang.StringEJB_METHOD_KEYstatic java.lang.StringINITIAL_CONTEXT_FACTORYstatic java.lang.StringPRINCIPALstatic java.lang.StringPROVIDER_URL
-
Constructor Summary
Constructors Constructor Description EJBInvokerJob()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(org.quartz.JobExecutionContext context)protected javax.naming.InitialContextgetInitialContext(org.quartz.JobDataMap jobDataMap)
-
-
-
Field Detail
-
EJB_JNDI_NAME_KEY
public static final java.lang.String EJB_JNDI_NAME_KEY
- See Also:
- Constant Field Values
-
EJB_METHOD_KEY
public static final java.lang.String EJB_METHOD_KEY
- See Also:
- Constant Field Values
-
EJB_ARG_TYPES_KEY
public static final java.lang.String EJB_ARG_TYPES_KEY
- See Also:
- Constant Field Values
-
EJB_ARGS_KEY
public static final java.lang.String EJB_ARGS_KEY
- See Also:
- Constant Field Values
-
INITIAL_CONTEXT_FACTORY
public static final java.lang.String INITIAL_CONTEXT_FACTORY
- See Also:
- Constant Field Values
-
PROVIDER_URL
public static final java.lang.String PROVIDER_URL
- See Also:
- Constant Field Values
-
PRINCIPAL
public static final java.lang.String PRINCIPAL
- See Also:
- Constant Field Values
-
CREDENTIALS
public static final java.lang.String CREDENTIALS
- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
public void execute(org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException- Specified by:
executein interfaceorg.quartz.Job- Throws:
org.quartz.JobExecutionException
-
getInitialContext
protected javax.naming.InitialContext getInitialContext(org.quartz.JobDataMap jobDataMap) throws javax.naming.NamingException- Throws:
javax.naming.NamingException
-
-