Example #1
0
 public ServiceRegistry(
     ServiceRegistry parent,
     ResourceMethodRegistry registry,
     ResteasyProviderFactory providerFactory,
     ResourceLocator locator) {
   this.parent = parent;
   this.registry = registry;
   this.providerFactory = providerFactory;
   this.locator = locator;
   if (locator != null) {
     Method method = locator.getMethod();
     Path methodPath = method.getAnnotation(Path.class);
     Class<?> declaringClass = method.getDeclaringClass();
     Path classPath = declaringClass.getAnnotation(Path.class);
     this.uri = MethodMetaData.appendURIFragments(parent, classPath, methodPath);
     if (parent.isRoot())
       this.functionPrefix = declaringClass.getSimpleName() + "." + method.getName();
     else this.functionPrefix = parent.getFunctionPrefix() + "." + method.getName();
   }
   scanRegistry();
 }
Example #2
0
 public void collectResourceMethodsUntilRoot(List<Method> methods) {
   if (isRoot()) return;
   methods.add(locator.getMethod());
   parent.collectResourceMethodsUntilRoot(methods);
 }