本文整理汇总了Java中org.kuali.rice.ksb.impl.cxf.interceptors.ImmutableCollectionsInInterceptor类的典型用法代码示例。如果您正苦于以下问题:Java ImmutableCollectionsInInterceptor类的具体用法?Java ImmutableCollectionsInInterceptor怎么用?Java ImmutableCollectionsInInterceptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ImmutableCollectionsInInterceptor类属于org.kuali.rice.ksb.impl.cxf.interceptors包,在下文中一共展示了ImmutableCollectionsInInterceptor类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeRemoteServiceRegistry
import org.kuali.rice.ksb.impl.cxf.interceptors.ImmutableCollectionsInInterceptor; //导入依赖的package包/类
protected ServiceRegistry initializeRemoteServiceRegistry() {
String registryBootstrapUrl = ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.REGISTRY_SERVICE_URL);
if (StringUtils.isBlank(registryBootstrapUrl)) {
throw new RiceRuntimeException("Failed to load registry bootstrap service from url: " + registryBootstrapUrl);
}
ClientProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
clientFactory.setServiceClass(ServiceRegistry.class);
clientFactory.setBus(cxfBus);
clientFactory.setAddress(registryBootstrapUrl);
boolean registrySecurity = ConfigContext.getCurrentContextConfig().getBooleanProperty(SERVICE_REGISTRY_SECURITY_CONFIG, true);
// Set security interceptors
clientFactory.getOutInterceptors().add(new CXFWSS4JOutInterceptor(registrySecurity));
clientFactory.getInInterceptors().add(new CXFWSS4JInInterceptor(registrySecurity));
//Set transformation interceptors
clientFactory.getInInterceptors().add(new ImmutableCollectionsInInterceptor());
Object service = clientFactory.create();
if (!(service instanceof ServiceRegistry)) {
throw new RiceRuntimeException("Endpoint to service registry at URL '" + registryBootstrapUrl + "' was not an instance of ServiceRegistry, instead was: " + service);
}
return (ServiceRegistry)service;
}
示例2: publishEndpointAndReturnProxy
import org.kuali.rice.ksb.impl.cxf.interceptors.ImmutableCollectionsInInterceptor; //导入依赖的package包/类
@SuppressWarnings("unchecked")
/**
* Creates a published endpoint from the passed in serviceImplementation and also returns a proxy implementation
* of the passed in interface for clients to use to hit the created endpoint.
*/
public <T> T publishEndpointAndReturnProxy(Class<T> jaxWsAnnotatedInterface, T serviceImplementation) {
if (jaxWsAnnotatedInterface.isInterface() &&
jaxWsAnnotatedInterface.getAnnotation(WebService.class) != null &&
jaxWsAnnotatedInterface.isInstance(serviceImplementation)) {
String endpointUrl = getAvailableEndpointUrl();
LOG.info("Publishing service to: " + endpointUrl);
endpoint = Endpoint.publish(endpointUrl, serviceImplementation);
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(jaxWsAnnotatedInterface);
factory.setAddress(endpointUrl);
T serviceProxy = (T) factory.create();
/* Add the ImmutableCollectionsInInterceptor to mimic interceptors added in the KSB */
Client cxfClient = ClientProxy.getClient(serviceProxy);
cxfClient.getInInterceptors().add(new ImmutableCollectionsInInterceptor());
return serviceProxy;
} else {
throw new IllegalArgumentException("Passed in interface class type must be annotated with @WebService " +
"and object reference must be an implementing class of that interface.");
}
}