本文整理汇总了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() );
}