Search in sources :

Example 1 with DbService

use of com.emc.storageos.db.server.DbService in project coprhd-controller by CoprHD.

the class DbSvcRunner method main.

public static void main(String[] args) {
    try {
        String ctxFile = args[0];
        FileSystemXmlApplicationContext ctx = new FileSystemXmlApplicationContext("file:" + ctxFile);
        DbService dbsvc = (DbService) ctx.getBean("dbsvc");
        dbsvc.start();
        log.info("dbsvc is started");
        while (true) {
            ;
        }
    } catch (Exception ex) {
        log.error("Exception ", ex);
    }
}
Also used : FileSystemXmlApplicationContext(org.springframework.context.support.FileSystemXmlApplicationContext) DbService(com.emc.storageos.db.server.DbService) URISyntaxException(java.net.URISyntaxException) RetryableCoordinatorException(com.emc.storageos.coordinator.exceptions.RetryableCoordinatorException) IOException(java.io.IOException)

Example 2 with DbService

use of com.emc.storageos.db.server.DbService in project coprhd-controller by CoprHD.

the class Main method main.

public static void main(String[] args) {
    try {
        SLF4JBridgeHandler.install();
        // To using Spring profile feature
        GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
        ctx.getEnvironment().setActiveProfiles(System.getProperty("buildType"));
        ctx.load(args);
        ctx.refresh();
        DbService dbsvc = (DbService) ctx.getBean(SERVICE_BEAN);
        addShutdownHook(dbsvc);
        dbsvc.start();
    } catch (Exception e) {
        _log.error("Failed to start {}:", SERVICE_BEAN, e);
        System.exit(1);
    }
}
Also used : DbService(com.emc.storageos.db.server.DbService) GenericXmlApplicationContext(org.springframework.context.support.GenericXmlApplicationContext)

Aggregations

DbService (com.emc.storageos.db.server.DbService)2 RetryableCoordinatorException (com.emc.storageos.coordinator.exceptions.RetryableCoordinatorException)1 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 FileSystemXmlApplicationContext (org.springframework.context.support.FileSystemXmlApplicationContext)1 GenericXmlApplicationContext (org.springframework.context.support.GenericXmlApplicationContext)1