本文整理汇总了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;
}
示例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);
}
示例3: RESTConnector
import org.kuali.rice.ksb.api.bus.support.RestServiceConfiguration; //导入依赖的package包/类
public RESTConnector(final RestServiceConfiguration serviceConfiguration, final URL alternateEndpointUrl) {
super(serviceConfiguration, alternateEndpointUrl);
}
示例4: getServiceConfiguration
import org.kuali.rice.ksb.api.bus.support.RestServiceConfiguration; //导入依赖的package包/类
@Override
public RestServiceConfiguration getServiceConfiguration() {
return (RestServiceConfiguration)super.getServiceConfiguration();
}
示例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;
}