Examples of LoggedInEvent


Examples of org.apache.webbeans.test.event.LoggedInEvent

{
    private @Inject @Any Event<LoggedInEvent> event;

    public void afterLoggedIn()
    {
        LoggedInEvent loggedIn = new LoggedInEvent("Gurkan");

        event.fire(loggedIn);
    }
View Full Code Here

Examples of org.apache.webbeans.test.event.LoggedInEvent

        clear();

        AbstractComponent<ComponentWithObserves1> component = defineSimpleWebBean(ComponentWithObserves1.class);
        ContextFactory.initRequestContext(null);

        LoggedInEvent event = new LoggedInEvent("Gurkan");

        Annotation[] anns = new Annotation[1];
        anns[0] = new CurrentLiteral();

        getManager().fireEvent(event, anns);
View Full Code Here

Examples of org.apache.webbeans.test.event.LoggedInEvent

        clear();

        AbstractComponent<ComponentWithObserves1> component = defineSimpleWebBean(ComponentWithObserves1.class);
        ContextFactory.initRequestContext(null);

        LoggedInEvent event = new LoggedInEvent("Gurkan");

        class CheckLiteral extends AnnotationLiteral<Check> implements Check
        {

            public String type()
View Full Code Here

Examples of org.apache.webbeans.test.event.LoggedInEvent

        defineSimpleWebBean(CheckWithMoneyPayment.class);
        defineSimpleWebBean(PaymentProcessorComponent.class);
        AbstractComponent<ComponentWithObserves2> component = defineSimpleWebBean(ComponentWithObserves2.class);
        ContextFactory.initRequestContext(null);

        LoggedInEvent event = new LoggedInEvent("USER");

        class RoleUser extends AnnotationLiteral<Role> implements Role
        {

            public String value()
            {
                return "USER";
            }

        }

        class RoleAdmin extends AnnotationLiteral<Role> implements Role
        {

            public String value()
            {
                return "ADMIN";
            }

        }

        Annotation[] anns = new Annotation[1];
        anns[0] = new RoleUser();

        getManager().fireEvent(event, anns);
        ComponentWithObserves2 instance = getManager().getInstance(component);

        Assert.assertNotNull(instance.getPayment());
        Assert.assertEquals("USER", instance.getUser());

        anns[0] = new RoleAdmin();
        event = new LoggedInEvent("ADMIN");

        getManager().fireEvent(event, anns);
        instance = getManager().getInstance(component);

        Assert.assertNotNull(instance.getPayment());
View Full Code Here

Examples of org.apache.webbeans.test.event.LoggedInEvent

    private @Inject @TestingNormal Event<LoggedInEvent> myLIE;

    public void afterLoggedIn(@Observes @NotAny LoggedInEvent event)
    {
        this.userName = event.getUserName();
        myLIE.fire(new LoggedInEvent(this.userName));
    }
View Full Code Here

Examples of org.apache.webbeans.test.event.LoggedInEvent

    private @Inject @TestingIfExists Event<LoggedInEvent> myLIE;

    public void afterLoggedIn(@Observes(notifyObserver=Reception.IF_EXISTS) @NotAny LoggedInEvent event)
    {
        this.userName = event.getUserName();
        myLIE.fire(new LoggedInEvent("IE" + this.userName));
    }
View Full Code Here

Examples of org.apache.webbeans.test.event.LoggedInEvent

    private @Inject @TestingIfNonExists Event<LoggedInEvent> myLIE;

    public void afterLoggedIn(@Observes(notifyObserver=Reception.IF_EXISTS) @NotAny LoggedInEvent event)
    {
        this.userName = event.getUserName();
        myLIE.fire(new LoggedInEvent("INE" + this.userName));
    }
View Full Code Here

Examples of org.apache.webbeans.test.event.LoggedInEvent

{
    private @Inject @Any Event<LoggedInEvent> event;

    public void afterLoggedIn()
    {
        LoggedInEvent loggedIn = new LoggedInEvent("Gurkan");

        event.fire(loggedIn);
    }
View Full Code Here

Examples of org.jboss.errai.security.shared.event.LoggedInEvent

    StyleBindingsRegistry.get().updateStyles();
    if (user == null) {
      logoutEvent.fire(new LoggedOutEvent());
    }
    else {
      loginEvent.fire(new LoggedInEvent(user));
    }
  }
View Full Code Here

Examples of org.jboss.seam.security.events.LoggedInEvent

            if (isLoggedIn()) {
                // If authentication has already occurred during this request via a silent login,
                // and login() is explicitly called then we still want to raise the LOGIN_SUCCESSFUL event,
                // and then return.
                if (requestSecurityState.get().isSilentLogin()) {
                    beanManager.fireEvent(new LoggedInEvent(user));
                    return RESPONSE_LOGIN_SUCCESS;
                }

                beanManager.fireEvent(new AlreadyLoggedInEvent());
                return RESPONSE_LOGIN_SUCCESS;
            }

            boolean success = authenticate();

            if (success) {
                if (log.isDebugEnabled()) {
                    log.debug("Login successful");
                }
                beanManager.fireEvent(new LoggedInEvent(user));
                return RESPONSE_LOGIN_SUCCESS;
            }

            beanManager.fireEvent(new LoginFailedEvent(null));
            return RESPONSE_LOGIN_FAILED;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.