Package org.exist.atom

Examples of org.exist.atom.AtomModule


          final String className = moduleConf.getAttribute("class");
          if (className != null && className.length() > 0) {
            try {
              final Class<?> moduleClass = Class.forName(className);
              final AtomModule amodule = (AtomModule) moduleClass.newInstance();
              modules.put(name, amodule);
              amodule.init(new ModuleContext(config, name, atomConf.getParent()));

            } catch (final Exception ex) {
              throw new ServletException(
                  "Cannot instantiate class " + className
                      + " for module '" + name
View Full Code Here


      final String moduleName = firstSlash < 0 ? path.substring(1) : path
          .substring(1, firstSlash);
      path = firstSlash < 0 ? "" : path.substring(firstSlash);

      final AtomModule module = modules.get(moduleName);
      if (module == null) {
        response.sendError(400, "Module " + moduleName + " not found.");
        return;
      }

      Subject user = null;
      if (noAuth.get(moduleName) == null) {
        // Authenticate
        user = authenticate(request, response);
        if (user == null) {
          // You now get a challenge if there is no user
          return;
        }
      }

      // Handle the resource
      DBBroker broker = null;
      try {
        broker = pool.get(user);
        module.process(broker, new HttpRequestMessage(request, path,
            '/' + moduleName), new HttpResponseMessage(response));

      } catch (final NotFoundException ex) {
        getLog().info(
            "Resource " + path + " not found by " + moduleName, ex);
View Full Code Here

TOP

Related Classes of org.exist.atom.AtomModule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.