Search in sources :

Example 36 with PostConstruct

use of jakarta.annotation.PostConstruct in project jans by JanssenProject.

the class Labels method init.

@PostConstruct
private void init() {
    ApplicationFactory factory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    facesApp = factory.getApplication();
}
Also used : ApplicationFactory(jakarta.faces.application.ApplicationFactory) PostConstruct(jakarta.annotation.PostConstruct)

Example 37 with PostConstruct

use of jakarta.annotation.PostConstruct in project jans by JanssenProject.

the class KryoSerializer method init.

@PostConstruct
private void init() {
    Log.DEBUG();
    kryos = new ThreadLocal<Kryo>() {

        @Override
        protected Kryo initialValue() {
            Kryo kryo = new Kryo();
            kryo.setRegistrationRequired(false);
            kryo.setReferences(true);
            kryo.setClassLoader(actionService.getClassLoader());
            kryo.setOptimizedGenerics(false);
            return kryo;
        }
    };
}
Also used : Kryo(com.esotericsoftware.kryo.Kryo) PostConstruct(jakarta.annotation.PostConstruct)

Example 38 with PostConstruct

use of jakarta.annotation.PostConstruct in project today-framework by TAKETODAY.

the class DefaultUserRepository method initData.

@PostConstruct
public void initData() {
    log.info("init data: [{}]", this);
    users.put("666", new User(1, "Harry Yang", 20, "666", "666", "男", new Date()));
    users.put("6666", new User(2, "Harry Yang1", 20, "6666", "6666", "男", new Date()));
    users.put("66666", new User(3, "Harry Yang2", 20, "66666", "66666", "男", new Date()));
    users.put("666666", new User(4, "Harry Yang3", 20, "666666", "666666", "男", new Date()));
}
Also used : User(test.demo.config.User) Date(java.util.Date) PostConstruct(jakarta.annotation.PostConstruct)

Example 39 with PostConstruct

use of jakarta.annotation.PostConstruct in project glassfish-hk2 by eclipse-ee4j.

the class ServiceDirectsNoErrorService method postConstruct.

@PostConstruct
private void postConstruct() {
    MultiException me = new MultiException(new IllegalStateException(ErrorService1Test.ERROR_STRING));
    me.setReportToErrorService(false);
    throw me;
}
Also used : MultiException(org.glassfish.hk2.api.MultiException) PostConstruct(jakarta.annotation.PostConstruct)

Example 40 with PostConstruct

use of jakarta.annotation.PostConstruct in project jans by JanssenProject.

the class PythonService method init.

@PostConstruct
public void init() {
    try {
        this.logOut = new OutputStreamWriter(new PythonLoggerOutputStream(log, false), "UTF-8");
        this.logErr = new OutputStreamWriter(new PythonLoggerOutputStream(log, true), "UTF-8");
    } catch (UnsupportedEncodingException ex) {
        log.error("Failed to initialize Jython out/err loggers", ex);
    }
}
Also used : UnsupportedEncodingException(java.io.UnsupportedEncodingException) OutputStreamWriter(java.io.OutputStreamWriter) PostConstruct(jakarta.annotation.PostConstruct)

Aggregations

PostConstruct (jakarta.annotation.PostConstruct)76 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)6 IOException (java.io.IOException)6 Date (java.util.Date)6 PostBean (it.vige.rubia.dto.PostBean)4 JSFUtil.handleException (it.vige.rubia.ui.JSFUtil.handleException)4 ArrayList (java.util.ArrayList)4 ForumBean (it.vige.rubia.dto.ForumBean)3 FacesContext (jakarta.faces.context.FacesContext)3 Method (java.lang.reflect.Method)3 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)3 ApplicationAssociate (com.sun.faces.application.ApplicationAssociate)2 HTTPServer (io.prometheus.client.exporter.HTTPServer)2 ModuleException (it.vige.rubia.ModuleException)2 CategoryBean (it.vige.rubia.dto.CategoryBean)2 TopicBean (it.vige.rubia.dto.TopicBean)2 SessionScoped (jakarta.enterprise.context.SessionScoped)2 Typed (jakarta.enterprise.inject.Typed)2 ClientWindow (jakarta.faces.lifecycle.ClientWindow)2 Serializable (java.io.Serializable)2