當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。