当前位置: 首页>>代码示例>>Java>>正文


Java ImmutableCollectionsInInterceptor类代码示例

本文整理汇总了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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:LazyRemoteServiceRegistryConnector.java

示例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.");

    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:RemoteTestHarness.java


注:本文中的org.kuali.rice.ksb.impl.cxf.interceptors.ImmutableCollectionsInInterceptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。