Package org.focusns.common.event.annotation

Examples of org.focusns.common.event.annotation.Event


                Class<?> beanClass = ClassUtils.forName(beanClassName, beanFactory.getBeanClassLoader());
                if(AnnotationUtils.isAnnotationDeclaredLocally(EventSubscriber.class, beanClass)) {
                    Method[] declearedMethods = beanClass.getDeclaredMethods();
                    for (Method declearedMethod : declearedMethods) {
                        //
                        Event event = AnnotationUtils.getAnnotation(declearedMethod, Event.class);
                        if (event != null) {
                            String eventKey = generateEventKey(event);
                            eventMapping.put(eventKey, event);
                            eventSubscriberMapping.put(eventKey, beanName);
                            //
View Full Code Here


            Throwable throwable) throws Exception {
        //
        Method method = getMethod(pjp);
        Map<String, Object> arguments = getArguments(method, pjp.getArgs());
        //
        Event event = getEvent(method, point);
        //
        if (event != null) {
            //
            String eventKey = generateEventKey(event);
            String subscriberName = eventSubscriberMapping.get(eventKey);
View Full Code Here

    private static final Log log = LogFactory.getLog(EventListener.class);

    public void onApplicationEvent(EventContext eventContext) {
        //
        Event event = eventContext.getEventHandler().getAnnotation(Event.class);
        //
        if(log.isDebugEnabled()) {
            log.debug(String.format("Event %s triggered!", event.on()));
        }
        // invoke event handle method
        Object eventSubscriber = eventContext.getEventSubscriber();
        //
        AutowireCapableBeanFactory beanFactory = eventContext.getApplicationContext().getAutowireCapableBeanFactory();
View Full Code Here

    public void multicastEvent(final ApplicationEvent appEvent) {
        if (ClassUtils.isAssignableValue(EventContext.class, appEvent)) {
            //
            Executor executor = getTaskExecutor();
            final EventContext eventContext = (EventContext) appEvent;
            Event event = eventContext.getEventHandler().getAnnotation(Event.class);
            //
            if (event.async()) {
                getTaskExecutor().execute(new Runnable() {
                    @Override
                    public void run() {
                        eventListener.onApplicationEvent(eventContext);
                    }
View Full Code Here

TOP

Related Classes of org.focusns.common.event.annotation.Event

Copyright © 2018 www.massapicom. 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.