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


Java BusFactory.createBus方法代码示例

本文整理汇总了Java中org.apache.cxf.BusFactory.createBus方法的典型用法代码示例。如果您正苦于以下问题:Java BusFactory.createBus方法的具体用法?Java BusFactory.createBus怎么用?Java BusFactory.createBus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cxf.BusFactory的用法示例。


在下文中一共展示了BusFactory.createBus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.apache.cxf.BusFactory; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    super.setUp();
    BusFactory bf = BusFactory.newInstance();
    //setup the camel transport for the bus
    bus = bf.createBus();
    DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
    CamelTransportFactory camelTransportFactory = new CamelTransportFactory();
    //set the context here to the transport factory;
    camelTransportFactory.setCamelContext(context);
    ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
    dfm.registerDestinationFactory(CamelTransportFactory.TRANSPORT_ID, camelTransportFactory);
    cim.registerConduitInitiator(CamelTransportFactory.TRANSPORT_ID, camelTransportFactory);
    BusFactory.setDefaultBus(bus);
    endpointInfo = new EndpointInfo();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:CamelTransportTestSupport.java

示例2: testBusCreation

import org.apache.cxf.BusFactory; //导入方法依赖的package包/类
public static void testBusCreation() throws BusTestException
{
   Bus initialDefaultBus = BusFactory.getDefaultBus(false);
   Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
   BusFactory factory = BusFactory.newInstance();
   Bus bus = factory.createBus();
   assert (bus != null);
   if (initialThreadBus == null) //if the thread bus was not set before, it should now be
   {
      checkThreadBus(bus);
   }
   checkDefaultBus(initialDefaultBus);
   BusFactory.setThreadDefaultBus(initialThreadBus);
   checkThreadBus(initialThreadBus);
   checkDefaultBus(initialDefaultBus);
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:17,代码来源:AbstractClient.java

示例3: testWebServiceRef

import org.apache.cxf.BusFactory; //导入方法依赖的package包/类
public static void testWebServiceRef(Endpoint port) throws BusTestException
{
   Bus initialDefaultBus = BusFactory.getDefaultBus(false);
   Bus threadBus = BusFactory.getThreadDefaultBus(false);
   performInvocation(port); //does not change anything to the bus, as the port is already created when injecting serviceref
   checkDefaultBus(initialDefaultBus);
   checkThreadBus(threadBus);
   try
   {
      BusFactory.setThreadDefaultBus(null);
      performInvocation(port); //does not change anything to the bus, as the port is already created when injecting serviceref
      checkDefaultBus(initialDefaultBus);
      checkThreadBus(null);
      BusFactory factory = BusFactory.newInstance();
      Bus bus = factory.createBus(); //internally sets the thread bus
      performInvocation(port); //does not change anything to the bus, as the port is already created when injecting serviceref
      checkDefaultBus(initialDefaultBus);
      checkThreadBus(bus);
   }
   finally
   {
      BusFactory.setThreadDefaultBus(threadBus);
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:25,代码来源:AbstractClient.java

示例4: testJBossWSCXFBus

import org.apache.cxf.BusFactory; //导入方法依赖的package包/类
/**
 * Verify the BusFactory.newInstance() still return the JBossWS-CXF version of BusFactory
 * (the web app has a dependency on jbossws-cxf-client) and that still create a plain bus
 * version, without being fooled by the Spring availability in the TCCL when Spring is not
 * installed in the AS.
 * 
 * @return
 */
public boolean testJBossWSCXFBus()
{
   BusFactory factory = BusFactory.newInstance();
   if (!(factory instanceof JBossWSBusFactory))
   {
      throw new RuntimeException("Expected JBossWSBusFactory");
   }
   Bus bus = null;
   try
   {
      //set Configurer.USER_CFG_FILE_PROPERTY_NAME so that if the SpringBusFactory is
      //internally erroneously used, that won't fallback delegating to the non Spring
      //one, which would shade the issue
      final String prop = System.getProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME);
      try
      {
         System.setProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME, "unexistentfile.xml");
         bus = factory.createBus();
         //the created bus should not be a SpringBus, as the classloader for CXF has no visibility over the deployment spring jars 
         return !isSpringBus(bus);
      }
      finally
      {
         if (prop == null)
         {
            System.clearProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME);
         }
         else
         {
            System.setProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME, prop);
         }
      }
   }
   finally
   {
      if (bus != null)
      {
         bus.shutdown(true);
      }
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:50,代码来源:Helper.java


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