public ContainerRequest filter(ContainerRequest request) { LOGGER.log(Level.INFO, "Resource Method matched." + "\n HttpMethod: " + arm.getHttpMethod() + "\n Resource: " + arm.getDeclaringResource().getResourceClass().getName() + "\n Method: " + arm.getMethod().toGenericString()); return request; } }
private String chooseName(String explicitName, boolean absolute, AbstractResourceMethod method, String... suffixes) { if (explicitName != null && !explicitName.isEmpty()) { if (absolute) { return explicitName; } return name(method.getDeclaringResource().getResourceClass(), explicitName); } return name(name(method.getDeclaringResource().getResourceClass(), method.getMethod().getName()), suffixes); } }
public ContainerRequest filter(ContainerRequest request) { LOGGER.log(Level.INFO, "Resource Method matched." + "\n HttpMethod: " + arm.getHttpMethod() + "\n Resource: " + arm.getDeclaringResource().getResourceClass().getName() + "\n Method: " + arm.getMethod().toGenericString()); return request; } }
public ContainerRequest filter(ContainerRequest request) { LOGGER.log(Level.INFO, "Resource Method matched." + "\n HttpMethod: " + arm.getHttpMethod() + "\n Resource: " + arm.getDeclaringResource().getResourceClass().getName() + "\n Method: " + arm.getMethod().toGenericString()); return request; } }
private boolean isCreateUserResource() { return TenantUserApi.class.isAssignableFrom(this.method.getDeclaringResource().getResourceClass()) && this.method.getHttpMethod().equals(HttpMethod.POST) && this.method.getResource().getPath().getValue().endsWith("/api/user"); } }
@Override public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) { final AbstractResource declaringResource = abstractResourceMethod.getDeclaringResource(); if (isSessionBean(declaringResource)) { final Class<?> resourceClass = declaringResource.getResourceClass(); final Method javaMethod = abstractResourceMethod.getMethod(); for (Class iFace: remoteAndLocalIfaces(resourceClass)) { try { final Method iFaceMethod = iFace.getDeclaredMethod(javaMethod.getName(), javaMethod.getParameterTypes()); if (iFaceMethod != null) { return createDispatcher(abstractResourceMethod, iFaceMethod); } } catch (NoSuchMethodException ex) { } catch (SecurityException ex) { Logger.getLogger(EJBRequestDispatcherProvider.class.getName()).log(Level.SEVERE, null, ex); } } } return null; }
@Override public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) { final AbstractResource declaringResource = abstractResourceMethod.getDeclaringResource(); if (isSessionBean(declaringResource)) { final Class<?> resourceClass = declaringResource.getResourceClass(); final Method javaMethod = abstractResourceMethod.getMethod(); for (Class iFace: remoteAndLocalIfaces(resourceClass)) { try { final Method iFaceMethod = iFace.getDeclaredMethod(javaMethod.getName(), javaMethod.getParameterTypes()); if (iFaceMethod != null) { return createDispatcher(abstractResourceMethod, iFaceMethod); } } catch (NoSuchMethodException ex) { } catch (SecurityException ex) { Logger.getLogger(EJBRequestDispatcherProvider.class.getName()).log(Level.SEVERE, null, ex); } } } return null; }
@Override public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) { final AbstractResource declaringResource = abstractResourceMethod.getDeclaringResource(); if (isSessionBean(declaringResource)) { final Class<?> resourceClass = declaringResource.getResourceClass(); final Method javaMethod = abstractResourceMethod.getMethod(); for (Class iFace: remoteAndLocalIfaces(resourceClass)) { try { final Method iFaceMethod = iFace.getDeclaredMethod(javaMethod.getName(), javaMethod.getParameterTypes()); if (iFaceMethod != null) { return createDispatcher(abstractResourceMethod, iFaceMethod); } } catch (NoSuchMethodException ex) { } catch (SecurityException ex) { Logger.getLogger(EJBRequestDispatcherProvider.class.getName()).log(Level.SEVERE, null, ex); } } } return null; }
@Override public RequestDispatcher create(AbstractResourceMethod method) { RequestDispatcher dispatcher = provider.create(method); if (dispatcher == null) { return null; } // Chain dispatchers required by resource declared associations // Highest priority last (it will be executed first) // Checks for methods or classes that requires authorization if (method.getMethod().isAnnotationPresent(Authorized.class) || method.getDeclaringResource().getResourceClass().isAnnotationPresent(Authorized.class)) { Authorized annotation; if (method.isAnnotationPresent(Authorized.class)) { annotation = method.getAnnotation(Authorized.class); } else { annotation = method.getDeclaringResource().getResourceClass().getAnnotation(Authorized.class); } dispatcher = new CheckAuthorizationMethodDispatcher(method, annotation, dispatcher); } // Checks for methods or classes that requires a valid tenant. if (method.getMethod().isAnnotationPresent(ExistingTenant.class) || method.getDeclaringResource().isAnnotationPresent(ExistingTenant.class)) { dispatcher = new CheckValidTenantRequestDispatcher(dispatcher); } return dispatcher; } }
final Timed annotation = method.getMethod().getAnnotation(Timed.class); final Class<?> klass = method.getDeclaringResource().getResourceClass(); final String group = MetricName.chooseGroup(annotation.group(), klass); final String type = MetricName.chooseType(annotation.type(), klass); final Metered annotation = method.getMethod().getAnnotation(Metered.class); final Class<?> klass = method.getDeclaringResource().getResourceClass(); final String group = MetricName.chooseGroup(annotation.group(), klass); final String type = MetricName.chooseType(annotation.type(), klass); .getAnnotation(ExceptionMetered.class); final Class<?> klass = method.getDeclaringResource().getResourceClass(); final String group = MetricName.chooseGroup(annotation.group(), klass); final String type = MetricName.chooseType(annotation.type(), klass);