Examples of EventSource


Examples of com.cloudera.flume.core.EventSource

   */
  @Test
  public void testTooManyOpens() throws IOException, FlumeSpecException, InterruptedException {
    Benchmark b = new Benchmark("connection exhaust");

    EventSource src = FlumeBuilder.buildSource(LogicalNodeContext.testingContext(),"thrift(31337)");

    EventSink snk = FlumeBuilder.buildSink("thrift(\"0.0.0.0\",31337)");

    src.open();

    // iterate until an exception is thrown
    int i = 0;
    try {
      for (i = 0; true; i++) {

        snk.open();
        System.out.println(i + " connections...");
      }
    } catch (IOException io) {
      System.out.println(io);
      b.mark("conns", i);
    }
    src.close();
    b.done();
  }
View Full Code Here

Examples of design_patterns.observer.EventSource

    }//GEN-LAST:event_search_btnActionPerformed

    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
        // TODO add your handling code here:
        // create an event source - reads from stdin
        final EventSource eventSource = new EventSource();
        eventSource.setUsername(this.user.getUsername());
        eventSource.setPassword(this.user.getPassword());
        eventSource.updateProducts(this.login_window);

            // create an observer
        final ProductHandler observer = new ProductHandler();
       
        if (this.jCheckBox1.isSelected()){
            // subscribe the observer to the event source
            eventSource.addObserver(observer);

            // starts the event thread
            Thread thread = new Thread(eventSource);
            thread.start();
        }
        else{
            // unsubscribe the observer to the event source
            eventSource.deleteObserver(observer);
        }
    }//GEN-LAST:event_jCheckBox1ActionPerformed
View Full Code Here

Examples of net.ftlines.wicket.fullcalendar.EventSource

  protected void respond(AjaxRequestTarget target) {
    Request r = getCalendar().getRequest();
    String eventId = r.getRequestParameters().getParameterValue("eventId").toString();
    String sourceId = r.getRequestParameters().getParameterValue("sourceId").toString();

    EventSource source = getCalendar().getEventManager().getEventSource(sourceId);
    Event event = source.getEventProvider().getEventForId(eventId);

    onClicked(new ClickedEvent(source, event), new CalendarResponse(getCalendar(), target));
  }
View Full Code Here

Examples of net.ftlines.wicket.fullcalendar.EventSource

  protected boolean onEvent(AjaxRequestTarget target) {
    Request r = getCalendar().getRequest();
    String eventId = r.getRequestParameters().getParameterValue("eventId").toString();
    String sourceId = r.getRequestParameters().getParameterValue("sourceId").toString();

    EventSource source = getCalendar().getEventManager().getEventSource(sourceId);
    Event event = source.getEventProvider().getEventForId(eventId);

    int dayDelta = r.getRequestParameters().getParameterValue("dayDelta").toInt();
    int minuteDelta = r.getRequestParameters().getParameterValue("minuteDelta").toInt();
    boolean allDay = r.getRequestParameters().getParameterValue("allDay").toBoolean();
View Full Code Here

Examples of net.ftlines.wicket.fullcalendar.EventSource

  protected boolean onEvent(AjaxRequestTarget target) {
    Request r = getCalendar().getRequest();
    String eventId = r.getRequestParameters().getParameterValue("eventId").toString();
    String sourceId = r.getRequestParameters().getParameterValue("sourceId").toString();

    EventSource source = getCalendar().getEventManager().getEventSource(sourceId);
    Event event = source.getEventProvider().getEventForId(eventId);

    int dayDelta = r.getRequestParameters().getParameterValue("dayDelta").toInt();
    int minuteDelta = r.getRequestParameters().getParameterValue("minuteDelta").toInt();

    return onEventResized(new ResizedEvent(source, event, dayDelta, minuteDelta), new CalendarResponse(
View Full Code Here

Examples of net.ftlines.wicket.fullcalendar.EventSource

      int localOffset = DateTimeZone.getDefault().getOffset(null) / 60000;
      int minutesAdjustment = remoteOffset - localOffset;
      start = start.plusMinutes(minutesAdjustment);
      end = end.plusMinutes(minutesAdjustment);
    }
    EventSource source = getCalendar().getEventManager().getEventSource(sid);
    EventProvider provider = source.getEventProvider();
    String response = getCalendar().toJson(provider.getEvents(start, end));

    getCalendar().getRequestCycle().scheduleRequestHandlerAfterCurrent(
      new TextRequestHandler("application/json", "UTF-8", response));
View Full Code Here

Examples of org.apache.commons.configuration.event.EventSource

        }
    }

    public void addChangeListener( RegistryListener listener )
    {
        EventSource configuration = (EventSource) this.configuration;

        configuration.addConfigurationListener( new ConfigurationListenerDelegate( listener, this ) );
    }
View Full Code Here

Examples of org.apache.commons.configuration2.event.EventSource

        ConfigurationBuilder<BaseHierarchicalConfiguration> builder =
                createBuilderMock(conf);
        EasyMock.replay(builder);
        BuilderConfigurationWrapperFactory factory =
                new BuilderConfigurationWrapperFactory(EventSourceSupport.DUMMY);
        EventSource src =
                (EventSource) factory.createBuilderConfigurationWrapper(
                        HierarchicalConfiguration.class, builder);
        src.addEventListener(ConfigurationEvent.ANY, null);
    }
View Full Code Here

Examples of org.glassfish.jersey.media.sse.EventSource

        final EventSource[] sources = new EventSource[MAX_LISTENERS];
        final AtomicInteger sizeEventsCount = new AtomicInteger(0);

        for (int i = 0; i < MAX_LISTENERS; i++) {
            final int id = i;
            final EventSource es = EventSource.target(itemsTarget.path("events"))
                    .named("SOURCE " + id).build();
            sources[id] = es;

            final Queue<Integer> indexes = new ConcurrentLinkedQueue<Integer>();
            indexQueues.add(indexes);

            es.register(new EventListener() {
                @Override
                @SuppressWarnings("MagicNumber")
                public void onEvent(InboundEvent inboundEvent) {
                    try {
                        if (inboundEvent.getName() == null) {
View Full Code Here

Examples of org.hibernate.event.EventSource

  }
   
  protected void entityIsPersistent(PersistEvent event, Map createCache) {
    log.trace("ignoring persistent instance");
    final EventSource source = event.getSession();
   
    //TODO: check that entry.getIdentifier().equals(requestedId)
   
    final Object entity = source.getPersistenceContext().unproxy( event.getObject() );
    final EntityPersister persister = source.getEntityPersister( event.getEntityName(), entity );
   
    if ( createCache.put(entity, entity)==null ) {
      //TODO: merge into one method!
      cascadeBeforeSave(source, persister, entity, createCache);
      cascadeAfterSave(source, persister, entity, createCache);
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.