All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.deephacks.graphene.Application Maven / Gradle / Ivy

The newest version!
package org.deephacks.graphene;


import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.inject.Singleton;

@ApplicationScoped
public class Application {

    @Inject
    private Graphene graphene;

    @Produces
    @Singleton
    public static Graphene produceGraphene() {
        return Graphene.get().get();
    }

    @Produces
    @ApplicationScoped
    public EntityRepository produceRepository() {
        return new EntityRepository();
    }

    @PreDestroy
    public void closing() {
        System.out.println("Closing graphene...");
        graphene.close();
        System.out.println("Closing graphene success");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy