本文整理匯總了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.");
}
}