本文整理匯總了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);
}
}
示例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);
}
}
示例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() );
}