liquibase.integration.cdi
Class CDILiquibase

java.lang.Object
  extended by liquibase.integration.cdi.CDILiquibase
All Implemented Interfaces:
javax.enterprise.inject.spi.Extension

@ApplicationScoped
public class CDILiquibase
extends Object
implements javax.enterprise.inject.spi.Extension

A CDI wrapper for Liquibase.

Example Configuration:

This CDI configuration example will cause liquibase to run automatically when the CDI container is initialized. It will load db-changelog.xml from the classpath and apply it against myDataSource.

Various producers methods are required to resolve the dependencies i.e. public class CDILiquibaseProducer {

Author:
Aaron Walker (http://github.com/aaronwalker)

Constructor Summary
CDILiquibase()
           
 
Method Summary
protected  Database createDatabase(Connection c)
          Subclasses may override this method add change some database settings such as default schema before returning the database object.
protected  Liquibase createLiquibase(Connection c)
           
 boolean isInitialized()
           
 boolean isUpdateSuccessful()
           
 void onStartup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDILiquibase

public CDILiquibase()
Method Detail

isInitialized

public boolean isInitialized()

isUpdateSuccessful

public boolean isUpdateSuccessful()

onStartup

@PostConstruct
public void onStartup()
               throws LiquibaseException
Throws:
LiquibaseException

createLiquibase

protected Liquibase createLiquibase(Connection c)
                             throws LiquibaseException
Throws:
LiquibaseException

createDatabase

protected Database createDatabase(Connection c)
                           throws DatabaseException
Subclasses may override this method add change some database settings such as default schema before returning the database object.

Parameters:
c -
Returns:
a Database implementation retrieved from the DatabaseFactory.
Throws:
DatabaseException


Copyright © 2013 Liquibase.org. All Rights Reserved.