Example #1
0
        public override void RemoveJAXRSClasses(IList <string> classNames, string serverMountPoint)
        {
            JaxRsServletHolderFactory factory = _jaxRSClasses[serverMountPoint];

            if (factory != null)
            {
                factory.Remove(classNames);
            }
        }
Example #2
0
        public override void AddJAXRSClasses <T1>(IList <string> classNames, string mountPoint, ICollection <T1> injectables)
        {
            // We don't want absolute URIs at this point
            mountPoint = EnsureRelativeUri(mountPoint);
            mountPoint = TrimTrailingSlashToKeepJettyHappy(mountPoint);

            JaxRsServletHolderFactory factory = _jaxRSClasses.computeIfAbsent(mountPoint, k => new JaxRsServletHolderFactory.Classes());

            factory.Add(classNames, injectables);

            _log.debug("Adding JAXRS classes %s at [%s]", classNames, mountPoint);
        }
Example #3
0
        private void LoadJAXRSResource(string mountPoint, JaxRsServletHolderFactory jaxRsServletHolderFactory)
        {
            SessionHandler sessionHandler = new SessionHandler();

            sessionHandler.Server = Jetty;
            _log.debug("Mounting servlet at [%s]", mountPoint);
            ServletContextHandler jerseyContext = new ServletContextHandler();

            jerseyContext.Server         = Jetty;
            jerseyContext.ErrorHandler   = new NeoJettyErrorHandler();
            jerseyContext.ContextPath    = mountPoint;
            jerseyContext.SessionHandler = sessionHandler;
            jerseyContext.addServlet(jaxRsServletHolderFactory.Create(_defaultInjectables, _wadlEnabled), "/*");
            AddFiltersTo(jerseyContext);
            _handlers.addHandler(jerseyContext);
        }