Package org.springframework.context

Examples of org.springframework.context.ApplicationContext.publishEvent()


            {
                dspaceContext.abort();
            }
            if (context != null)
            {
                context.publishEvent(new ContextClosedEvent(context));
            }
        }
        log.info("#### END: -----" + new Date() + " ----- ####");
        System.exit(0);
    }
View Full Code Here


        // Commit the successful Authentication object to the secure
        // ContextHolder
        SecurityContextHolder.getContext().setAuthentication(result);

        // Fire application event to advise of new login
        appCtx.publishEvent(new LoginEvent(result));
    }

    public static Authentication logout() {
        Authentication existing = SecurityContextHolder.getContext().getAuthentication();
View Full Code Here

            existing = ClientSecurityEvent.NO_AUTHENTICATION;
        }

        // Fire application event to advise of logout
        ApplicationContext appCtx = Application.instance().getApplicationContext();
        appCtx.publishEvent(new LogoutEvent(existing));

        return existing;
    }

}
View Full Code Here

            result = authenticationManager.authenticate(request);
        } catch( SpringSecurityException e ) {
            logger.warn( "authentication failed", e);

            // Fire application event to advise of failed login
            appCtx.publishEvent( new AuthenticationFailedEvent(request, e));
           
            // And rethrow the exception to prevent the dialog from closing
            throw e;
        }
View Full Code Here

        bean.setEventCallback(callback);

        ApplicationContext context = ((MuleEventMulticaster) muleContext.getRegistry().lookupObject(
            "applicationEventMulticaster")).applicationContext;
        context.publishEvent(new TestApplicationEvent(context));

        whenFinished.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS);
        assertEquals(1, eventCounter1.get());
    }
View Full Code Here

        MuleClient client = new MuleClient(muleContext);
        client.send("vm://event.multicaster", "Test Spring MuleEvent", null);
        ApplicationContext context = ((MuleEventMulticaster) muleContext.getRegistry().lookupObject(
            "applicationEventMulticaster")).applicationContext;
        context.publishEvent(new TestApplicationEvent(context));

        whenFinished.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS);
        assertEquals(2, eventCounter1.get());
    }
View Full Code Here

                    ApplicationContext context = null;
                    try
                    {
                        context = ((MuleEventMulticaster) muleContext.getRegistry().lookupObject(
                            "applicationEventMulticaster")).applicationContext;
                        context.publishEvent(event);
                    }
                    catch (IllegalArgumentException e)
                    {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
View Full Code Here

    invocation.proceed();
    invCtrl.setReturnValue(new Object());

    invocation.getThis();
    invCtrl.setReturnValue(new Object());
    ctx.publishEvent(new MyEvent(new Object()));
    ctxCtrl.setDefaultMatcher(new AlwaysMatcher());

    ctxCtrl.replay();
    invCtrl.replay();
View Full Code Here

            result = getAuthenticationManager().authenticate( authentication );
        } catch( SpringSecurityException e ) {
            logger.info( "authentication failed: " + e.getMessage() );

            // Fire application event to advise of failed login
            appCtx.publishEvent( new AuthenticationFailedEvent( authentication, e ) );

            // rethrow the exception
            throw e;
        }
View Full Code Here

        // Commit the successful Authentication object to the secure ContextHolder
        SecurityContextHolder.getContext().setAuthentication( result );
        setAuthentication( result );

        // Fire application events to advise of new login
        appCtx.publishEvent( new AuthenticationEvent( result ) );
        appCtx.publishEvent( new LoginEvent( result ) );

        return result;
    }
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.