@Override public <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException { if (application == null) { throw new IllegalArgumentException("application is null."); } return ContainerFactory.createContainer(endpointType, application); } }
@Override public <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException { if (application == null) { throw new IllegalArgumentException("application is null."); } return ContainerFactory.createContainer(endpointType, application); } }
/** * Create a {@link Server} that registers an {@link org.eclipse.jetty.server.Handler} that * in turn manages all root resource and provider classes declared by the * resource configuration. * <p/> * This implementation defers to the * {@link org.glassfish.jersey.server.ContainerFactory#createContainer(Class, javax.ws.rs.core.Application)} method * for creating an Container that manages the root resources. * * @param uri the URI to create the http server. The URI scheme must be * equal to "http". The URI user information and host * are ignored If the URI port is not present then port 80 will be * used. The URI path, query and fragment components are ignored. * @param config the resource configuration. * @return newly created {@link Server}. * * @throws ProcessingException in case of any failure when creating a new Jetty {@code Server} instance. * @throws IllegalArgumentException if {@code uri} is {@code null}. */ public static Server createServer(final URI uri, final ResourceConfig config) throws ProcessingException { final JettyHttpContainer container = ContainerFactory.createContainer(JettyHttpContainer.class, config); return createServer(uri, null, container, true); }
/** * Create a {@link Server} that registers an {@link org.eclipse.jetty.server.Handler} that * in turn manages all root resource and provider classes declared by the * resource configuration. * <p/> * This implementation defers to the * {@link org.glassfish.jersey.server.ContainerFactory#createContainer(Class, javax.ws.rs.core.Application)} method * for creating an Container that manages the root resources. * * @param uri URI on which the Jersey web application will be deployed. Only first path segment will be * used as context path, the rest will be ignored. * @param configuration web application configuration. * @param start if set to false, server will not get started, which allows to configure the underlying * transport layer, see above for details. * @return newly created {@link Server}. * * @throws ProcessingException in case of any failure when creating a new Jetty {@code Server} instance. * @throws IllegalArgumentException if {@code uri} is {@code null}. */ public static Server createServer(final URI uri, final ResourceConfig configuration, final boolean start) throws ProcessingException { return createServer(uri, null, ContainerFactory.createContainer(JettyHttpContainer.class, configuration), start); }
/** * Create a {@link Server} that registers an {@link org.eclipse.jetty.server.Handler} that * in turn manages all root resource and provider classes declared by the * resource configuration. * <p/> * This implementation defers to the * {@link ContainerFactory#createContainer(Class, javax.ws.rs.core.Application)} method * for creating an Container that manages the root resources. * * @param uri the URI to create the http server. The URI scheme must be * equal to {@code https}. The URI user information and host * are ignored. If the URI port is not present then port * {@value org.glassfish.jersey.server.spi.Container#DEFAULT_HTTPS_PORT} will be * used. The URI path, query and fragment components are ignored. * @param sslContextFactory this is the SSL context factory used to configure SSL connector * @param config the resource configuration. * @return newly created {@link Server}. * * @throws ProcessingException in case of any failure when creating a new Jetty {@code Server} instance. * @throws IllegalArgumentException if {@code uri} is {@code null}. */ public static Server createServer(final URI uri, final SslContextFactory sslContextFactory, final ResourceConfig config) throws ProcessingException { final JettyHttpContainer container = ContainerFactory.createContainer(JettyHttpContainer.class, config); return createServer(uri, sslContextFactory, container, true); }
HttpHandler dynamicHandler = ContainerFactory.createContainer(HttpHandler.class, app); httpServer.getServerConfiguration().addHttpHandler(dynamicHandler, "/otp/");
@Override public <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException { if (application == null) { throw new IllegalArgumentException("application is null."); } return ContainerFactory.createContainer(endpointType, application); } }
/** * @see RuntimeDelegateImpl#createEndpoint(Application, Class) */ @Override public <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException { if (application == null) { throw new IllegalArgumentException("application is null."); } return ContainerFactory.createContainer(endpointType, application); }
@Override public <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException { if (application == null) { throw new IllegalArgumentException("application is null."); } return ContainerFactory.createContainer(endpointType, application); } }
@Override public <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException { if (application == null) { throw new IllegalArgumentException("application is null."); } return ContainerFactory.createContainer(endpointType, application); } }
/** * @see RuntimeDelegateImpl#createEndpoint(Application, Class) */ @Override public <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException { if (application == null) { throw new IllegalArgumentException("application is null."); } return ContainerFactory.createContainer(endpointType, application); } }
@Override public <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException { if (application == null) { throw new IllegalArgumentException("application is null."); } return ContainerFactory.createContainer(endpointType, application); } }
@Override public <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException { if (application == null) { throw new IllegalArgumentException("application is null."); } return ContainerFactory.createContainer(endpointType, application); } }
@Override public void addRestHandler(Application application, String rootURI) { if (enabled) { final ServerConfiguration config = httpServer.getServerConfiguration(); HttpHandler handler = ContainerFactory.createContainer(HttpHandler.class, application); config.addHttpHandler(handler, rootURI); } } }
HttpHandler handler = ContainerFactory.createContainer(HttpHandler.class, rc);
private void addJerseyHandler(ResourceConfig resourceConfig, String mapping) { HttpHandler handler = ContainerFactory.createContainer(HttpHandler.class, resourceConfig); httpServer.getServerConfiguration().addHttpHandler(handler, HttpHandlerRegistration.bulder().contextPath(mapping).build()); LOG.log(Level.INFO, I18NBundle.getBundle().getMessage( LocalStringKeys.HTTP_REST_REGISTER_APPLICATION, resourceConfig.getApplication().getClass().getName(), mapping)); }
@Override protected void startUp() throws Exception { final NettyContainer jerseyHandler = ContainerFactory.createContainer(NettyContainer.class, buildResourceConfig( configuration.isRestEnableGzip(),