当前位置: 首页>>代码示例>>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;未经允许,请勿转载。