Search in sources :

Example 6 with Persistence

use of com.manydesigns.portofino.persistence.Persistence in project Portofino by ManyDesigns.

the class DatabaseModule method onApplicationEvent.

@Override
public void onApplicationEvent(@NotNull ContextRefreshedEvent event) {
    Persistence persistence = applicationContext.getBean(Persistence.class);
    Persistence.Status status = persistence.status.getValue();
    if (status == null || status == Persistence.Status.STOPPED) {
        logger.info("Starting persistence...");
        persistence.start();
        this.status = ModuleStatus.STARTED;
        logger.info("Persistence started.");
    }
}
Also used : Persistence(com.manydesigns.portofino.persistence.Persistence)

Aggregations

Persistence (com.manydesigns.portofino.persistence.Persistence)6 ConfigurationSource (com.manydesigns.portofino.config.ConfigurationSource)2 DatabasePlatformsRegistry (com.manydesigns.portofino.model.database.platforms.DatabasePlatformsRegistry)2 CrudConfiguration (com.manydesigns.portofino.resourceactions.crud.configuration.database.CrudConfiguration)2 Configuration (org.apache.commons.configuration2.Configuration)2 PropertiesConfiguration (org.apache.commons.configuration2.PropertiesConfiguration)2 NotNull (org.jetbrains.annotations.NotNull)2 Logger (org.slf4j.Logger)2 LoggerFactory (org.slf4j.LoggerFactory)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 ElementsThreadLocals (com.manydesigns.elements.ElementsThreadLocals)1 Insertable (com.manydesigns.elements.annotations.Insertable)1 Updatable (com.manydesigns.elements.annotations.Updatable)1 RequestMessages (com.manydesigns.elements.messages.RequestMessages)1 ClassAccessor (com.manydesigns.elements.reflection.ClassAccessor)1 PropertyAccessor (com.manydesigns.elements.reflection.PropertyAccessor)1 QueryStringWithParameters (com.manydesigns.elements.text.QueryStringWithParameters)1 CacheResetListenerRegistry (com.manydesigns.portofino.cache.CacheResetListenerRegistry)1 AggregateCodeBase (com.manydesigns.portofino.code.AggregateCodeBase)1 CodeBase (com.manydesigns.portofino.code.CodeBase)1