Search in sources :

Example 66 with PostConstruct

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);
}
Also used : Principal(java.security.Principal) PostConstruct(javax.annotation.PostConstruct)

Example 67 with PostConstruct

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");
}
Also used : Principal(java.security.Principal) PostConstruct(javax.annotation.PostConstruct)

Example 68 with PostConstruct

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");
}
Also used : InitialContext(javax.naming.InitialContext) PostConstruct(javax.annotation.PostConstruct)

Example 69 with PostConstruct

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;
    }
}
Also used : Properties(java.util.Properties) ClassPathResource(org.springframework.core.io.ClassPathResource) PostConstruct(javax.annotation.PostConstruct)

Example 70 with PostConstruct

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);
        }
    }
}
Also used : DataSourcePoolMetadataProviders(org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProviders) DataSourcePoolMetadata(org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadata) DataSourcePoolMetadataProvider(org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvider) HashMap(java.util.HashMap) Map(java.util.Map) DataSource(javax.sql.DataSource) 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