struts-sandbox/mailreader-course/struts/lab-2-1-src/java/org/apache/struts/apps/mailreader/course/MemoryDatabasePlugIn.java [99:127]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void init(ActionServlet servlet, ModuleConfig config)
            throws ServletException {

        log.info("Initializing memory database plug in from '" +
                pathname + "'");

        // Remember our associated configuration and servlet
        this.servlet = servlet;

        // Construct a new database and make it available
        database = new MemoryUserDatabase();
        try {
            String path = calculatePath();
            if (log.isDebugEnabled()) {
                log.debug(" Loading database from '" + path + "'");
            }
            database.setPathname(path);
            database.open();
        } catch (Exception e) {
            log.error("Opening memory database", e);
            throw new ServletException("Cannot load database from '" +
                    pathname + "'", e);
        }

        // Make the initialized database available
        servlet.getServletContext().setAttribute(Constants.DATABASE_KEY,
                database);

    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



struts-sandbox/mailreader-course/struts/lab-1-4-src/java/org/apache/struts/apps/mailreader/course/MemoryDatabasePlugIn.java [100:128]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void init(ActionServlet servlet, ModuleConfig config)
            throws ServletException {

        log.info("Initializing memory database plug in from '" +
                pathname + "'");

        // Remember our associated configuration and servlet
        this.servlet = servlet;

        // Construct a new database and make it available
        database = new MemoryUserDatabase();
        try {
            String path = calculatePath();
            if (log.isDebugEnabled()) {
                log.debug(" Loading database from '" + path + "'");
            }
            database.setPathname(path);
            database.open();
        } catch (Exception e) {
            log.error("Opening memory database", e);
            throw new ServletException("Cannot load database from '" +
                    pathname + "'", e);
        }

        // Make the initialized database available
        servlet.getServletContext().setAttribute(Constants.DATABASE_KEY,
                database);

    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



