org.jboss.resteasy.spi.Registry.addSingletonResource()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中org.jboss.resteasy.spi.Registry.addSingletonResource方法的一些代码示例,展示了Registry.addSingletonResource的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Registry.addSingletonResource方法的具体详情如下:
包路径:org.jboss.resteasy.spi.Registry
类名称:Registry
方法名:addSingletonResource

Registry.addSingletonResource介绍

[英]Add a JAX-RS endpoint.
[中]添加一个JAX-RS端点。

代码示例

代码示例来源:origin: resteasy/Resteasy

@Override
public void addSingletonResource(Object singleton, ResourceClass resourceClass, String basePath)
{
 delegate.addSingletonResource(singleton, resourceClass, basePath);
}

代码示例来源:origin: resteasy/Resteasy

@Override
public void addSingletonResource(Object singleton)
{
 delegate.addSingletonResource(singleton);
}

代码示例来源:origin: resteasy/Resteasy

@Override
public void addSingletonResource(Object singleton, ResourceClass resourceClass)
{
 delegate.addSingletonResource(singleton, resourceClass);
}

代码示例来源:origin: resteasy/Resteasy

@Override
public void addSingletonResource(Object singleton, String basePath)
{
 delegate.addSingletonResource(singleton, basePath);
}

代码示例来源:origin: resteasy/Resteasy

public void start()
{
 cache = new Cache(maxCacheSize);
 jobs = Collections.synchronizedMap(cache);
 if (executor == null) executor = Executors.newFixedThreadPool(threadPoolSize);
 registry.addSingletonResource(this, basePath);
}

代码示例来源:origin: resteasy/Resteasy

for (Object obj : providers) providerFactory.registerProviderInstance(obj);
for (Class clazz : actualResourceClasses) dispatcher.getRegistry().addPerRequestResource(clazz);
for (Object obj : resources) dispatcher.getRegistry().addSingletonResource(obj);

代码示例来源:origin: resteasy/Resteasy

registry.addSingletonResource(obj);

代码示例来源:origin: org.jboss.resteasy/resteasy-vertx

@Override
public void addSingletonResource(Object singleton, ResourceClass resourceClass)
{
 delegate.addSingletonResource(singleton, resourceClass);
}

代码示例来源:origin: org.jboss.resteasy/resteasy-vertx

@Override
public void addSingletonResource(Object singleton, ResourceClass resourceClass, String basePath)
{
 delegate.addSingletonResource(singleton, resourceClass, basePath);
}

代码示例来源:origin: org.jboss.resteasy/resteasy-vertx

@Override
public void addSingletonResource(Object singleton)
{
 delegate.addSingletonResource(singleton);
}

代码示例来源:origin: org.jboss.resteasy/resteasy-vertx

@Override
public void addSingletonResource(Object singleton, String basePath)
{
 delegate.addSingletonResource(singleton, basePath);
}

代码示例来源:origin: org.jboss.resteasy/resteasy-core

public void start()
{
 cache = new Cache(maxCacheSize);
 jobs = Collections.synchronizedMap(cache);
 if (executor == null) executor = Executors.newFixedThreadPool(threadPoolSize);
 registry.addSingletonResource(this, basePath);
}

代码示例来源:origin: org.jboss.resteasy/resteasy-jaxrs-20

public void start()
{
 cache = new Cache(maxCacheSize);
 jobs = Collections.synchronizedMap(cache);
 if (executor == null) executor = Executors.newFixedThreadPool(threadPoolSize);
 registry.addSingletonResource(this, basePath);
}

代码示例来源:origin: zhuzhengquan/pc5s

@Override
public void init(ServletConfig servletConfig) throws ServletException {
  super.init(servletConfig);
  
  Map<String,Object> restMap = applicationContext.getBeansWithAnnotation(javax.ws.rs.Path.class);
  Iterator<String> iterator = restMap.keySet().iterator();
  while(iterator.hasNext()){
    String key = iterator.next();
    this.servletContainerDispatcher.getDispatcher().getRegistry().addSingletonResource(restMap.get(key));
  }
  
}

代码示例来源:origin: org.switchyard.components/switchyard-component-resteasy

/**
 * Registers RESTEasy resources to the registered RESTEasy servlet.
 * @param alias alias
 * @param resources resource instances
 * @return classes of the registered resources
 */
public List<Class<?>> registerRESTEasyResources(String alias, List<Object> resources) {
  OsgiRESTEasyServletWrapper servlet = getRegisteredRESTEasyServlet(alias);
  if (servlet == null) {
    throw new IllegalArgumentException("No servlet is registered for the alias '" + alias + "'");
  }
  Registry registry = servlet.getDispatcher().getRegistry();
  List<Class<?>> classes = new ArrayList<Class<?>>();
  for (Object instance : resources) {
    registry.addSingletonResource(instance);
    classes.add(instance.getClass());
  }
  return classes;
}

代码示例来源:origin: info.magnolia.rest/magnolia-rest-integration

/**
 * Allows an endpoint to be registered for the servlet without actually being in the registry.
 * This is used for REST Tools in particular; otherwise {@link #registerEndpoint(DefinitionProvider)} should be preferred.
 */
protected Object registerEndpoint(EndpointDefinition endpointDefinition) {
  if (!endpointDefinition.isEnabled()) {
    return null;
  }
  Object endpoint = instantiateEndpoint(endpointDefinition);
  endpoints.put(endpointDefinition.getName(), endpoint);
  super.getDispatcher().getRegistry().addSingletonResource(endpoint);
  return endpoint;
}

代码示例来源:origin: org.apache.activemq.rest/artemis-rest

public void start() throws Exception {
 embeddedActiveMQ.start();
 tjws.start();
 manager.start();
 tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
 tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
}

代码示例来源:origin: apache/activemq-artemis

public void start() throws Exception {
 embeddedActiveMQ.start();
 tjws.start();
 manager.start();
 tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
 tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
}

代码示例来源:origin: org.hornetq.rest/hornetq-rest

public void start() throws Exception
{
 embeddedHornetQ.start();
 tjws.start();
 manager.start();
 tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
 tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
}

代码示例来源:origin: org.jbpm/jbpm-console-ng-rest

private static void startServer() throws Exception {
  server = new TJWSEmbeddedJaxrsServer();
  PORT = TestConfig.getAllocatedPort();
  server.setPort(PORT);
  server.start();
  server.getDeployment().getRegistry().addSingletonResource(getProcessImageRESTResource());
  server.getDeployment().setProviderFactory(JacksonRestEasyTestConfig.createRestEasyProviderFactory());
}

相关文章