Package org.apache.cxf.jaxrs
Class AbstractJAXRSFactoryBean
java.lang.Object
org.apache.cxf.interceptor.AbstractBasicInterceptorProvider
org.apache.cxf.endpoint.AbstractEndpointFactory
org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean
- All Implemented Interfaces:
org.apache.cxf.interceptor.InterceptorProvider
- Direct Known Subclasses:
JAXRSServerFactoryBean
public class AbstractJAXRSFactoryBean
extends org.apache.cxf.endpoint.AbstractEndpointFactory
Abstract bean holding functionality common for creating
JAX-RS Server and Client objects.
-
Field Summary
Fields inherited from class org.apache.cxf.endpoint.AbstractEndpointFactory
address, bindingConfig, bindingFactory, bindingId, bus, conduitSelector, dataBinding, destinationFactory, endpointName, endpointReference, features, properties, publishedEndpointUrl, serviceName, transportId
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractJAXRSFactoryBean
(JAXRSServiceFactoryBean serviceFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkResources
(boolean server) protected org.apache.cxf.service.model.BindingInfo
protected org.apache.cxf.endpoint.Endpoint
protected org.apache.cxf.service.model.EndpointInfo
createEndpointInfo
(org.apache.cxf.service.Service service) org.apache.cxf.Bus
getBus()
List<?>
Returns the service factoryprotected boolean
void
setBus
(org.apache.cxf.Bus bus) protected void
setDataBindingProvider
(ProviderFactory factory, org.apache.cxf.service.Service s) void
setModelBeans
(List<UserResource> resources) Sets the description of root resources.void
setModelBeans
(UserResource... resources) Sets the description of root resources.void
setModelBeansWithServiceClass
(List<UserResource> resources, Class<?>... sClasses) Sets the description of root resources with the list of concrete classes.void
setModelRef
(String modelRef) Sets a reference to the external user model, Example: "classpath:/model/resources.xml"void
setModelRefWithServiceClass
(String modelRef, Class<?>... sClasses) Sets a reference to the external user model, Example: "classpath:/model/resources.xml".void
setProvider
(Object provider) Add custom JAX-RS provider to the list of providersvoid
setProviderComparator
(Comparator<?> providerComparator) void
setProviders
(List<? extends Object> providers) Add custom JAX-RS providers to the list of providersvoid
setSchemaLocation
(String schema) Sets the location of the schema which can be used to validate the incoming XML or JAXB-driven JSON.void
setSchemaLocations
(List<String> schemas) Sets the locations of the schemas which can be used to validate the incoming XML or JAXB-driven JSON.void
setServiceFactory
(JAXRSServiceFactoryBean serviceFactory) Sets the custom service factory which processes the registered classes and providersvoid
setServiceName
(QName name) protected void
setupFactory
(ProviderFactory factory, org.apache.cxf.endpoint.Endpoint ep) Methods inherited from class org.apache.cxf.endpoint.AbstractEndpointFactory
addToBeans, checkPrivateEndpoint, getAddress, getBindingConfig, getBindingFactory, getBindingId, getBus, getConduitSelector, getDataBinding, getDestinationFactory, getEndpointName, getFeatures, getProperties, getProperties, getPublishedEndpointUrl, getServiceName, getTransportId, initializeAnnotationInterceptors, initializeAnnotationInterceptors, initializeAnnotationInterceptors, setAddress, setBindingConfig, setBindingFactory, setBindingId, setConduitSelector, setDataBinding, setDestinationFactory, setEndpointName, setEndpointReference, setFeatures, setProperties, setPublishedEndpointUrl, setTransportId
Methods inherited from class org.apache.cxf.interceptor.AbstractBasicInterceptorProvider
getInFaultInterceptors, getInInterceptors, getOutFaultInterceptors, getOutInterceptors, setInFaultInterceptors, setInInterceptors, setOutFaultInterceptors, setOutInterceptors
-
Field Details
-
schemaLocations
-
serviceFactory
-
entityProviders
-
-
Constructor Details
-
AbstractJAXRSFactoryBean
-
-
Method Details
-
getBus
public org.apache.cxf.Bus getBus()- Overrides:
getBus
in classorg.apache.cxf.endpoint.AbstractEndpointFactory
-
setServiceName
- Overrides:
setServiceName
in classorg.apache.cxf.endpoint.AbstractEndpointFactory
-
setBus
public void setBus(org.apache.cxf.Bus bus) - Overrides:
setBus
in classorg.apache.cxf.endpoint.AbstractEndpointFactory
-
createEndpointInfo
protected org.apache.cxf.service.model.EndpointInfo createEndpointInfo(org.apache.cxf.service.Service service) throws org.apache.cxf.BusException - Throws:
org.apache.cxf.BusException
-
createBindingInfo
protected org.apache.cxf.service.model.BindingInfo createBindingInfo()- Specified by:
createBindingInfo
in classorg.apache.cxf.endpoint.AbstractEndpointFactory
-
getServiceFactory
Returns the service factory- Returns:
- the factory
-
setServiceFactory
Sets the custom service factory which processes the registered classes and providers- Parameters:
serviceFactory
- the factory
-
createEndpoint
protected org.apache.cxf.endpoint.Endpoint createEndpoint() throws org.apache.cxf.BusException, org.apache.cxf.endpoint.EndpointException- Specified by:
createEndpoint
in classorg.apache.cxf.endpoint.AbstractEndpointFactory
- Throws:
org.apache.cxf.BusException
org.apache.cxf.endpoint.EndpointException
-
setSchemaLocation
Sets the location of the schema which can be used to validate the incoming XML or JAXB-driven JSON. JAX-RS MessageBodyReader implementations which have the setSchemaLocations method accepting a list of schema locations will be injected with this value.- Parameters:
schema
- the schema location
-
setSchemaLocations
Sets the locations of the schemas which can be used to validate the incoming XML or JAXB-driven JSON. JAX-RS MessageBodyReader implementations which have the setSchemaLocations method accepting a list of schema locations will be injected with this value. For example, if A.xsd imports B.xsd then both A.xsd and B.xsd need to be referenced.- Parameters:
schemas
- the schema locations
-
getProviders
- Returns:
- the list of custom JAX-RS providers
-
setProviders
Add custom JAX-RS providers to the list of providers- Parameters:
providers
- the entity providers
-
setProvider
Add custom JAX-RS provider to the list of providers- Parameters:
provider
- the custom provider.
-
checkResources
protected void checkResources(boolean server) -
isValidClassResourceInfo
-
setupFactory
-
setDataBindingProvider
-
setModelBeans
Sets the description of root resources. Can be used to 'attach' the JAX-RS like description to the application classes without adding JAX-RS annotations.- Parameters:
resources
- root resource descriptions
-
setModelBeans
Sets the description of root resources. Can be used to 'attach' the JAX-RS like description to the application classes without adding JAX-RS annotations.- Parameters:
resources
- root resource descriptions
-
setModelBeansWithServiceClass
Sets the description of root resources with the list of concrete classes. Can be used to 'attach' the JAX-RS like description to the application classes without adding JAX-RS annotations. Some models may only reference interfaces, thus providing a list of concrete classes that will be instantiated is required in such cases.- Parameters:
resources
- root resource descriptions.sClasses
- concrete root resource classes
-
setModelRef
Sets a reference to the external user model, Example: "classpath:/model/resources.xml"- Parameters:
modelRef
- the reference to the external model resource.
-
setModelRefWithServiceClass
Sets a reference to the external user model, Example: "classpath:/model/resources.xml". Some models may only reference interfaces, thus providing a list of concrete classes that will be instantiated is required in such cases.- Parameters:
modelRef
- the reference to the external model resource.sClasses
- concrete root resource classes
-
setProviderComparator
-