當前位置: 首頁>>代碼示例>>Java>>正文


Java Bus.setProperty方法代碼示例

本文整理匯總了Java中org.apache.cxf.Bus.setProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Bus.setProperty方法的具體用法?Java Bus.setProperty怎麽用?Java Bus.setProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.cxf.Bus的用法示例。


在下文中一共展示了Bus.setProperty方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testAysncClientWithPolicy

import org.apache.cxf.Bus; //導入方法依賴的package包/類
@Test
@RunAsClient
public void testAysncClientWithPolicy () throws Exception 
{
   Bus bus = BusFactory.newInstance().createBus();
   AsyncEnabledInfoInterceptor asyncInfo = new AsyncEnabledInfoInterceptor();
   try
   {
      bus.setProperty("use.async.http.conduit", "ASYNC_ONLY");
      bus.getOutInterceptors().add(asyncInfo);
      BusFactory.setThreadDefaultBus(bus);
      Endpoint proxy = initPort();
      assertEquals("Echo:1000", proxy.echo(1000));
      assertFalse("Async client is expected disabled", asyncInfo.isAsyncEnabled());
      assertEquals("Echo:1000", proxy.echoAsync(1000).get());
      assertTrue("Async client is expected enabled", asyncInfo.isAsyncEnabled());
   }
   finally
   {
      bus.shutdown(true);
   }
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:23,代碼來源:AsyncClientTestCase.java

示例2: loadBus

import org.apache.cxf.Bus; //導入方法依賴的package包/類
@Override
protected void loadBus(ServletConfig sc)
{
	Thread currentThread = Thread.currentThread();
	ClassLoader oldLoader = currentThread.getContextClassLoader();
	try
	{
		currentThread.setContextClassLoader(getClass().getClassLoader());
		Bus bus = new ExtensionManagerBus();
		setBus(bus);
		List<Extension> exts = interceptorTracker.getExtensions();
		List<Interceptor<? extends Message>> inInterceptors = bus.getInInterceptors();
		for( Extension extension : exts )
		{
			Collection<Parameter> inParams = extension.getParameters("inBean");
			for( Parameter inParam : inParams )
			{
				inInterceptors.add(interceptorTracker.getBeanByParameter(extension, inParam));
			}
			Collection<Parameter> outParams = extension.getParameters("outBean");
			for( Parameter outParam : outParams )
			{
				bus.getOutInterceptors().add(interceptorTracker.getBeanByParameter(extension, outParam));
			}
		}
		inInterceptors.add(new WebServiceContextIntercept());
		bus.setProperty("org.apache.cxf.logging.FaultListener", new SoapFaultListener());
	}
	finally
	{
		currentThread.setContextClassLoader(oldLoader);
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:34,代碼來源:CXFHandler.java

示例3: busRegistered

import org.apache.cxf.Bus; //導入方法依賴的package包/類
public void busRegistered( Bus bus )
{
    LOG.info( "Adding LoggingFeature interceptor on bus: " + bus.getId() );

    //********Set BUS Message Size to 500 KB ************************
    bus.setProperty( "bus.io.CachedOutputStream.Threshold", "500000" );
    System.setProperty( "org.apache.cxf.io.CachedOutputStream.Threshold", "500000" );
    LOG.info( "Setting CXF CachedOutputStream.Threshold size to: 500Kb " );
    //***************************************************************
    bus.setProperty( AsyncHTTPConduit.USE_ASYNC, Boolean.TRUE );
    //***************************************************************

    // initialise the feature on the bus, which will add the interceptors

    //***** RECEIVE    **********************************
    bus.getInInterceptors().add( new AccessControlInterceptor( identityManager ) );

    //***** PRE_STREAM **********************************
    bus.getOutInterceptors().add( new ClientOutInterceptor( securityManager, peerManager ) );

    //***** POST_LOGICAL **********************************
    bus.getOutInterceptors().add( new ClientHeaderInterceptor( peerManager ) );

    //***** RECEIVE    **********************************
    bus.getInInterceptors().add( new ServerInInterceptor( securityManager, peerManager ) );

    //***** PRE_STREAM **********************************
    bus.getOutInterceptors().add( new ServerOutInterceptor( securityManager, peerManager ) );

    //***** RECEIVE    **********************************
    bus.getInInterceptors().add( new ClientInInterceptor( securityManager, peerManager ) );


    LOG.info( "Successfully added LoggingFeature interceptor on bus: " + bus.getId() );
}
 
開發者ID:subutai-io,項目名稱:base,代碼行數:36,代碼來源:ServerBusListener.java


注:本文中的org.apache.cxf.Bus.setProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。