@Override protected ResourceConfig getDefaultResourceConfig( Map<String, Object> props, WebConfig wc ) throws ServletException { Object classNames = props.get( ClassNamesResourceConfig.PROPERTY_CLASSNAMES ); if ( classNames != null ) { return new ClassNamesResourceConfig( props ); } return super.getDefaultResourceConfig( props, wc ); } }
@Override protected void configure( WebConfig wc, ResourceConfig rc, WebApplication wa ) { super.configure( wc, rc, wa ); Set<Object> singletons = rc.getSingletons(); singletons.addAll( injectables ); }
ServletHolder h = new ServletHolder(new ServletContainer(makeJerseyConfig())); root.addServlet(h, "/" + SERVLET_PATH + "/*");
public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; init(new WebFilterConfig(filterConfig)); }
@Override public void init() throws ServletException { init(new WebServletConfig(this)); }
/** * Initiate the Web component. * * @param webConfig the Web configuration. * * @throws javax.servlet.ServletException in case of an initialization failure */ protected void init(WebConfig webConfig) throws ServletException { webComponent = (app == null) ? new InternalWebComponent() : new InternalWebComponent(app); webComponent.init(webConfig); }
/** * Get the Web configuration. * * @return the Web configuration. */ protected WebConfig getWebConfig() { return webComponent.getWebConfig(); }
/** * Load the Web application. This will create, configure and initiate * the web application. */ public void load() { webComponent.load(); }
/** * Destroy this Servlet or Filter. * */ @Override public void destroy() { if (webComponent != null) { webComponent.destroy(); } }
public ExhibitorMain(BackupProvider backupProvider, ConfigProvider configProvider, ExhibitorArguments.Builder builder, int httpPort, String listenAddress, SecurityHandler security, SecurityArguments securityArguments) throws Exception { HashUserRealm realm = makeRealm(securityArguments); if ( securityArguments.getRemoteAuthSpec() != null ) { addRemoteAuth(builder, securityArguments.getRemoteAuthSpec()); } builder.shutdownProc(makeShutdownProc(this)); exhibitor = new Exhibitor(configProvider, null, backupProvider, builder.build()); exhibitor.start(); DefaultResourceConfig application = JerseySupport.newApplicationConfig(new UIContext(exhibitor)); ServletContainer container = new ServletContainer(application); server = new Server(); SocketConnector http = new SocketConnector(); http.setHost(listenAddress); http.setPort(httpPort); server.addConnector(http); Context root = new Context(server, "/", Context.SESSIONS); root.addFilter(ExhibitorServletFilter.class, "/", Handler.ALL); root.addServlet(new ServletHolder(container), "/*"); if ( security != null ) { root.setSecurityHandler(security); } else if ( securityArguments.getSecurityFile() != null ) { addSecurityFile(realm, securityArguments.getSecurityFile(), root); } }
public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; init(new WebFilterConfig(filterConfig)); }
@Override public void init() throws ServletException { init(new WebServletConfig(this)); }
/** * Initiate the Web component. * * @param webConfig the Web configuration. * * @throws javax.servlet.ServletException in case of an initialization failure */ protected void init(WebConfig webConfig) throws ServletException { webComponent = (app == null) ? new InternalWebComponent() : new InternalWebComponent(app); webComponent.init(webConfig); }
@Override protected ResourceConfig getDefaultResourceConfig(Map<String, Object> props, WebConfig wc) throws ServletException { return ServletContainer.this.getDefaultResourceConfig(props, wc); } }
public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; init(new WebFilterConfig(filterConfig)); }
/** * Initiate the Web component. * * @param webConfig the Web configuration. * * @throws javax.servlet.ServletException in case of an initialization failure */ protected void init(WebConfig webConfig) throws ServletException { webComponent = (app == null) ? new InternalWebComponent() : new InternalWebComponent(app); webComponent.init(webConfig); }
@Override protected ResourceConfig getDefaultResourceConfig(Map<String, Object> props, WebConfig wc) throws ServletException { return ServletContainer.this.getDefaultResourceConfig(props, wc); } }