org.apache.batchee.jaxrs.server.JBatchResourceImpl
maps more or less javax.batch.operations.JobOperator
API to JAXRS. It is available in batchee-jaxrs-server
module.
To define it with CXF you can use the CXFNonSpringServlet
in a servlet container, in a JavaEE container you surely already have it and just need to define a custom javax.ws.rs.core.Application
with JBatchResource
as class in getClasses
and configure org.apache.batchee.jaxrs.server.JBatchExceptionMapper
if you want to map javax.batch.operations.BatchRuntimeException
to status 500:
Here is the mapping:
Note: batchee-jaxrs-client
provides a way to query it through the JobOperator
API. You need to use org.apache.batchee.jaxrs.client.BatchEEJAXRSClientFactory.newClient(String url, Class<?> jsonProvider, API apiType)
. API.AUTO tries to use JAXRS 2 client and if not available uses cxf 2.6 clients. In this last case you need to provide cxf-rt-frontend-jaxrs
.
It is based on org.apache.batchee.servlet.JBatchController
but since the jar - batchee-servlet
- is in a webapp in a servlet 3.0 container, it is automatically added and you don't need to define it in your web.xml
.
The configuration through init parameters is: