/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
private static String getContextRoot(Class<? extends Application> application) { ApplicationPath path = application.getAnnotation(ApplicationPath.class); if (null == path) { return null; } return path.value(); } }
/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
private static String getContextRoot(Class<?> application) { ApplicationPath path = application.getAnnotation(ApplicationPath.class); if (null == path) { return null; } return path.value(); }
/** * @author Arun Gupta */ @javax.ws.rs.ApplicationPath("webresources") public class MyApplication extends Application { }
private static String createMappingPath(final ApplicationPath ap) { String path = ap.value(); if (!path.startsWith("/")) { path = "/" + path; } if (!path.endsWith("/*")) { if (path.endsWith("/")) { path += "*"; } else { path += "/*"; } } return path; }
/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
private static String createMappingPath(final ApplicationPath ap) { String path = ap.value(); if (!path.startsWith("/")) { path = "/" + path; } if (!path.endsWith("/*")) { if (path.endsWith("/")) { path += "*"; } else { path += "/*"; } } return path; }
/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
public UndertowJaxrsServer deployToServer(UndertowJaxrsServer server, Class<? extends Application> application) { ApplicationPath appPath = application.getAnnotation(ApplicationPath.class); String path = "/"; if (appPath != null) path = appPath.value(); return deployToServer(server, application, path); }
@ApplicationPath("/nottraced") public static class App extends Application { @Override public Set<Object> getSingletons() { return Collections.singleton(new Resource()); } }
/** * Creates a web deployment for the jaxrs Application. Will bind the resteasy.servlet.mapping.prefix * to @ApplicationPath if it exists, otherwise "/". * * @param application * @return */ public DeploymentInfo undertowDeployment(Class<? extends Application> application) { ApplicationPath appPath = application.getAnnotation(ApplicationPath.class); String path = "/"; if (appPath != null) path = appPath.value(); return undertowDeployment(application, path); }
@ApplicationPath("/unsampled") public static class Unsampled extends Application { @Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder() .sampler(Sampler.NEVER_SAMPLE) .spanReporter(Reporter.NOOP) .build()) ))); } }
/** * Creates a web deployment for the jaxrs Application. Will bind the contextPath * to @ApplicationPath if it exists, otherwise "/". * * @param application * @return */ public UndertowJaxrsServer deploy(Class<? extends Application> application) { ApplicationPath appPath = application.getAnnotation(ApplicationPath.class); String path = "/"; if (appPath != null) path = appPath.value(); return deploy(application, path); }
@ApplicationPath("/traced") public static class TracedApp extends Application { @Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder().spanReporter(Reporter.NOOP).build()) ))); } }
/** * Creates a web deployment for the jaxrs Application. Will bind the contextPath * to @ApplicationPath if it exists, otherwise "/". * * @param application * @return */ public UndertowJaxrsServer deploy(Application application) { ApplicationPath appPath = application.getClass().getAnnotation(ApplicationPath.class); String path = "/"; if (appPath != null) path = appPath.value(); return deploy(application, path); }
@ApplicationPath("/") public static class App extends Application { @Override public Set<Object> getSingletons() { return Collections.singleton(new Resource()); } }
if (appPath != null && (root == null || "".equals(root))) { String path = appPath.value(); setRootResourcePath(path);