Search in sources :

Example 56 with PostConstruct

use of javax.annotation.PostConstruct in project adempiere by adempiere.

the class ServerBean method ejbCreate.

//	toString
/**************************************************************************
	 * 	Create the Session Bean
	 */
@PostConstruct
public void ejbCreate() {
    m_no = ++s_no;
    try {
        if (!Adempiere.startup(false))
            throw new CreateException("Adempiere could not start");
    } catch (Exception ex) {
        log.log(Level.SEVERE, "ejbCreate", ex);
    //	throw new CreateException ();
    }
    log.info("#" + getStatus());
}
Also used : CreateException(javax.ejb.CreateException) CreateException(javax.ejb.CreateException) PostConstruct(javax.annotation.PostConstruct)

Example 57 with PostConstruct

use of javax.annotation.PostConstruct in project adempiere by adempiere.

the class StatusBean method ejbCreate.

//	toString
/**************************************************************************
	 * 	Create the Session Bean
	 */
@PostConstruct
public void ejbCreate() {
    m_no = ++s_no;
    try {
        if (!Adempiere.startup(false))
            throw new CreateException("Compiere could not start");
    } catch (Exception ex) {
        log.log(Level.SEVERE, "", ex);
    //	throw new CreateException ();
    }
    log.info("#" + m_no + " - " + getStatus());
}
Also used : CreateException(javax.ejb.CreateException) CreateException(javax.ejb.CreateException) PostConstruct(javax.annotation.PostConstruct)

Example 58 with PostConstruct

use of javax.annotation.PostConstruct in project incubator-atlas by apache.

the class AtlasAuthenticationProvider method setAuthenticationMethod.

@PostConstruct
void setAuthenticationMethod() {
    try {
        Configuration configuration = ApplicationProperties.get();
        this.fileAuthenticationMethodEnabled = configuration.getBoolean(FILE_AUTH_METHOD, true);
        boolean ldapAuthenticationEnabled = configuration.getBoolean(LDAP_AUTH_METHOD, false);
        if (ldapAuthenticationEnabled) {
            this.ldapType = configuration.getString(LDAP_TYPE, "NONE");
        } else {
            this.ldapType = "NONE";
        }
    } catch (Exception e) {
        LOG.error("Error while getting atlas.login.method application properties", e);
    }
}
Also used : Configuration(org.apache.commons.configuration.Configuration) AuthenticationException(org.springframework.security.core.AuthenticationException) PostConstruct(javax.annotation.PostConstruct)

Example 59 with PostConstruct

use of javax.annotation.PostConstruct in project incubator-atlas by apache.

the class SetupSteps method runSetup.

/**
     * Call each registered {@link SetupStep} one after the other.
     * @throws SetupException Thrown with any error during running setup, including Zookeeper interactions, and
     *                          individual failures in the {@link SetupStep}.
     */
@PostConstruct
public void runSetup() throws SetupException {
    HAConfiguration.ZookeeperProperties zookeeperProperties = HAConfiguration.getZookeeperProperties(configuration);
    InterProcessMutex lock = curatorFactory.lockInstance(zookeeperProperties.getZkRoot());
    try {
        LOG.info("Trying to acquire lock for running setup.");
        lock.acquire();
        LOG.info("Acquired lock for running setup.");
        handleSetupInProgress(configuration, zookeeperProperties);
        for (SetupStep step : setupSteps) {
            LOG.info("Running setup step: {}", step);
            step.run();
        }
        clearSetupInProgress(zookeeperProperties);
    } catch (SetupException se) {
        LOG.error("Got setup exception while trying to setup", se);
        throw se;
    } catch (Throwable e) {
        LOG.error("Error running setup steps", e);
        throw new SetupException("Error running setup steps", e);
    } finally {
        releaseLock(lock);
        curatorFactory.close();
    }
}
Also used : SetupException(org.apache.atlas.setup.SetupException) HAConfiguration(org.apache.atlas.ha.HAConfiguration) SetupStep(org.apache.atlas.setup.SetupStep) InterProcessMutex(org.apache.curator.framework.recipes.locks.InterProcessMutex) PostConstruct(javax.annotation.PostConstruct)

Example 60 with PostConstruct

use of javax.annotation.PostConstruct in project incubator-atlas by apache.

the class LoginProcessor method login.

/**
     * Perform a SIMPLE login based on established OS identity or a kerberos based login using the configured
     * principal and keytab (via atlas-application.properties).
     */
@PostConstruct
public void login() {
    // first, let's see if we're running in a hadoop cluster and have the env configured
    boolean isHadoopCluster = isHadoopCluster();
    Configuration hadoopConfig = isHadoopCluster ? getHadoopConfiguration() : new Configuration(false);
    org.apache.commons.configuration.Configuration configuration = getApplicationConfiguration();
    if (!isHadoopCluster) {
        // need to read the configured authentication choice and create the UGI configuration
        setupHadoopConfiguration(hadoopConfig, configuration);
    }
    doServiceLogin(hadoopConfig, configuration);
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)248 IOException (java.io.IOException)28 File (java.io.File)18 SamlRegisteredService (org.apereo.cas.support.saml.services.SamlRegisteredService)17 Map (java.util.Map)15 ArrayList (java.util.ArrayList)12 ExternalResource (com.vaadin.server.ExternalResource)11 HashMap (java.util.HashMap)10 InitialContext (javax.naming.InitialContext)9 Label (com.vaadin.ui.Label)8 VerticalLayout (com.vaadin.ui.VerticalLayout)8 Request (com.nabalive.framework.web.Request)7 Response (com.nabalive.framework.web.Response)7 Route (com.nabalive.framework.web.Route)7 Link (com.vaadin.ui.Link)7 Properties (java.util.Properties)7 Method (java.lang.reflect.Method)5 InputStream (java.io.InputStream)4 URISyntaxException (java.net.URISyntaxException)4 Path (java.nio.file.Path)4