本文整理汇总了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);
}