Package org.b3log.latke.event

Examples of org.b3log.latke.event.EventManager


    private void registerEventProcessor() {
        Stopwatchs.start("Register Event Processors");

        LOGGER.log(Level.INFO, "Registering event processors....");
        try {
            final EventManager eventManager = EventManager.getInstance();

            eventManager.registerListener(new ArticleCommentReplyNotifier());
            eventManager.registerListener(new PageCommentReplyNotifier());
            eventManager.registerListener(new AddArticleGoogleBlogSearchPinger());
            eventManager.registerListener(new UpdateArticleGoogleBlogSearchPinger());
            eventManager.registerListener(new ArticleSender());
            eventManager.registerListener(new PluginRefresher());
            eventManager.registerListener(new ViewLoadEventHandler());
        } catch (final Exception e) {
            LOGGER.log(Level.SEVERE, "Register event processors error", e);
            throw new IllegalStateException(e);
        }
View Full Code Here


    private void registerEventProcessor() {
        Stopwatchs.start("Register Event Processors");

        LOGGER.log(Level.INFO, "Registering event processors....");
        try {
            final EventManager eventManager = beanManager.getReference(EventManager.class);

            // Comment
            eventManager.registerListener(new ArticleCommentReplyNotifier());
            eventManager.registerListener(new PageCommentReplyNotifier());
            // Article
            eventManager.registerListener(new AddArticleGoogleBlogSearchPinger());
            eventManager.registerListener(new UpdateArticleGoogleBlogSearchPinger());
            // Plugin
            eventManager.registerListener(new PluginRefresher());
            eventManager.registerListener(new ViewLoadEventHandler());
            // Sync
            eventManager.registerListener(new ArticleSender());
            eventManager.registerListener(new ArticleUpdater());
            eventManager.registerListener(new CommentSender());
        } catch (final Exception e) {
            LOGGER.log(Level.ERROR, "Register event processors error", e);
            throw new IllegalStateException(e);
        }
View Full Code Here

            }

            final Skins skins = Skins.getInstance();
            skins.loadSkins(preference);

            final EventManager eventManager = EventManager.getInstance();

            eventManager.fireEventSynchronously(// for upgrade extensions
                    new Event<JSONObject>(EventTypes.PREFERENCE_LOAD,
                                          preference));

            Preferences.getInstance().setPreference(preference);
        } catch (final Exception e) {
View Full Code Here

    /**
     * Register event processors.
     */
    private void registerEventProcessor() {
        try {
            final EventManager eventManager = EventManager.getInstance();

            /**
             * See issue 38 (http://code.google.com/p/b3log-solo/issues/detail?id=38)
             * for more details.
             *
             * new ActivityCreator(eventManager);
             */
            eventManager.registerListener(new TencentMicroblogSender());
            eventManager.registerListener(new ArticleCommentReplyNotifier());
            eventManager.registerListener(new PageCommentReplyNotifier());
            eventManager.registerListener(new AddArticleGoogleBlogSearchPinger());
            eventManager.registerListener(
                    new UpdateArticleGoogleBlogSearchPinger());
            eventManager.registerListener(new ArticleSender());

            /*
             * See issue 225 (http://code.google.com/p/b3log-solo/issues/detail?id=225#c4)
             * for more details.
             *
             * eventManager.registerListener(new BlogJavaAddArticleProcessor());
             * eventManager.registerListener(new BlogJavaRemoveArticleProcessor());
             * eventManager.registerListener(new BlogJavaUpdateArticleProcessor());
             * eventManager.registerListener(new CSDNBlogAddArticleProcessor());
             * eventManager.registerListener(new CSDNBlogRemoveArticleProcessor());
             * eventManager.registerListener(new CSDNBlogUpdateArticleProcessor());
             * eventManager.registerListener(new CnBlogsAddArticleProcessor());
             * eventManager.registerListener(new CnBlogsRemoveArticleProcessor());
             * eventManager.registerListener(new CnBlogsUpdateArticleProcessor());
             */

            eventManager.registerListener(new PluginRefresher());
            eventManager.registerListener(new ViewLoadEventHandler());
        } catch (final Exception e) {
            LOGGER.log(Level.SEVERE, "Register event processors error", e);
            throw new IllegalStateException(e);
        }
    }
View Full Code Here

            final Class<?> eventListenerClass = classLoader.loadClass(eventListenerClassName);
            final Method getInstance = eventListenerClass.getMethod("getInstance");
            final AbstractEventListener<?> eventListener = (AbstractEventListener) getInstance.invoke(eventListenerClass);

            final EventManager eventManager = EventManager.getInstance();
            eventManager.registerListener(eventListener);
            LOGGER.log(Level.FINER, "Registered event listener[class={0}, eventType={1}] for plugin[name={2}]",
                       new Object[]{eventListener.getClass(), eventListener.getEventType(), plugin.getName()});
        }
    }
View Full Code Here

TOP

Related Classes of org.b3log.latke.event.EventManager

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.