本文整理汇总了Java中org.apache.cxf.transport.http.HTTPTransportFactory类的典型用法代码示例。如果您正苦于以下问题:Java HTTPTransportFactory类的具体用法?Java HTTPTransportFactory怎么用?Java HTTPTransportFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HTTPTransportFactory类属于org.apache.cxf.transport.http包,在下文中一共展示了HTTPTransportFactory类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createConduit
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
@Override
public HTTPConduit createConduit(HTTPTransportFactory f, Bus b, EndpointInfo localInfo, EndpointReferenceType target)
throws IOException
{
HTTPConduit conduit = null;
if (delegate != null)
{
conduit = delegate.createConduit(f, b, localInfo, target);
}
else
{
conduit = createNewConduit(f, b, localInfo, target);
}
if (conduit != null)
{
configureConduit(conduit);
}
return conduit;
}
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:20,代码来源:AbstractHTTPConduitFactoryWrapper.java
示例2: initFrameworkServlet
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
@Override
protected void initFrameworkServlet() throws ServletException, BeansException {
this.httpInvokerHandler = new KSBHttpInvokerHandler();
Bus bus = KSBServiceLocator.getCXFBus();
List<Interceptor<? extends Message>> inInterceptors = KSBServiceLocator.getInInterceptors();
if(inInterceptors != null) {
List<Interceptor<? extends Message>> busInInterceptors = bus.getInInterceptors();
busInInterceptors.addAll(inInterceptors);
}
List<Interceptor<? extends Message>> outInterceptors = KSBServiceLocator.getOutInterceptors();
if(outInterceptors != null) {
List<Interceptor<? extends Message>> busOutInterceptors = bus.getOutInterceptors();
busOutInterceptors.addAll(outInterceptors);
}
HTTPTransportFactory transportFactory = bus.getExtension(HTTPTransportFactory.class);
if (transportFactory == null) {
throw new IllegalStateException("Failed to locate HTTPTransportFactory extension on Apache CXF Bus");
}
DestinationRegistry destinationRegistry = transportFactory.getRegistry();
this.cxfServletController = new ServletController(destinationRegistry, getCXFServletConfig(
this.getServletConfig()), new ServiceListGeneratorServlet(destinationRegistry, bus));
this.setPublishEvents(false);
}
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:KSBDispatcherServlet.java
示例3: getDestinationRegistryFromBus
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
private static DestinationRegistry getDestinationRegistryFromBus(Bus bus) throws ServletException {
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) {
throw Messages.MESSAGES.cannotObtainDestinationFactoryForHttpTransport(e);
}
return null;
}
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:15,代码来源:RequestHandlerImpl.java
示例4: handleRequest
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
@Nullable
@Override
public ModelAndView handleRequest(HttpServletRequest servletReq, HttpServletResponse servletResp) throws Exception {
String destPath = StringUtils.prependIfMissing(
StringUtils.removeStart(((String) servletReq.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE)), this.baseUrlPath),
SdcctStringUtils.SLASH), txId;
DestinationRegistry destReg =
((HTTPTransportFactory) this.bus.getExtension(DestinationFactoryManager.class).getDestinationFactoryForUri(HTTP_TRANSPORT_NS_URI)).getRegistry();
AbstractHTTPDestination dest = destReg.getDestinationForPath(destPath, true);
if (dest == null) {
dest = destReg.checkRestfulRequest(destPath);
}
if (dest != null) {
servletReq.setAttribute(ENDPOINT_ADDR_SERVLET_REQ_ATTR_NAME, (this.baseUrlPath + dest.getEndpointInfo().getAddress()));
try {
MDC.put(SdcctPropertyNames.WS_SERVER_TX_ID, (txId = this.txIdGen.generateId().toString()));
servletReq.setAttribute(SdcctPropertyNames.HTTP_SERVER_TX_ID, txId);
BusFactory.setThreadDefaultBus(bus);
dest.invoke(this.servletConfig, this.servletContext, servletReq, servletResp);
} finally {
BusFactory.setThreadDefaultBus(null);
MDC.remove(SdcctPropertyNames.WS_SERVER_TX_ID);
}
} else {
// TODO: improve error handling
LOGGER.error(String.format("Unable to determine CXF destination (path=%s) for request.", destPath));
servletResp.setStatus(HttpStatus.NOT_FOUND.value());
}
return null;
}
开发者ID:esacinc,项目名称:sdcct,代码行数:40,代码来源:WebServiceController.java
示例5: afterPropertiesSet
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
this.bus.getExtension(ResourceManager.class).addResourceResolver(new ServletContextResourceResolver(this.servletConfig.getServletContext()));
this.servletController =
new ServiceServletController(((HTTPTransportFactory) this.bus.getExtension(DestinationFactoryManager.class).getDestinationFactoryForUri(
HTTPTransportFactory.DEFAULT_NAMESPACES.get(0))).getRegistry());
}
开发者ID:esacinc,项目名称:crigtt,代码行数:9,代码来源:ServiceController.java
示例6: getDestinationRegistryFromBus
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
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;
}
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:14,代码来源:GenericWebServiceServlet.java
示例7: createNewConduit
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
protected HTTPConduit createNewConduit(HTTPTransportFactory f, Bus b, EndpointInfo localInfo,
EndpointReferenceType target) throws IOException
{
return new URLConnectionHTTPConduit(b, localInfo, target);
}
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:6,代码来源:DefaultHTTPConduitFactoryWrapper.java
示例8: beforeStart
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
@Override
protected void beforeStart() {
super.beforeStart();
destinationFactory = new HTTPTransportFactory();
}
开发者ID:apache,项目名称:tomee,代码行数:6,代码来源:CxfRSService.java
示例9: createHttpListener
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
@Override
protected RsHttpListener createHttpListener() {
return new CxfRsHttpListener(!factoryByListener ? destinationFactory : new HTTPTransportFactory(), getWildcard(), this);
}
开发者ID:apache,项目名称:tomee,代码行数:5,代码来源:CxfRSService.java
示例10: messageTo
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
private Message messageTo(String requestBaseURL, String requestPath) {
Message message = new SoapMessage(Soap11.getInstance());
String requestURL = requestBaseURL + requestPath;
message.put(Message.ENDPOINT_ADDRESS, requestURL);
message.put(Message.BASE_PATH, requestBaseURL);
message.put(Message.REQUEST_URI, requestURL);
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put(Client.REQUEST_CONTEXT, new HashMap<String, Object>());
message.put(Message.INVOCATION_CONTEXT, ctx);
CXFBusImpl bus = new CXFBusImpl();
BindingFactoryManagerImpl bindingFactoryManager = new BindingFactoryManagerImpl();
bindingFactoryManager.registerBindingFactory("abc", new JAXRSBindingFactory());
bus.setExtension(bindingFactoryManager, BindingFactoryManager.class);
Map<String, ConduitInitiator> conduitInitiators = new HashMap<String, ConduitInitiator>();
ConduitInitiator ci = new HTTPTransportFactory(bus);
conduitInitiators.put(ENDPOINT_TRANSPORT_ID, ci);
ConduitInitiatorManagerImpl cim = new ConduitInitiatorManagerImpl(conduitInitiators);
bus.setExtension(cim, ConduitInitiatorManager.class);
Exchange exchange = exchange(message);
exchange.put(Bus.class, bus);
EndpointInfo ei = new EndpointInfo();
ei.setAddress("http://abc123");
BindingInfo b = new BindingInfo(null, "abc");
ei.setBinding(b);
Endpoint endpointMock = mock(Endpoint.class);
when(endpointMock.getEndpointInfo()).thenReturn(ei);
exchange.put(Endpoint.class, endpointMock);
message.setExchange(exchange);
message.setContent(List.class, new ArrayList<String>());
circuitBreakerTargetSelector.prepare(message);
InvocationKey key = new InvocationKey(exchange);
InvocationContext invocation = circuitBreakerTargetSelector.getInvocation(key);
invocation.getContext().put(Message.ENDPOINT_ADDRESS, requestPath);
invocation.getContext().put("org.apache.cxf.request.uri", requestPath);
return message;
}
开发者ID:jaceko,项目名称:cxf-circuit-switcher,代码行数:43,代码来源:CircuitSwitcherTargetSelectorTest.java
示例11: createNewConduit
import org.apache.cxf.transport.http.HTTPTransportFactory; //导入依赖的package包/类
/**
* Creates a new HTTPConduit instance; this is used internally when no delegate is available for getting a HTTPConduit instance to configure
*
* @param f The current HTTPTransportFactory
* @param b The current Bus
* @param localInfo The current EndpointInfo
* @param target The EndpointReferenceType
* @return A new HTTPConduit instance
* @throws IOException
*/
protected abstract HTTPConduit createNewConduit(HTTPTransportFactory f, Bus b, EndpointInfo localInfo,
EndpointReferenceType target) throws IOException;
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:13,代码来源:AbstractHTTPConduitFactoryWrapper.java
注:本文中的org.apache.cxf.transport.http.HTTPTransportFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论