Examples of ApplicationEvent


Examples of org.glassfish.jersey.server.monitoring.ApplicationEvent

        }, 0, interval, TimeUnit.MILLISECONDS);
    }

    private void processApplicationEvents() {
        while (!monitoringEventListener.getApplicationEvents().isEmpty()) {
            final ApplicationEvent appEvent = monitoringEventListener.getApplicationEvents().remove();
            switch (appEvent.getType()) {
                case INITIALIZATION_FINISHED:
                case RELOAD_FINISHED:
                    final ApplicationStatisticsImpl initStatistics = new ApplicationStatisticsImpl(appEvent.getResourceConfig(),
                            new Date(monitoringEventListener.getApplicationStartTime()), appEvent.getRegisteredClasses(),
                            appEvent.getRegisteredInstances(), appEvent.getProviders());
                    statisticsBuilder.setApplicationStatisticsImpl(initStatistics);
                    break;
            }

        }
View Full Code Here

Examples of org.glassfish.jersey.server.monitoring.ApplicationEvent

        }

        logApplicationInitConfiguration(locator, resourceBag, processingProviders);

        if (compositeListener != null) {
            final ApplicationEvent initFinishedEvent = new ApplicationEventImpl(
                    ApplicationEvent.Type.INITIALIZATION_APP_FINISHED, runtimeConfig,
                    componentBag.getRegistrations(), resourceBag.classes, resourceBag.instances, resourceModel);
            compositeListener.onEvent(initFinishedEvent);

            final MonitoringContainerListener containerListener
View Full Code Here

Examples of org.jmanage.core.config.event.ApplicationEvent

            return;
        }
        // Note that application removed event is not being handled. We probably don't care about
        //   the downtime of a removed application.
       
        ApplicationEvent appEvent = (ApplicationEvent)event;
        ApplicationDowntimeHistory downtimeHistory = getDowntimeHistory(appEvent.getApplicationConfig());
        assert downtimeHistory != null;
        if(appEvent instanceof ApplicationUpEvent){
            // application must have went down earlier
            assert downtimeHistory.getDowntimeBegin() != null;
            // log the downtime to the db
            recordDowntime(appEvent.getApplicationConfig().getApplicationId(),
                    downtimeHistory.getDowntimeBegin(), appEvent.getTime());
            downtimeHistory.applicationCameUp(appEvent.getTime());
        }else if(event instanceof ApplicationDownEvent){
            downtimeHistory.applicationWentDown(appEvent.getTime());
        }
    }
View Full Code Here

Examples of org.qi4j.library.eventsourcing.application.api.ApplicationEvent

        @Override
        public ApplicationEvent createEvent( String name, Object[] args )
        {
            ValueBuilder<ApplicationEvent> builder = vbf.newValueBuilder( ApplicationEvent.class );

            ApplicationEvent prototype = builder.prototype();
            prototype.name().set( name );
            prototype.on().set( new Date() );

            prototype.identity().set( idGenerator.generate( ApplicationEvent.class ) );

            UnitOfWork uow = uowf.currentUnitOfWork();
            prototype.usecase().set( uow.usecase().name() );
            prototype.version().set( version );

            // JSON-ify parameters
            JSONStringer json = new JSONStringer();
            try
            {
                JSONWriter params = json.object();
                for (int i = 1; i < args.length; i++)
                {
                    params.key( "param" + i );
                    if (args[i] == null)
                        params.value( JSONObject.NULL );
                    else
                        params.value( args[i] );
                }
                json.endObject();
            } catch (JSONException e)
            {
                throw new IllegalArgumentException( "Could not create event", e );
            }

            prototype.parameters().set( json.toString() );

            ApplicationEvent event = builder.newInstance();

            return event;
        }
View Full Code Here

Examples of org.springframework.context.ApplicationEvent

*/
public class ApplicationContextEventBrokerTest {

    @Test
    public void testOnApplicationEvent() {
        ApplicationEvent event = new ApplicationEvent(this) {
            @Override
            public Object getSource() {
                return "mySource";
            }
        };
View Full Code Here

Examples of org.springframework.context.ApplicationEvent

  @Test
  public void emitsRepositoriesPopulatedEventIfPublisherConfigured() throws Exception {

    RepositoryPopulator populator = setUpReferenceAndInititalize(new User(), publisher);

    ApplicationEvent event = new RepositoriesPopulatedEvent(populator, repositories);
    verify(publisher, times(1)).publishEvent(event);
  }
View Full Code Here

Examples of org.springframework.context.ApplicationEvent

                    }
                }),
                new Button("Publish Application Context Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        applicationContext.publishEvent(new ApplicationEvent("Hello World from ApplicationContext") {
                            @Override
                            public Object getSource() {
                                return EventsUI.this;
                            }
                        });
View Full Code Here

Examples of org.springframework.context.ApplicationEvent

                    }
                }),
                new Button("Publish Application Context Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        applicationContext.publishEvent(new ApplicationEvent("Hello World from ApplicationContext") {
                            @Override
                            public Object getSource() {
                                return EventBusUI.this;
                            }
                        });
View Full Code Here

Examples of org.springframework.context.ApplicationEvent

    public Producer createProducer() throws Exception {
        ObjectHelper.notNull(applicationContext, "applicationContext");
        return new DefaultProducer(this) {
            public void process(Exchange exchange) throws Exception {
                ApplicationEvent event = toApplicationEvent(exchange);
                applicationContext.publishEvent(event);
            }
        };
    }
View Full Code Here

Examples of org.springframework.context.ApplicationEvent

    protected LoadBalancer createLoadBalancer() {
        return new TopicLoadBalancer();
    }

    protected ApplicationEvent toApplicationEvent(Exchange exchange) {
        ApplicationEvent event = exchange.getIn().getBody(ApplicationEvent.class);
        if (event != null) {
            return event;
        }
        return new CamelEvent(this, exchange);
    }
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.