/** * This no-op PolicyInterceptorProvider prevents the policy enforcement * logic making it impossible to assert the HTTPClientPolicy upfront * before the HTTPConduit becomes involved (e.g. via a WSPolicyFeature * applied to the <jaxws:client> bean). */ @NoJSR250Annotations public class NoOpPolicyInterceptorProvider extends AbstractPolicyInterceptorProvider { private static final long serialVersionUID = -5554625221910391930L; private static final Collection<QName> ASSERTION_TYPES; private static final QName HTTP_CONF_NAME = new QName("http://cxf.apache.org/transports/http/configuration", "client"); static { Collection<QName> types = new ArrayList<>(); types.add(HTTP_CONF_NAME); ASSERTION_TYPES = types; } public NoOpPolicyInterceptorProvider() { super(ASSERTION_TYPES); } }
/** * JAX-WS section 9.3.1: The runtime MUST then carry out any injections * requested by the handler, typically via the javax .annotation.Resource * annotation. After all the injections have been carried out, including in * the case where no injections were requested, the runtime MUST invoke the * method carrying a javax.annotation .PostConstruct annotation, if present. */ private void configHandler(Handler<?> handler) { if (handler != null) { ResourceManager resourceManager = bus.getExtension(ResourceManager.class); ResourceInjector injector = new ResourceInjector(resourceManager); injector.inject(handler); injector.construct(handler); } } }
public void destroy(Object o) { setTarget(o); if (processable(targetClass, o)) { invokePreDestroy(); } }
@NoJSR250Annotations public static class SpringEndpointImpl extends EndpointImpl implements ApplicationContextAware { boolean checkBlockConstruct; public SpringEndpointImpl(Object o) { super(o instanceof Bus ? (Bus)o : null, o instanceof Bus ? null : o); } public SpringEndpointImpl(Bus bus, Object implementor) { super(bus, implementor); } public void setCheckBlockConstruct(Boolean b) { checkBlockConstruct = b; } public void setApplicationContext(ApplicationContext ctx) throws BeansException { if (checkBlockConstruct) { setBlocking(ctx, this); } if (getBus() == null) { setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx)); } } }
private void initializeViaInjection(Handler<?> handler, final Map<String, String> params) { if (bus != null) { ResourceManager resMgr = bus.getExtension(ResourceManager.class); List<ResourceResolver> resolvers = resMgr.getResourceResolvers(); resolvers.add(new InitParamResourceResolver(params)); ResourceInjector resInj = new ResourceInjector(resMgr, resolvers); resInj.inject(handler); resInj.construct(handler); } }
@NoJSR250Annotations(unlessNull = "bus") public class WebServiceContextResourceResolver implements ResourceResolver {
/** * @param instance */ protected void injectResources(Object instance) { if (instance != null && !blockInjection) { ResourceManager resourceManager = getBus().getExtension(ResourceManager.class); List<ResourceResolver> resolvers = resourceManager.getResourceResolvers(); resourceManager = new DefaultResourceManager(resolvers); resourceManager.addResourceResolver(new WebServiceContextResourceResolver()); ResourceInjector injector = new ResourceInjector(resourceManager); if (Proxy.isProxyClass(instance.getClass()) && getServiceClass() != null) { injector.inject(instance, getServiceClass()); if (!blockPostConstruct) { injector.construct(instance, getServiceClass()); } } else { injector.inject(instance); if (!blockPostConstruct) { injector.construct(instance); } } } }
@NoJSR250Annotations public final class HTTPWSDLExtensionLoader implements WSDLExtensionLoader {
private void buildHandlerChain(JaxWsClientProxy cp) { AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder(); JaxWsServiceFactoryBean sf = (JaxWsServiceFactoryBean)getServiceFactory(); @SuppressWarnings("rawtypes") List<Handler> chain = new ArrayList<>(handlers); if (loadHandlers) { chain.addAll(builder.buildHandlerChainFromClass(sf.getServiceClass(), sf.getEndpointInfo().getName(), sf.getServiceQName(), this.getBindingId())); } if (!chain.isEmpty()) { ResourceManager resourceManager = getBus().getExtension(ResourceManager.class); List<ResourceResolver> resolvers = resourceManager.getResourceResolvers(); resourceManager = new DefaultResourceManager(resolvers); resourceManager.addResourceResolver(new WebServiceContextResourceResolver()); ResourceInjector injector = new ResourceInjector(resourceManager); for (Handler<?> h : chain) { if (Proxy.isProxyClass(h.getClass()) && getServiceClass() != null) { injector.inject(h, getServiceClass()); injector.construct(h, getServiceClass()); } else { injector.inject(h); injector.construct(h); } } } cp.getBinding().setHandlerChain(chain); }
@NoJSR250Annotations public static class BPJaxWsServerFactoryBean extends JaxWsServerFactoryBean { private Server server; public BPJaxWsServerFactoryBean() { super(); } public BPJaxWsServerFactoryBean(JaxWsServiceFactoryBean fact) { super(fact); } public Server getServer() { return server; } public void init() { create(); } @Override public Server create() { if (server == null) { server = super.create(); } return server; } public void destroy() { if (server != null) { server.destroy(); server = null; } } }
@NoJSR250Annotations public static class SpringServerFactoryBean extends JaxWsServerFactoryBean implements ApplicationContextAware {
@NoJSR250Annotations public class HTTPClientAssertionBuilder extends JaxbAssertionBuilder<HTTPClientPolicy> { public static final List<QName> KNOWN_ELEMENTS
@NoJSR250Annotations public class HTTPServerAssertionBuilder extends JaxbAssertionBuilder<HTTPServerPolicy> { public static final List<QName> KNOWN_ELEMENTS
@NoJSR250Annotations public static class JAXWSSpringClientProxyFactoryBean extends JaxWsProxyFactoryBean implements ApplicationContextAware, FactoryBean<Object>, DisposableBean {
@NoJSR250Annotations public final class Address {
@NoJSR250Annotations public class CertConstraintsFeature extends AbstractFeature { CertificateConstraintsType contraints;
@NoJSR250Annotations public class JaxWsProxyFactoryBean extends ClientProxyFactoryBean { @SuppressWarnings("rawtypes")
@NoJSR250Annotations public class HTTPTransportFactory extends AbstractTransportFactory
@NoJSR250Annotations public class JaxWsServiceFactoryBean extends ReflectionServiceFactoryBean {
@NoJSR250Annotations public abstract class HTTPConduit extends AbstractConduit