use of javax.annotation.PostConstruct in project wildfly by wildfly.
the class MDBLifecycleCallback method init.
@PostConstruct
public void init() throws Exception {
ITestResultsSingleton results = this.getSingleton();
log.trace(MDBLifecycleCallback.class.getSimpleName() + " @PostConstruct called");
Principal princ = null;
try {
princ = msgContext.getCallerPrincipal();
} catch (IllegalStateException e) {
results.setMdb("postconstruct", "OKstart");
return;
}
results.setMdb("postconstruct", "Method getCallerPrincipal was called from @PostConstruct with result: " + princ);
}
use of javax.annotation.PostConstruct in project wildfly by wildfly.
the class SFSBLifecycleCallback method init.
@PostConstruct
public void init() throws Exception {
// on Stateful bean is permitted to call getCallerPrincipal on @PostConstruct
ITestResultsSingleton results = this.getSingleton();
Principal princ = sessContext.getCallerPrincipal();
results.setSfsb("postconstruct", princ.getName() + "start");
log.trace(SFSBLifecycleCallback.class.getSimpleName() + " @PostConstruct called");
}
use of javax.annotation.PostConstruct in project wildfly by wildfly.
the class BindingEjb method bind.
@PostConstruct
public void bind() throws Exception {
new InitialContext().bind("java:jboss/exported/test", "TestValue");
new InitialContext().bind("java:jboss/exported/context/test", "TestValue");
}
use of javax.annotation.PostConstruct in project spring-boot by spring-projects.
the class SpringConfiguration method init.
@PostConstruct
public void init() throws IOException {
Properties props = new Properties();
props.load(new ClassPathResource("application.properties").getInputStream());
String value = props.getProperty("message");
if (value != null) {
this.message = value;
}
}
use of javax.annotation.PostConstruct in project spring-boot by spring-projects.
the class DataSourcePublicMetrics method initialize.
@PostConstruct
public void initialize() {
DataSource primaryDataSource = getPrimaryDataSource();
DataSourcePoolMetadataProvider provider = new DataSourcePoolMetadataProviders(this.providers);
for (Map.Entry<String, DataSource> entry : this.applicationContext.getBeansOfType(DataSource.class).entrySet()) {
String beanName = entry.getKey();
DataSource bean = entry.getValue();
String prefix = createPrefix(beanName, bean, bean.equals(primaryDataSource));
DataSourcePoolMetadata poolMetadata = provider.getDataSourcePoolMetadata(bean);
if (poolMetadata != null) {
this.metadataByPrefix.put(prefix, poolMetadata);
}
}
}
Aggregations