Examples of EventBus


Examples of com.netflix.eventbus.spi.EventBus

public class AbstractEventBusBridgeTest {
    private static final Logger LOG = LoggerFactory.getLogger(AbstractEventBusBridgeTest.class);
   
    @Test
    public void testString() throws Exception {
        EventBus eventBus = new EventBusImpl();
       
        DummyEventBusBridge bridge = DummyEventBusBridge.builder()
            .withEventBus(eventBus)
            .withEventType(String.class)
            .withExpectedCount(1)
            .build();
       
        eventBus.publish(new String("Foo"));
        Assert.assertTrue(bridge.await(3,  TimeUnit.SECONDS));       
        Assert.assertEquals(1, bridge.getConsumeCount());
        Assert.assertEquals(0, bridge.getConsumeErrorCount());
    }  

Examples of com.ponysdk.core.event.EventBus

        PPusher.initialize();

        final PSimpleLayoutPanel panel = new PSimpleLayoutPanel();
        PRootLayoutPanel.get().add(panel);

        final EventBus eventBus = UIContext.getRootEventBus();

        final SampleActivityMapper mapper = new SampleActivityMapper();
        final PlaceHistoryMapper historyMapper = new DefaultPlaceHistoryMapper(eventBus);
        final PlaceController placeController = new PlaceController(uiContext.getHistory(), eventBus);

Examples of cpw.mods.fml.common.eventhandler.EventBus

    private static EventFactory factory = FMLCommonHandler.instance().getSide() == Side.CLIENT ? EventFactory.CLIENT : EventFactory.SERVER;
    FMLEventChannel(String name)
    {
        this.channels = NetworkRegistry.INSTANCE.newChannel(name, new NetworkEventFiringHandler(this));
        this.eventBus = new EventBus();
    }

Examples of de.kilobyte22.lib.event.EventBus

    public BotAccess(Kibibyte bot, Plugin plugin) {
        this.plugin = plugin;
        this.bot = bot;
        this.kibibyte = bot;

        eventBus = new EventBus(bot.eventBus);
        plugin.setEventBus(eventBus);
        eventBusLock = eventBus.new LockController();
        eventBusLock.setLockState(true); // BAM
        eventBusLock.setFrozen(true);

Examples of net.customware.gwt.presenter.client.EventBus

                injector.getDocumentListPresenter();
        RootPanel.get(CONTENT_DIV_ID).add(appPresenter.getDisplay().asWidget());
        appPresenter.bind();
        Window.enableScrolling(true);
        // eager load document list
        final EventBus eventBus = injector.getEventBus();

        GetDocumentList action =
                new GetDocumentList(injector.getLocation().getQueryDocuments());

        documentListPresenter.showLoading(true);
        final Stopwatch stopwatch = new Stopwatch().start();
        injector.getDispatcher().execute(action,
                new AsyncCallback<GetDocumentListResult>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        eventBus.fireEvent(new NotificationEvent(
                                NotificationEvent.Severity.Error,
                                "Failed to load documents"));
                        documentListPresenter.showLoading(false);
                        stopwatch.stop();
                    }

Examples of net.md_5.bungee.event.EventBus

        PropertyUtils propertyUtils = yamlConstructor.getPropertyUtils();
        propertyUtils.setSkipMissingProperties( true );
        yamlConstructor.setPropertyUtils( propertyUtils );
        yaml = new Yaml( yamlConstructor );

        eventBus = new EventBus( proxy.getLogger() );
    }

Examples of org.apache.cloudstack.framework.events.EventBus

    public List<AsyncJobVO> findInstancePendingAsyncJobs(AsyncJob.Type instanceType, Long accountId) {
        return _jobDao.findInstancePendingAsyncJobs(instanceType, accountId);
    }

    private void publishOnEventBus(AsyncJobVO job, String jobEvent) {
        EventBus eventBus = null;
        try {
            eventBus = ComponentContext.getComponent(EventBus.class);
        } catch(NoSuchBeanDefinitionException nbe) {
            return; // no provider is configured to provide events bus, so just return
        }

        // Get the event type from the cmdInfo json string
        String info = job.getCmdInfo();
        String cmdEventType;
        if ( info == null ) {
            cmdEventType = "unknown";
        } else {
            String marker = "\"cmdEventType\"";
            int begin = info.indexOf(marker);
            cmdEventType = info.substring(begin + marker.length() + 2, info.indexOf(",", begin) - 1);
        }

        // For some reason, the instanceType / instanceId are not abstract, which means we may get null values.
        org.apache.cloudstack.framework.events.Event event = new org.apache.cloudstack.framework.events.Event(
                ManagementServer.Name,
                EventCategory.ASYNC_JOB_CHANGE_EVENT.getName(),
                jobEvent,
                ( job.getInstanceType() != null ? job.getInstanceType().toString() : "unknown" ), null);

        User userJobOwner = _accountMgr.getUserIncludingRemoved(job.getUserId());
        Account jobOwner  = _accountMgr.getAccount(userJobOwner.getAccountId());

        Map<String, String> eventDescription = new HashMap<String, String>();
        eventDescription.put("command", job.getCmd());
        eventDescription.put("user", userJobOwner.getUuid());
        eventDescription.put("account", jobOwner.getUuid());
        eventDescription.put("processStatus", "" + job.getProcessStatus());
        eventDescription.put("resultCode", "" + job.getResultCode());
        eventDescription.put("instanceUuid", ApiDBUtils.findJobInstanceUuid(job));
        eventDescription.put("instanceType", ( job.getInstanceType() != null ? job.getInstanceType().toString() : "unknown" ) );
        eventDescription.put("commandEventType", cmdEventType);
        eventDescription.put("jobId", job.getUuid());

        // If the event.accountinfo boolean value is set, get the human readable value for the username / domainname
        Map<String, String> configs = _configDao.getConfiguration("management-server", new HashMap<String, String>());
        if ( Boolean.valueOf(configs.get("event.accountinfo")) ) {
            DomainVO domain = _domainDao.findById(jobOwner.getDomainId());
            eventDescription.put("username", userJobOwner.getUsername());
            eventDescription.put("domainname", domain.getName());
        }

        event.setDescription(eventDescription);

        try {
            eventBus.publish(event);
        } catch (EventBusException evx) {
            String errMsg = "Failed to publish async job event on the the event bus.";
            s_logger.warn(errMsg, evx);
            throw new CloudRuntimeException(errMsg);
        }

Examples of org.apache.shiro.event.EventBus

     * instance implements the {@link EventBusAware EventBusAware} interface.
     *
     * @since 1.3
     */
    protected void applyEventBusToSessionManager() {
        EventBus eventBus = getEventBus();
        if (eventBus != null && this.sessionManager instanceof EventBusAware) {
            ((EventBusAware)this.sessionManager).setEventBus(eventBus);
        }
    }

Examples of org.apache.shiro.event.EventBus

     * already in use.
     *
     * @since 1.3
     */
    protected void applyEventBusToRealms() {
        EventBus eventBus = getEventBus();
        Collection<Realm> realms = getRealms();
        if (eventBus != null && realms != null && !realms.isEmpty()) {
            for(Realm realm : realms) {
                if (realm instanceof EventBusAware) {
                    ((EventBusAware)realm).setEventBus(eventBus);

Examples of org.apache.wicket.atmosphere.EventBus

      this.eventBus = EventBus.get(application);
      this.eventBus.setBroadcaster(broadcaster);
    }
    else
    {
      this.eventBus = new EventBus(application, broadcaster);
    }

    initialize(wicketTester, page);
  }
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.