Package org.rioproject.event

Examples of org.rioproject.event.EventDescriptor


     * Helper method to return the EventDescriptor for this event
     *
     * @return The EventDescriptor for this event
     */
    public static EventDescriptor getEventDescriptor(){
        return(new EventDescriptor(ServiceLogEvent.class, ID));
    }
View Full Code Here


        java.util.Random rand = new java.util.Random(System.currentTimeMillis());
        long randomNumber = rand.nextLong();
        myPeerInfo = new ProvisionMonitor.PeerInfo(getServiceProxy(),
                                                   randomNumber,
                                                   computeResource.getAddress().getHostAddress());
        eventConsumer = new BasicEventConsumer(new EventDescriptor(ProvisionMonitorEvent.class,
                                                                   ProvisionMonitorEvent.ID),
                                               this,
                                               config);
        template = new ServiceTemplate(null, new Class[] {ProvisionMonitor.class}, null);
        new Thread(this).start();
View Full Code Here

            ProvisionMonitorEventProcessor eventProcessor = new ProvisionMonitorEventProcessor(config);
            provisionWatch = new GaugeWatch("Provision Clock", config);
            getWatchRegistry().register(provisionWatch);

            /* Wire up event handlers for the ProvisionMonitorEvent and the ProvisionFailureEvent */
            EventDescriptor clientEventDesc = ProvisionMonitorEvent.getEventDescriptor();
            getEventTable().put(clientEventDesc.eventID, eventProcessor.getMonitorEventHandler());

            EventDescriptor failureEventDesc = ProvisionFailureEvent.getEventDescriptor();
            /* EventHandler for ProvisionFailureEvent consumers */
            EventHandler failureHandler = new DispatchEventHandler(failureEventDesc, config);
            getEventTable().put(failureEventDesc.eventID, failureHandler);

            registerEventAdapters();
View Full Code Here

        return deployAdmin;
    }

    private void registerEventAdapters() throws LeaseDeniedException, UnknownEventException, RemoteException {
        // translate ProvisionFailureEvents to notifications
        EventDescriptor provisionFailureEventDescriptor = new EventDescriptor(ProvisionFailureEvent.class,
                                                                              ProvisionFailureEvent.ID);
        ProvisionFailureEventAdapter provisionFailureEventAdapter =
            new ProvisionFailureEventAdapter(objectName, getNotificationBroadcasterSupport());
        register(provisionFailureEventDescriptor, provisionFailureEventAdapter, null, Long.MAX_VALUE);

        // register notification info
        mbeanNoticationInfoList.add(provisionFailureEventAdapter.getNotificationInfo());

        // translate ProvisionMonitorEvents to notifications
        EventDescriptor provisionMonitorEventDescriptor = new EventDescriptor(ProvisionMonitorEvent.class,
                                                                              ProvisionMonitorEvent.ID
        );
        ProvisionMonitorEventAdapter provisionMonitorEventAdapter =
            new ProvisionMonitorEventAdapter(objectName, getNotificationBroadcasterSupport());
View Full Code Here

    @Test
    public void testSLAThresholdEventNotification() {
        Assert.assertNotNull(testManager);
        SLAThresholdEventProducer service =
            (SLAThresholdEventProducer)testManager.waitForService(SLAThresholdEventProducer.class);
        EventDescriptor eDesc = SLAThresholdEvent.getEventDescriptor();
        Assert.assertNotNull(service);
        DynamicEventConsumer eventConsumer = null;
        Throwable t = null;
        try {
            eventConsumer = new DynamicEventConsumer(eDesc,
View Full Code Here

        /*
         * Create an EventDescriptor for the SLAThresholdEvent and add it as an
         * attribute. Create a DispatchEventHandler to handle the sending of
         * SLAThresholdEvents
         */
        EventDescriptor slaEventDesc = SLAThresholdEvent.getEventDescriptor();
        slaEventHandler = new DispatchEventHandler(slaEventDesc, config);
        getEventTable().put(slaEventDesc.eventID, slaEventHandler);
        addAttribute(slaEventDesc);

        ServiceLogEventHandler appender = ServiceLogEventHandlerHelper.findInstance();
View Full Code Here

     * @throws IOException
     */
    private void applyServiceLogEventHandlerProperties(final ServiceLogEventHandler s, final Configuration config)
        throws IOException {
        if(s.getServiceLogEventPublisher()==null) {
            EventDescriptor serviceLogEventDescriptor = ServiceLogEvent.getEventDescriptor();
            EventHandler serviceLogEventHandler = new DispatchEventHandler(serviceLogEventDescriptor, config);
            getEventTable().put(serviceLogEventDescriptor.eventID, serviceLogEventHandler);
            ServiceLogEventPublisherImpl publisher = new ServiceLogEventPublisherImpl(serviceLogEventHandler,
                                                                                      (EventProducer)getExportedProxy());
            s.setServiceLogEventPublisher(publisher);
View Full Code Here

        thresholdTaskPool = Executors.newCachedThreadPool();
        /*
         * Create event descriptor for the SLAThresholdEvent and add it as
         * an attribute
         */
        EventDescriptor thresholdEventDesc = SLAThresholdEvent.getEventDescriptor();
        getEventTable().put(thresholdEventDesc.eventID, getSLAEventHandler());
        addAttribute(thresholdEventDesc);       

        addAttribute(new BasicStatus(StatusType.NORMAL));

View Full Code Here

     * Helper method to return the EventDescriptor for this event
     *
     * @return The EventDescriptor for this event
     */
    public static EventDescriptor getEventDescriptor(){
        return(new EventDescriptor(SLAThresholdEvent.class, ID));
    }
View Full Code Here

                            logger.debug(String.format("EventProducer discovered %s for EventDescriptor %s",
                                                      name, eventDescriptor.toString()));
                        }
                    }
                    if(eventConsumer==null) {
                        final EventDescriptor eventDescriptorToUse;
                        if(eventDescriptor.eventID==null) {
                            eventDescriptorToUse = getEventDescriptor(item.attributeSets, eventDescriptor);
                        } else {
                            eventDescriptorToUse = eventDescriptor;
                        }
View Full Code Here

TOP

Related Classes of org.rioproject.event.EventDescriptor

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.