本文整理匯總了Java中org.jboss.resteasy.spi.ResteasyProviderFactory.getInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java ResteasyProviderFactory.getInstance方法的具體用法?Java ResteasyProviderFactory.getInstance怎麽用?Java ResteasyProviderFactory.getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jboss.resteasy.spi.ResteasyProviderFactory
的用法示例。
在下文中一共展示了ResteasyProviderFactory.getInstance方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: contextInitialized
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
public void contextInitialized(ServletContextEvent event) {
super.contextInitialized(event);
ResteasyProviderFactory dispatcher = ResteasyProviderFactory.getInstance();
dispatcher.registerProvider(OctetStreamWriter.class, false);
dispatcher.registerProvider(PlainTextReader.class, false);
restRuntime = new RestRuntime();
initPortalConfiguration(event);
restRuntime.start(dispatcher,
findConfigurationFile(event.getServletContext(), "log4j.properties"),
findConfigurationFile(event.getServletContext(),
File.separator + "config" + File.separator + "network" +
File.separator + "server.ini"));
}
示例2: init
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
@Override
public void init(ConnectionInfo connectionInfo) throws Exception {
HttpClient client = new HttpClientBuilder().insecure(connectionInfo.isInsecure()).useSystemProperties().build();
SchedulerRestClient restApiClient = new SchedulerRestClient(connectionInfo.getUrl(),
new ApacheHttpClient4Engine(client));
ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
factory.register(new WildCardTypeReader());
factory.register(new OctetStreamReader());
factory.register(new TaskResultReader());
setApiClient(restApiClient);
this.connectionInfo = connectionInfo;
this.initialized = true;
renewSession();
}
示例3: doRestCall
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
/**
* Get the deployment URL, create the RestEasy Client Proxy Invoker for the given TestMethod and return the result.
*
* @param testMethod
* @param httpMethods
* @return
*/
private Response doRestCall(Method testMethod, Set<String> httpMethods)
{
URI baseUri = getBaseURL();
ClientExecutor executor = ClientRequest.getDefaultExecutor();
ResteasyProviderFactory providerFactory = ResteasyProviderFactory.getInstance();
providerFactory.addBuiltInMessageBodyWriter(MyHeaderDecorator.class);
EntityExtractorFactory extractorFactory = new DefaultEntityExtractorFactory();
ArqClientInvoker invoker = new ArqClientInvoker(baseUri, testMethod.getDeclaringClass(), testMethod, providerFactory, executor,
extractorFactory);
invoker.getAttributes().putAll(new HashMap<String, Object>());
ClientInvokerInterceptorFactory.applyDefaultInterceptors(invoker, providerFactory, testMethod.getDeclaringClass(), testMethod);
invoker.setHttpMethod(httpMethods.iterator().next());
return invoker.request(new Object[] { null });
}
示例4: SchedulerRestClient
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
public SchedulerRestClient(String restEndpointURL, ClientHttpEngine httpEngine) {
this.restEndpointURL = restEndpointURL;
this.httpEngine = httpEngine;
providerFactory = ResteasyProviderFactory.getInstance();
if (!providerFactory.isRegistered(JacksonContextResolver.class)) {
providerFactory.registerProvider(JacksonContextResolver.class);
}
scheduler = createRestProxy(providerFactory, restEndpointURL, httpEngine);
}
示例5: initialise
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
/**
* Register Exception Mappers
*/
@PostConstruct
public void initialise() {
if(!configurationService.getBooleanConfiguration("testing.enabled", false)) {
ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
register(factory);
}
}
示例6: ResteasyClientFactoryImpl
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
@Inject
public ResteasyClientFactoryImpl(final ShutdownManager manager,
final RemoteExceptionClientResponseFilter remoteExceptionClientResponseFilter,
final JAXBContextResolver jaxbContextResolver)
{
this.resteasyProviderFactory = ResteasyProviderFactory.getInstance();
resteasyProviderFactory.registerProviderInstance(jaxbContextResolver);
// Register the joda param converters
resteasyProviderFactory.registerProviderInstance(new CommonTypesParamConverterProvider());
// Register the LogReport reader
// TODO find a better way to handle registration for external applications?
resteasyProviderFactory.registerProviderInstance(new LogReportMessageBodyWriter());
// Register the exception processor
if (remoteExceptionClientResponseFilter != null)
resteasyProviderFactory.registerProviderInstance(remoteExceptionClientResponseFilter);
// Set up the Connection Manager
this.connectionManager = new PoolingHttpClientConnectionManager();
connectionManager.setDefaultMaxPerRoute(maxConnectionsPerRoute);
connectionManager.setMaxTotal(maxConnectionsTotal);
if (manager != null)
manager.register(this);
}
示例7: setUp
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
/** Setup the test environment. */
protected void setUp() {
ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
factory.addMessageBodyReader(new JacksonJsonProvider());
RegisterBuiltin.register(factory);
}
示例8: createTokenService
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
TokenService createTokenService() {
ResteasyProviderFactory pf = ResteasyProviderFactory.getInstance();
pf.addClientErrorInterceptor(clientErrorInterceptor);
return ProxyFactory.create(TokenService.class,
config.getServerUrl());
}
示例9: getInstance
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
public ResteasyProviderFactory getInstance() {
if (instance == null) {
instance = ResteasyProviderFactory.getInstance();
}
return this.instance;
}
示例10: initialize
import org.jboss.resteasy.spi.ResteasyProviderFactory; //導入方法依賴的package包/類
@PostConstruct
protected void initialize() {
ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
register(factory);
}