/** * @author Arun Gupta * * This class represents a Session Scoped CDI bean. Once injected, the container will hold on to the instance of this bean until * the HTTP session expires. A new instance would be created with start of a fresh HTTP session */ @SessionScoped public class MySessionScopedBean implements Serializable { public String getID() { return this + ""; } }
/** * @author Radim Hanus */ @SessionScoped public class GreetingReceiver implements EventReceiver, Serializable { private String greet = "Willkommen"; void receive(@Observes String greet) { this.greet = greet; } @Override public String getGreet() { return greet; } }
/** * @author Radim Hanus */ @SessionScoped public class GreetingReceiver implements EventReceiver, Serializable { private String greet = "Willkommen"; void receive(@Observes(notifyObserver = Reception.IF_EXISTS) String greet) { this.greet = greet; } @Override public String getGreet() { return greet; } }
@SessionScoped class UnderwaterCity implements CityInterface, Serializable { private static final long serialVersionUID = 3226222322140685248L; public void foo() { } }
@Stateless @SessionScoped public class Bullmastiff_Broken implements BullmastiffLocal_Broken { }
@SessionScoped class Salo_Broken extends City implements Serializable { private static final long serialVersionUID = 5500591077418621816L; @SuppressWarnings("unused") @Inject private transient Violation reference; }
@SuppressWarnings("serial") @SessionScoped class Vaasa implements Serializable { @SuppressWarnings("unused") @Inject private HelsinkiLocal ejb; }
@SessionScoped public class SimpleBeanB implements Serializable { private static final long serialVersionUID = 1L; @Inject private SimpleBeanZ z; public SimpleBeanZ getZ() { return z; } }
@SessionScoped public class Salo_Broken extends City implements Serializable { private static final long serialVersionUID = 5500591077418621816L; @SuppressWarnings("unused") @Inject private transient Violation reference; }
@SessionScoped @BakedBinding class BakedBean implements Serializable { void bake() {} }
@Stateful @SessionScoped public class SessionScopedSessionBean implements SessionScopedSessionInterface { @Remove public void remove() { } }
@Stateful @SessionScoped public class Cup_Broken { @Inject @SuppressWarnings("unused") private Foo foo; }
@Stateful @SessionScoped public class Espoo_Broken implements EspooLocal_Broken { @Remove public void bye() { } }
@Stateful @SessionScoped public class FieldInjectionCorralBroken extends Ranch { @Inject @British Cow cow; public void ping() { } }
@Stateful @SessionScoped public class ConstructorInjectionCorralBroken extends Ranch { private Cow cow; public ConstructorInjectionCorralBroken(){} @Inject public ConstructorInjectionCorralBroken(@British Cow cow){ this.cow = cow; } public void ping(){ } }
@SessionScoped @Digital public class Elephant implements ElephantLocal { @Remove public void remove() { } }
@Stateful @SessionScoped @Interceptors(BrokenDecorator.class) public class Espoo_Broken implements EspooLocal_Broken { @Remove public void bye() { } }
@Stateful @SessionScoped @City public class Espoo_Broken implements EspooLocal_Broken { @Remove public void bye() { } }
@Bean @SessionScoped public SessionScopedBean sessionScopedBean() { return new SessionScopedBean(); }
@Bean @SessionScoped public SessionScopedBean sessionScopedBean() { return new SessionScopedBean(); }