本文整理匯總了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;
}