class CDILiquibase implements Extension {

    @Inject
    @LiquibaseType
    ResourceAccessor resourceAccessor;

    @Inject
    @LiquibaseType
    protected CDILiquibaseConfig config;

    @Inject
    @LiquibaseType
    private DataSource dataSource;
    private boolean initialized;
    private boolean updateSuccessful;

    public boolean isInitialized() {
        return initialized;
    }

    public boolean isUpdateSuccessful() {
        return updateSuccessful;
    }

    @PostConstruct
    public void onStartup() {
        try {
            Logger log = Scope.getCurrentScope().getLog(getClass());

            log.info("Booting Liquibase " + LiquibaseUtil.getBuildVersionInfo());
            String hostName;
            try {
                hostName = NetUtil.getLocalHostName();
            } catch (Exception e) {
                log.warning("Cannot find hostname: " + e.getMessage());
                log.fine("", e);
                return;
            }

            if (!LiquibaseCommandLineConfiguration.SHOULD_RUN.getCurrentValue()) {
                log.info(String.format("Liquibase did not run on %s because %s was set to false.",
                        hostName,
                        LiquibaseCommandLineConfiguration.SHOULD_RUN.getKey()
                ));
                return;
            }
            if (!config.getShouldRun()) {
                log.info(String.format("Liquibase did not run on %s because CDILiquibaseConfig.shouldRun was set to false.", hostName));
                return;
            }
            initialized = true;
            performUpdate();
        } catch (Throwable e) {
            Scope.getCurrentScope().getLog(getClass()).severe(e.getMessage(), e);
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            }

            throw new UnexpectedLiquibaseException(e);
        }
    }

    protected void performUpdate() throws LiquibaseException {
        Connection c = null;
        Liquibase liquibase = null;
        try {
            c = dataSource.getConnection();
            liquibase = createLiquibase(c);
            liquibase.update(new Contexts(config.getContexts()), new LabelExpression(config.getLabels()));
            updateSuccessful = true;
        } catch (SQLException e) {
            throw new DatabaseException(e);
        } catch (LiquibaseException ex) {
            updateSuccessful = false;
            throw ex;
        } finally {
            if ((liquibase != null) && (liquibase.getDatabase() != null)) {
                liquibase.getDatabase().close();
            } else if (c != null) {
                try {
                    c.rollback();
                    c.close();
                } catch (SQLException e) {
                    //nothing to do
                }

            }

        }
    }

    @SuppressWarnings("squid:S2095")
    protected Liquibase createLiquibase(Connection c) throws LiquibaseException {<FILL_FUNCTION_BODY>}

    /**
     * Subclasses may override this method add change some database settings such as
     * default schema before returning the database object.
     *
     * @param c
     * @return a Database implementation retrieved from the {@link liquibase.database.DatabaseFactory}.
     * @throws DatabaseException
     */
    protected Database createDatabase(Connection c) throws DatabaseException {
        Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(c));
        if (config.getDefaultSchema() != null) {
            database.setDefaultSchemaName(config.getDefaultSchema());
        }
        return database;
    }
}

        Liquibase liquibase = new Liquibase(config.getChangeLog(), resourceAccessor, createDatabase(c));
        if (config.getParameters() != null) {
            for (Map.Entry<String, String> entry : config.getParameters().entrySet()) {
                liquibase.setChangeLogParameter(entry.getKey(), entry.getValue());
            }
        }

        if (config.isDropFirst()) {
            liquibase.dropAll();
        }

        return liquibase;
    
<no_super_class>