Class SessionProducer


  • @ApplicationScoped
    public class SessionProducer
    extends Object
    A CDI producer for Session instances.
    Since:
    20.06
    Author:
    Jonathan Knight 2019.11.06
    • Constructor Detail

      • SessionProducer

        @Inject
        public SessionProducer​(javax.enterprise.inject.spi.BeanManager context)
    • Method Detail

      • getDefaultSession

        @Produces
        public Session getDefaultSession​(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
        Produces the default Session.
        Parameters:
        injectionPoint - the InjectionPoint that the cache factory it to be injected into
        Returns:
        the default Session
      • getSessionWithSessionName

        @Produces
        @SessionName
        public Session getSessionWithSessionName​(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
        Produces a Session for a given scope.

        If the value of the scope qualifier is blank or empty, the default Session will be returned.

        Parameters:
        injectionPoint - the InjectionPoint that the cache factory it to be injected into
        Returns:
        the named Session
      • getSessionWithName

        @Produces
        @Name("")
        public Session getSessionWithName​(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
        Produces a Session for a given scope.

        If the value of the scope qualifier is blank or empty, the default Session will be returned.

        Parameters:
        injectionPoint - the InjectionPoint that the cache factory it to be injected into
        Returns:
        the named Session