Package org.rioproject.event

Examples of org.rioproject.event.EventHandler


            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();

            provisioner = new ServiceProvisioner(config, getEventProxy(), failureHandler, provisionWatch);
View Full Code Here


     */
    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);
            addAttribute(serviceLogEventDescriptor);
View Full Code Here

                                        "failed to invoke setBackend method on [{}] impl",
                                        context.getAssociationManagement(), sElem.getName());
                        }

                        if(context instanceof DefaultServiceBeanContext) {
                            EventHandler eH = ((DefaultServiceBeanContext)context).getEventTable().get(SLAThresholdEvent.ID);
                            if(eH!=null) {
                                slaEventHandler = eH;
                                logger.debug("Set EventHandler [{}] for SLAManagement for service {}",
                                            slaEventHandler.getClass().getName(), sElem.getName());
                            }
View Full Code Here

        /* Set up thread deadlock detection */
        ServiceElementUtil.setThreadDeadlockDetector(sElem, null);

        /* Get the SLA ThresholdEvent wired up */
        EventHandler slaThresholdEventHandler = null;
        instance = container.activate(sElem, opMgr, null);
        ServiceBeanDelegateImpl delegate = (ServiceBeanDelegateImpl) container.getServiceBeanDelegate(instance.getServiceBeanID());
        ServiceBeanLoaderResult result = delegate.getLoadedServiceResult();
        if(result.getImpl() instanceof ServiceBeanAdapter) {
            slaThresholdEventHandler = ((ServiceBeanAdapter)result.getImpl()).getSLAEventHandler();
View Full Code Here

        if(descriptor == null)
            throw new IllegalArgumentException("descriptor is null");
        if(descriptor.eventID == null)
            throw new UnknownEventException("Event ID is null");
        EventHandler eHandler = eventTable.get(descriptor.eventID);
        if(eHandler == null)
            throw new UnknownEventException("Unknown event ID "+descriptor.eventID);

        /* Prepare the RemoteEventListener */
        RemoteEventListener preparedListener = (RemoteEventListener)listenerPreparer.prepareProxy(listener);
        if(logger.isDebugEnabled())
            logger.debug("Register listener {} for Event {}", preparedListener.toString(), descriptor.toString());
        Object o = getServiceProxy();
        if(!(o instanceof EventProducer)) {
            String reason = "Proxy returned from getServiceProxy() does " +
                           "not implement "+EventProducer.class.getName();
            logger.warn(reason);
            throw new ClassCastException(reason);
        }
       
        return (eHandler.register(o, preparedListener, handback, duration));
    }
View Full Code Here

TOP

Related Classes of org.rioproject.event.EventHandler

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.