當前位置: 首頁>>代碼示例>>Java>>正文


Java RestServiceConfiguration類代碼示例

本文整理匯總了Java中org.kuali.rice.ksb.api.bus.support.RestServiceConfiguration的典型用法代碼示例。如果您正苦於以下問題:Java RestServiceConfiguration類的具體用法?Java RestServiceConfiguration怎麽用?Java RestServiceConfiguration使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RestServiceConfiguration類屬於org.kuali.rice.ksb.api.bus.support包,在下文中一共展示了RestServiceConfiguration類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ResourceFacadeImpl

import org.kuali.rice.ksb.api.bus.support.RestServiceConfiguration; //導入依賴的package包/類
public ResourceFacadeImpl(final RestServiceConfiguration serviceConfiguration, URL actualEndpointUrl) {
	if (serviceConfiguration == null) {
		throw new IllegalArgumentException("serviceConfiguration cannot be null");
	}
	if (actualEndpointUrl == null) {
		throw new IllegalArgumentException("actual endpoint url cannot be null");
	}
	this.serviceConfiguration = serviceConfiguration;
	this.actualEndpointUrl = actualEndpointUrl;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:11,代碼來源:ResourceFacadeImpl.java

示例2: getServiceProxyWithFailureMode

import org.kuali.rice.ksb.api.bus.support.RestServiceConfiguration; //導入依賴的package包/類
protected <R> R getServiceProxyWithFailureMode(final Class<R> resourceClass, final Object service, final RestServiceConfiguration serviceConfiguration) {
	Object bamWrappedClientProxy = BAMClientProxy.wrap(service, serviceConfiguration);
	Object proxy = BusClientFailureProxy.wrap(bamWrappedClientProxy, serviceConfiguration);
	if (!resourceClass.isInstance(proxy)) {
		throw new IllegalArgumentException("Wrapped proxy is of the wrong type " + proxy.getClass() + ", expected " + resourceClass);
	}
	return resourceClass.cast(proxy);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:9,代碼來源:ResourceFacadeImpl.java

示例3: RESTConnector

import org.kuali.rice.ksb.api.bus.support.RestServiceConfiguration; //導入依賴的package包/類
public RESTConnector(final RestServiceConfiguration serviceConfiguration, final URL alternateEndpointUrl) {
	super(serviceConfiguration, alternateEndpointUrl);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:4,代碼來源:RESTConnector.java

示例4: getServiceConfiguration

import org.kuali.rice.ksb.api.bus.support.RestServiceConfiguration; //導入依賴的package包/類
@Override
public RestServiceConfiguration getServiceConfiguration() {
	return (RestServiceConfiguration)super.getServiceConfiguration();
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:5,代碼來源:RESTConnector.java

示例5: getServiceConnector

import org.kuali.rice.ksb.api.bus.support.RestServiceConfiguration; //導入依賴的package包/類
public static ServiceConnector getServiceConnector(
		final ServiceConfiguration serviceConfiguration) {
	final CredentialsSourceFactory credentialsSourceFactory = (CredentialsSourceFactory) ConfigContext
			.getCurrentContextConfig().getObjects()
			.get(Config.CREDENTIALS_SOURCE_FACTORY);
	final CredentialsSource credentialsSource = credentialsSourceFactory != null ? credentialsSourceFactory
			.getCredentialsForType(serviceConfiguration.getCredentialsType()) : null;
	ServiceConnector serviceConnector = null;

	if (serviceConfiguration.getCredentialsType() != null && credentialsSource == null) {
		throw new RiceRuntimeException("Service requires credentials but no factory or CredentialsSource could be located.");
	}

	String alternateEndpoint = determineAlternateEndpoint(serviceConfiguration);
	URL alternateEndpointUrl = null;
	if (!StringUtils.isBlank(alternateEndpoint)) {
		try {
			alternateEndpointUrl = new URL(alternateEndpoint);
		} catch (MalformedURLException e) {
			throw new IllegalStateException("Encountered invalid alternate endpoint url: " + alternateEndpoint, e);
		}
	}
	
	// TODO switch this to use serviceConfiguration.getType() at some point in the future and allow for
	// this to be easily "pluggable" with new connector types
	//
	// if set in local mode then preempt any protocol connectors
	if (ConfigContext.getCurrentContextConfig().getDevMode()) {
		serviceConnector = new BusLocalConnector(serviceConfiguration);
	} else if (serviceConfiguration instanceof JavaServiceConfiguration) {
		serviceConnector = new HttpInvokerConnector((JavaServiceConfiguration) serviceConfiguration, alternateEndpointUrl);
	} else if (serviceConfiguration instanceof SoapServiceConfiguration) {
		serviceConnector = new SOAPConnector((SoapServiceConfiguration) serviceConfiguration, alternateEndpointUrl);
	} else if (serviceConfiguration instanceof RestServiceConfiguration) {
		serviceConnector = new RESTConnector((RestServiceConfiguration) serviceConfiguration, alternateEndpointUrl);
	}

	if (serviceConnector == null) {
		throw new RiceRuntimeException("Don't support service type of "	+ serviceConfiguration);
	}
	serviceConnector.setCredentialsSource(credentialsSource);

	return serviceConnector;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:45,代碼來源:ServiceConnectorFactory.java


注:本文中的org.kuali.rice.ksb.api.bus.support.RestServiceConfiguration類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。