@@ -0,0 +1,3708 @@
+package org.jboss.shamrock.example.datasource;%0A%0Aimport java.util.Vector;%0A%0Aimport org.hsqldb.Database;%0Aimport org.hsqldb.DatabaseManager;%0Aimport org.hsqldb.DatabaseType;%0Aimport org.hsqldb.Session;%0Aimport org.hsqldb.lib.Notified;%0Aimport org.hsqldb.persist.HsqlProperties;%0A%0Aimport com.oracle.svm.core.annotate.Substitute;%0Aimport com.oracle.svm.core.annotate.TargetClass;%0A%0A@TargetClass(DatabaseManager.class)%0Afinal class DatabaseManagerReplacement %7B%0A%0A    /**%0A     * Returns a vector containing the URI (type + path) for all the databases.%0A     */%0A    @Substitute%0A    public static Vector getDatabaseURIs() %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A    /**%0A     * Closes all the databases using the given mode.%3Cp%3E%0A     * %3Cp%3E%0A     * CLOSEMODE_IMMEDIATELY = 1;%0A     * CLOSEMODE_NORMAL      = 2;%0A     * CLOSEMODE_COMPACT     = 3;%0A     * CLOSEMODE_SCRIPT      = 4;%0A     */%0A    @Substitute%0A    public static void closeDatabases(int mode) %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A    /**%0A     * Used by server to open a new session%0A     */%0A    @Substitute%0A    public static Session newSession(int dbID, String user, String password,%0A                                     String zoneString, int timeZoneSeconds) %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A    /**%0A     * Used by in-process connections and by Servlet%0A     */%0A    @Substitute%0A    public static Session newSession(String type, String path, String user,%0A                                     String password, HsqlProperties props,%0A                                     String zoneString, int timeZoneSeconds) %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A    /**%0A     * Returns an existing session. Used with repeat HTTP connections%0A     * belonging to the same JDBC Connection / HSQL Session pair.%0A     */%0A    @Substitute%0A    public static Session getSession(int dbId, long sessionId) %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A    /**%0A     * Used by server to open or create a database%0A     */%0A    @Substitute%0A    public static int getDatabase(String type, String path, Notified server,%0A                                  HsqlProperties props) %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A    @Substitute%0A    public static Database getDatabase(int id) %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A    @Substitute%0A    public static void shutdownDatabases(Notified server, int shutdownMode) %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A    /**%0A     * This has to be improved once a threading model is in place.%0A     * Current behaviour:%0A     * %3Cp%3E%0A     * Attempts to connect to different databases do not block. Two db's can%0A     * open simultaneously.%0A     * %3Cp%3E%0A     * Attempts to connect to a db while it is opening or closing will block%0A     * until the db is open or closed. At this point the db state is either%0A     * DATABASE_ONLINE (after db.open() has returned) which allows a new%0A     * connection to be made, or the state is DATABASE_SHUTDOWN which means%0A     * the db can be reopened for the new connection).%0A     */%0A    @Substitute%0A    public static Database getDatabase(String dbtype, String path,%0A                                       HsqlProperties props) %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A%0A    /**%0A     * Looks up database of a given type and path in the registry. Returns%0A     * null if there is none.%0A     */%0A    @Substitute%0A    public static synchronized Database lookupDatabaseObject(DatabaseType type,%0A                                                             String path) %7B%0A        throw new RuntimeException();%0A    %7D%0A%0A    /**%0A     * Deregisters a server completely.%0A     */%0A    @Substitute%0A    public static void deRegisterServer(Notified server) %7B%0A        throw new RuntimeException();%0A    %7D%0A%7D%0A

Add substitute to remove the in memory DB