Package org.apache.cxf.jaxws.spring
Class JaxWsWebServicePublisherBeanPostProcessor
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.handler.AbstractHandlerMapping
org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
org.apache.cxf.jaxws.spring.JaxWsWebServicePublisherBeanPostProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.config.BeanPostProcessor,org.springframework.context.ApplicationContextAware,org.springframework.core.Ordered,org.springframework.web.context.ServletConfigAware,org.springframework.web.context.ServletContextAware,org.springframework.web.servlet.handler.MatchableHandlerMapping,org.springframework.web.servlet.HandlerMapping
public class JaxWsWebServicePublisherBeanPostProcessor
extends org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.web.context.ServletConfigAware, org.springframework.beans.factory.BeanFactoryAware
Bean to scan context for potential web services. This scans the beans for classes that
are annotated with @WebService. Excepting those already declared via the JAX-WS Spring
schema, it launches each as an endpoint.
By default, it sets up a default JaxWsServiceFactory and JAX-B data binding,
and then creates a URL under /services/ based on the service name. Properties of the bean
permit you to configure this; if you set prototypeServiceFactoryBeanName, the code
will fetch that bean. It must be a prototype, since service factory object can't be used
for more than one endpoint. Similarly, prototypeDataBindingBeanName can be used to
control the data binding.
Note that this class uses
org.apache.cxf.transport.servlet#CXFServlet from the
cxf-rt-transports-http-jetty library, which is not part of
the standard dependencies of the JAX-WS front
end.
If you use this processor in an environment with no servlet, it will still launch the
endpoints using the embedded CXF server.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
Fields inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
mappingsLoggerFields inherited from class org.springframework.context.support.ApplicationObjectSupport
loggerFields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, LOOKUP_PATH, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanFor Unit Test.booleanFor Unit Test.postProcessAfterInitialization(Object bean, String beanName) postProcessBeforeInitialization(Object bean, String beanName) voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) voidsetPrototypeDataBindingBeanName(String prototypeDataBindingBeanName) Set the data binding for all services launched by this bean.voidsetPrototypeServerFactoryBeanName(String prototypeServerFactoryBeanName) Set the server factory for all services launched by this bean.voidsetServletConfig(jakarta.servlet.ServletConfig servletConfig) voidsetUrlPrefix(String urlPrefix) Set the prefix for the generated endpoint URLs.Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathPatternHandlerMap, getRootHandler, lookupHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setPatternParser, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandlerMethods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurationSource, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getPatternParser, getUrlPathHelper, hasCorsConfigurationSource, initApplicationContext, initInterceptors, initLookupPath, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper, usesPathPatternsMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.HandlerMapping
getHandler, usesPathPatternsMethods inherited from interface org.springframework.web.servlet.handler.MatchableHandlerMapping
getPatternParser
-
Constructor Details
-
JaxWsWebServicePublisherBeanPostProcessor
public JaxWsWebServicePublisherBeanPostProcessor() throws SecurityException, NoSuchMethodException, ClassNotFoundException
-
-
Method Details
-
setUrlPrefix
Set the prefix for the generated endpoint URLs.- Parameters:
urlPrefix-
-
postProcessBeforeInitialization
public Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException - Specified by:
postProcessBeforeInitializationin interfaceorg.springframework.beans.factory.config.BeanPostProcessor- Throws:
org.springframework.beans.BeansException
-
postProcessAfterInitialization
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException - Specified by:
postProcessAfterInitializationin interfaceorg.springframework.beans.factory.config.BeanPostProcessor- Throws:
org.springframework.beans.BeansException
-
setServletConfig
public void setServletConfig(jakarta.servlet.ServletConfig servletConfig) - Specified by:
setServletConfigin interfaceorg.springframework.web.context.ServletConfigAware
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
getPrototypeServerFactoryBeanName
-
setPrototypeServerFactoryBeanName
Set the server factory for all services launched by this bean. This must be the name of a scope='prototype' bean that implementsorg.apache.cxf.frontend#ServerFactoryBean.- Parameters:
prototypeServerFactoryBeanName-
-
getPrototypeDataBindingBeanName
-
setPrototypeDataBindingBeanName
Set the data binding for all services launched by this bean. This must be the name of a scope='prototype' bean that implementsorg.apache.cxf.databinding#DataBinding.- Parameters:
prototypeDataBindingBeanName-
-
isCustomizedServerFactory
public boolean isCustomizedServerFactory()For Unit Test.- Returns:
-
isCustomizedDataBinding
public boolean isCustomizedDataBinding()For Unit Test.- Returns:
-