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());
}
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());
}
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);
}
}
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();
}
}
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);
}
Aggregations