protected ClassLoader initClassLoader() { return bus.getExtension(ClassLoader.class); }
private void initConfig() { cproviderFactory = bus.getExtension(ContinuationProviderFactory.class); }
@Resource public final void setBus(Bus b) { bus = b; if (bus != null && bus.getExtension(ResourceManager.class) != null) { bus.getExtension(ResourceManager.class).addResourceResolver(this); } }
private void configureObject(Object instance) { Configurer configurer = bus.getExtension(Configurer.class); if (null != configurer) { configurer.configureBean(instance); } }
protected HTTPConduitFactory findFactory(EndpointInfo endpointInfo, Bus bus) { HTTPConduitFactory f = endpointInfo.getProperty(HTTPConduitFactory.class.getName(), HTTPConduitFactory.class); if (f == null) { f = bus.getExtension(HTTPConduitFactory.class); } return f; } public Destination getDestination(EndpointInfo endpointInfo, Bus bus) throws IOException {
private void configureObject(String name, Object instance) { Configurer configurer = bus.getExtension(Configurer.class); if (null != configurer) { configurer.configureBean(name, instance); } }
protected void registerServletContextResolver(ServletConfig sc) { if (Boolean.valueOf(sc.getInitParameter(IGNORE_SERVLET_CONTEXT_RESOLVER))) { return; } ResourceManager resourceManager = bus.getExtension(ResourceManager.class); resourceManager.addResourceResolver(new ServletContextResourceResolver(sc.getServletContext())); }
protected void configure(Bus bus, Object bean, String name, String extraName) { Configurer configurer = bus.getExtension(Configurer.class); if (null != configurer) { configurer.configureBean(name, bean); if (extraName != null) { configurer.configureBean(extraName, bean); } } }
private static DestinationRegistry getDestinationRegistryFromBus(Bus bus) { DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class); try { DestinationFactory df = dfm.getDestinationFactory("http://cxf.apache.org/transports/http/configuration"); if (df instanceof HTTPTransportFactory) { HTTPTransportFactory transportFactory = (HTTPTransportFactory) df; return transportFactory.getRegistry(); } } catch (BusException e) { // why are we throwing a busexception if the DF isn't found? } return null; }
public void init(ServletConfig sc) throws ServletException { // Setting this property because otherwise a file named // "wsdl.properties" will be read from the JRE, which is not possible // due to restrictive permissions System.setProperty("javax.wsdl.factory.WSDLFactory", "com.ibm.wsdl.factory.WSDLFactoryImpl"); if (this.bus == null) { loadBus(sc); } loader = bus.getExtension(ClassLoader.class); ResourceManager resourceManager = bus.getExtension(ResourceManager.class); resourceManager.addResourceResolver(new ServletContextResourceResolver(sc.getServletContext())); if (destinationRegistry == null) { this.destinationRegistry = getDestinationRegistryFromBus(this.bus); } this.controller = createServletController(sc); redirectList = parseListSequence(sc.getInitParameter(REDIRECTS_PARAMETER)); redirectQueryCheck = Boolean.valueOf(sc.getInitParameter(REDIRECT_QUERY_CHECK_PARAMETER)); dispatcherServletName = sc.getInitParameter(REDIRECT_SERVLET_NAME_PARAMETER); dispatcherServletPath = sc.getInitParameter(REDIRECT_SERVLET_PATH_PARAMETER); }
public HTTPWSDLExtensionLoader(Bus b) { WSDLManager manager = b.getExtension(WSDLManager.class); createExtensor(manager, javax.wsdl.Port.class, org.apache.cxf.transports.http.configuration.HTTPClientPolicy.class); createExtensor(manager, javax.wsdl.Port.class, org.apache.cxf.transports.http.configuration.HTTPServerPolicy.class); createExtensor(manager, javax.wsdl.Port.class, AddressType.class); } public void createExtensor(WSDLManager manager,
public void assertMessage(Message message) { PolicyDataEngine policyDataEngine = bus.getExtension(PolicyDataEngine.class); policyDataEngine.assertMessage(message, getClient(), new ClientPolicyCalculator()); }
public void assertMessage(Message message) { PolicyDataEngine pde = bus.getExtension(PolicyDataEngine.class); pde.assertMessage(message, calcServerPolicy(message), new ServerPolicyCalculator()); }
/** * 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); } } }
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); } }
protected InputStream getResourceAsStream(String path) { InputStream is = ClassLoaderUtils.getResourceAsStream(path, AbstractHTTPServlet.class); if (is == null && getBus() != null) { ResourceManager rm = getBus().getExtension(ResourceManager.class); if (rm != null) { is = rm.resolveResource(path, InputStream.class); } } return is; }
private synchronized HTTPServerPolicy calcServerPolicyInternal(Message m) { HTTPServerPolicy sp = serverPolicy; if (!serverPolicyCalced) { PolicyDataEngine pde = bus.getExtension(PolicyDataEngine.class); if (pde != null) { sp = pde.getServerEndpointPolicy(m, endpointInfo, this, new ServerPolicyCalculator()); } if (null == sp) { sp = endpointInfo.getTraversedExtensor( new HTTPServerPolicy(), HTTPServerPolicy.class); } serverPolicy = sp; serverPolicyCalced = true; } return sp; } private HTTPServerPolicy calcServerPolicy(Message m) {
public HTTPClientPolicy getClient(Message message) { ClientPolicyCalculator cpc = new ClientPolicyCalculator(); HTTPClientPolicy pol = message.get(HTTPClientPolicy.class); updateClientPolicy(message); if (pol != null) { pol = cpc.intersect(pol, clientSidePolicy); } else { pol = clientSidePolicy; } PolicyDataEngine policyDataEngine = bus.getExtension(PolicyDataEngine.class); if (policyDataEngine == null) { return pol; } return policyDataEngine.getPolicy(message, pol, cpc); }
public Server create() { ClassLoaderHolder orig = null; try { if (bus != null) { ClassLoader loader = bus.getExtension(ClassLoader.class); if (loader != null) { orig = ClassLoaderUtils.setThreadContextClassloader(loader); } } Server server = super.create(); initializeResourcesAndHandlerChain(server); checkPrivateEndpoint(server.getEndpoint()); return server; } finally { if (orig != null) { orig.reset(); } } }
@Before public void setUp() throws Exception { this.tika = new TikaConfig(getClass().getResourceAsStream("tika-config-for-server-tests.xml")); TikaResource.init(tika, new CommonsDigester(DIGESTER_READ_LIMIT, "md5,sha1:32"), new DefaultInputStreamFactory(), new ServerStatus(true)); JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); setUpResources(sf); setUpProviders(sf); sf.setAddress(endPoint + "/"); BindingFactoryManager manager = sf.getBus().getExtension( BindingFactoryManager.class ); JAXRSBindingFactory factory = new JAXRSBindingFactory(); factory.setBus(sf.getBus()); manager.registerBindingFactory( JAXRSBindingFactory.JAXRS_BINDING_ID, factory ); server = sf.create(); }