当前位置: 首页>>代码示例>>Java>>正文


Java DestinationRegistry类代码示例

本文整理汇总了Java中org.apache.cxf.transport.http.DestinationRegistry的典型用法代码示例。如果您正苦于以下问题:Java DestinationRegistry类的具体用法?Java DestinationRegistry怎么用?Java DestinationRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DestinationRegistry类属于org.apache.cxf.transport.http包,在下文中一共展示了DestinationRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initFrameworkServlet

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的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

示例2: getDestinationRegistryFromBus

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的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

示例3: UndertowServerDestination

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
public UndertowServerDestination(Bus b, DestinationRegistry registry, EndpointInfo ei) throws IOException
{
   super(b, registry, ei);
   this.serverEngineFactory = getServerEngineFactory();
   getAddressValue(ei, true); //generate address if not specified
   this.url = new URL(ei.getAddress());
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:8,代码来源:UndertowServerDestination.java

示例4: handleRequest

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的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: HttpServerDestination

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
public HttpServerDestination(Bus b, DestinationRegistry registry, EndpointInfo ei) throws IOException
{
   super(b, registry, ei);
   this.serverEngineFactory = getServerEngineFactory();
   getAddressValue(ei, true); //generate address if not specified
   this.url = new URL(ei.getAddress());
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:8,代码来源:HttpServerDestination.java

示例6: getDestinationRegistryFromBus

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的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: UndertowHTTPDestination

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param bus the associated Bus
 * @param registry the associated destinationRegistry
 * @param ei the endpoint info of the destination
 * @throws java.io.IOException
 */
public UndertowHTTPDestination(Bus bus, DestinationRegistry registry, EndpointInfo ei) throws IOException {
    //Add the default port if the address is missing it
    super(bus, registry, ei, getAddressValue(ei, true).getAddress(), true);
    this.serverEngineFactory = bus.getExtension(HttpServerEngineFactory.class);
    if (serverEngineFactory != null) {
        nurl = new URL(getAddress(endpointInfo));
    }
    loader = bus.getExtension(ClassLoader.class);
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:18,代码来源:UndertowHTTPDestination.java

示例8: TestServiceServlet

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
/**
 * @see org.apache.cxf.transport.servlet.CXFNonSpringServlet#CXFNonSpringServlet(org.apache.cxf.transport.http.DestinationRegistry)
 */
public TestServiceServlet(DestinationRegistry destinationRegistry) {
    super(destinationRegistry);
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:7,代码来源:TestServiceServlet.java

示例9: findDestination

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
/**
 * Finds destination based on request URI
 * @param requestURI to be recognized
 * @return destination associated with the request URI
 * @throws ServletException when destination wasn't found
 */
private AbstractHTTPDestination findDestination(HttpServletRequest req, Bus bus) throws ServletException
{
   // Find destination based on request URI
   String requestURI = req.getRequestURI();
   DestinationRegistry destRegistry = getDestinationRegistryFromBus(bus);
   if (destRegistry == null)
   {
      throw Messages.MESSAGES.cannotObtainRegistry(DestinationRegistry.class.getName());
   }
   requestURI = pathPattern.matcher(requestURI).replaceAll("/");
   //first try looking up the destination in the registry map
   final AbstractHTTPDestination dest = destRegistry.getDestinationForPath(requestURI, true);
   if (dest != null) {
      return dest;
   }
   //if there's no direct match, iterate on the destinations to see if there's valid "catch-all" destination
   //(servlet-based endpoints, with "/*" url-pattern in web.xml)
   Collection<AbstractHTTPDestination> destinations = destRegistry.getDestinations();
   AbstractHTTPDestination returnValue = null;
   for (AbstractHTTPDestination destination : destinations)
   {
      String path = destination.getEndpointInfo().getAddress();
      try
      {
         path = new URL(path).getPath();
      }
      catch (MalformedURLException ex)
      {
         // ignore
         Logger.getLogger(RequestHandlerImpl.class).trace(ex);
      }

      if (path != null && requestURI.startsWith(path)) {
         returnValue = destination;
      }
   }

   if (returnValue == null)
      throw Messages.MESSAGES.cannotObtainDestinationFor(requestURI);

   return returnValue;
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:49,代码来源:RequestHandlerImpl.java

示例10: createDestination

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
@Override
public AbstractHTTPDestination createDestination(EndpointInfo endpointInfo, Bus bus, DestinationRegistry registry)
      throws IOException
{
   return new UndertowServerDestination(bus, registry, endpointInfo);
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:7,代码来源:UndertowServerDestinationFactory.java

示例11: PublishingServlet

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
public PublishingServlet(DestinationRegistry destinationRegistry,
		boolean loadBus) {
	super(destinationRegistry, loadBus);

}
 
开发者ID:SAP,项目名称:Lapwing,代码行数:6,代码来源:PublishingServlet.java

示例12: ServiceServletController

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
public ServiceServletController(DestinationRegistry destReg) throws ServletException {
    super(destReg, ServiceController.this.servletConfig, new ServiceListGeneratorServlet(destReg, ServiceController.this.bus));

    this.serviceListRelativePath = ServiceController.this.listPath;
}
 
开发者ID:esacinc,项目名称:crigtt,代码行数:6,代码来源:ServiceController.java

示例13: createDestination

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
@Override
public AbstractHTTPDestination createDestination(EndpointInfo endpointInfo, Bus bus, DestinationRegistry registry)
      throws IOException
{
   return new HttpServerDestination(bus, registry, endpointInfo);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:7,代码来源:HttpServerDestinationFactory.java

示例14: createDestination

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
@Override
public AbstractHTTPDestination createDestination(final EndpointInfo endpointInfo, final Bus bus,
                                                 final DestinationRegistry registry) throws IOException {
    return new HttpDestination(bus, registry, endpointInfo, endpointInfo.getAddress());
}
 
开发者ID:apache,项目名称:tomee,代码行数:6,代码来源:OpenEJBHttpDestinationFactory.java

示例15: HttpDestination

import org.apache.cxf.transport.http.DestinationRegistry; //导入依赖的package包/类
public HttpDestination(Bus bus, DestinationRegistry registry, EndpointInfo endpointInfo, String path) throws IOException {
    super(bus, registry, endpointInfo, path, true);
}
 
开发者ID:apache,项目名称:tomee,代码行数:4,代码来源:HttpDestination.java


注:本文中的org.apache.cxf.transport.http.DestinationRegistry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。