public class AutoJsonRpcServiceImplExporter
extends java.lang.Object
implements org.springframework.beans.factory.config.BeanFactoryPostProcessor
This class can be instantiated in a spring context in order to simplify the configuration of JSON-RPC
services afforded by beans in the same context. The services to be configured are identified
by the annotation AutoJsonRpcServiceImpl
on the implementation of the service. Such
implementation beans must also have the JsonRpcService
annotation associated with them; either
on the implementation class itself or, preferably, on an interface that the implementation implements.
The path for exposing the service is obtained from JsonRpcService.value()
, but it is also
possible to define additional paths on AutoJsonRpcServiceImpl.additionalPaths()
.
Below is an example of spring context XML snippet that illustrates typical usage;
<bean class="com.googlecode.jsonrpc4j.spring.AutoJsonRpcServiceImplExporter"/> <bean class="MyServiceBean"/>
Note that this class replaces AutoJsonRpcServiceExporter
. See that class' javadoc
for details.
Constructor and Description |
---|
AutoJsonRpcServiceImplExporter() |
Modifier and Type | Method and Description |
---|---|
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) |
void |
setAllowExtraParams(boolean allowExtraParams) |
void |
setAllowLessParams(boolean allowLessParams) |
void |
setBackwardsCompatible(boolean backwardsCompatible) |
void |
setContentType(java.lang.String contentType) |
void |
setConvertedParameterTransformer(ConvertedParameterTransformer convertedParameterTransformer) |
void |
setErrorResolver(ErrorResolver errorResolver) |
void |
setHttpStatusCodeProvider(HttpStatusCodeProvider httpStatusCodeProvider) |
void |
setInvocationListener(InvocationListener invocationListener) |
void |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
void |
setRegisterTraceInterceptor(boolean registerTraceInterceptor)
See
RemoteExporter.setRegisterTraceInterceptor(boolean) |
void |
setRethrowExceptions(boolean rethrowExceptions) |
void |
setShouldLogInvocationErrors(boolean shouldLogInvocationErrors) |
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
postProcessBeanFactory
in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
org.springframework.beans.BeansException
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
objectMapper
- the objectMapper to setpublic void setErrorResolver(ErrorResolver errorResolver)
errorResolver
- the errorResolver to setpublic void setBackwardsCompatible(boolean backwardsCompatible)
backwardsCompatible
- the backwardsCompatible to setpublic void setRethrowExceptions(boolean rethrowExceptions)
rethrowExceptions
- the rethrowExceptions to setpublic void setAllowExtraParams(boolean allowExtraParams)
allowExtraParams
- the allowExtraParams to setpublic void setAllowLessParams(boolean allowLessParams)
allowLessParams
- the allowLessParams to setpublic void setRegisterTraceInterceptor(boolean registerTraceInterceptor)
RemoteExporter.setRegisterTraceInterceptor(boolean)
registerTraceInterceptor
- the registerTraceInterceptor value to setpublic void setInvocationListener(InvocationListener invocationListener)
invocationListener
- the invocationListener to setpublic void setHttpStatusCodeProvider(HttpStatusCodeProvider httpStatusCodeProvider)
httpStatusCodeProvider
- the HttpStatusCodeProvider to setpublic void setConvertedParameterTransformer(ConvertedParameterTransformer convertedParameterTransformer)
convertedParameterTransformer
- the convertedParameterTransformer to setpublic void setShouldLogInvocationErrors(boolean shouldLogInvocationErrors)
public void setContentType(java.lang.String contentType)