Package org.rioproject.monitor

Examples of org.rioproject.monitor.ProvisionMonitorEvent


                }

            } else if(event instanceof ProvisionMonitorEvent) {
                String label = "ProvisionMonitorEvent."+eventNode.getValueAt(0);
                tableData.put("Event", label);
                ProvisionMonitorEvent pme = (ProvisionMonitorEvent)event;
                StringBuilder builder = new StringBuilder();
                if(pme.getAction().equals(ProvisionMonitorEvent.Action.OPSTRING_DEPLOYED) ||
                   pme.getAction().equals(ProvisionMonitorEvent.Action.OPSTRING_UNDEPLOYED)) {
                    StringBuilder serviceNameBuilder = new StringBuilder();
                    for(ServiceElement service : pme.getOperationalString().getServices()) {
                        if(serviceNameBuilder.length()>0) {
                            serviceNameBuilder.append(", ");
                        }
                        serviceNameBuilder.append(service.getName());
                    }
                    builder.append(serviceNameBuilder.toString());
                    tableData.put("When", Constants.DATE_FORMAT.format(event.getDate()));
                    tableData.put("Deployment", pme.getOperationalStringName());
                    tableData.put("Services", builder.toString());
                } else {
                    tableData.put("When", Constants.DATE_FORMAT.format(event.getDate()));
                    tableData.put("Deployment", pme.getOperationalStringName());
                    tableData.put("Description", eventNode.getDescription());
                }

            } else if(event instanceof ServiceLogEvent) {
                String label = "ServiceLogEvent."+eventNode.getValueAt(0);
View Full Code Here


    class Listener implements RemoteServiceEventListener {
        boolean added;
        boolean failed;

        public void notify(RemoteServiceEvent event) {
            ProvisionMonitorEvent pme = (ProvisionMonitorEvent)event;
            System.out.println("ProvisionMonitorEvent->"+pme.getAction());
            if(pme.getAction().equals(ProvisionMonitorEvent.Action.SERVICE_FAILED))
                failed = true;
            if(pme.getAction().equals(ProvisionMonitorEvent.Action.SERVICE_PROVISIONED))
                added = true;
        }
View Full Code Here

            opStringMangerController.getDeploymentVerifier().verifyOperationalString(newOpString, getRemoteRepositories());
        } catch (Exception e) {
            throw new OperationalStringException("Verifying deployment for [" + newOpString.getName() + "]", e);
        }
        Map<String, Throwable> map = doUpdateOperationalString(newOpString);
        ProvisionMonitorEvent event = new ProvisionMonitorEvent(serviceProxy,
                                                                ProvisionMonitorEvent.Action.OPSTRING_UPDATED,
                                                                doGetOperationalString());
        eventProcessor.processEvent(event);
        return (map);
    }
View Full Code Here

        if (!isActive())
            throw new OperationalStringException("not the primary OperationalStringManager");
        try {
            doAddServiceElement(sElem, listener);
            stateChanged(false);
            ProvisionMonitorEvent event = new ProvisionMonitorEvent(serviceProxy,
                                                                    ProvisionMonitorEvent.Action.SERVICE_ELEMENT_ADDED,
                                                                    sElem);
            eventProcessor.processEvent(event);

        } catch (Throwable t) {
View Full Code Here

            throw new IllegalArgumentException("ServiceElement is null");
        if (!isActive())
            throw new OperationalStringException("not the primary OperationalStringManager");
        try {
            doRemoveServiceElement(sElem, destroy);
            ProvisionMonitorEvent event =
                new ProvisionMonitorEvent(serviceProxy,
                                          ProvisionMonitorEvent.Action.SERVICE_ELEMENT_REMOVED,
                                          sElem);
            eventProcessor.processEvent(event);
        } catch (Throwable t) {
            if (t instanceof OperationalStringException)
View Full Code Here

        if (!isActive())
            throw new OperationalStringException("not the primary OperationalStringManager");
        try {
            doUpdateServiceElement(sElem);
            ProvisionMonitorEvent.Action action = ProvisionMonitorEvent.Action.SERVICE_ELEMENT_UPDATED;
            ProvisionMonitorEvent event = new ProvisionMonitorEvent(serviceProxy, action, sElem);
            eventProcessor.processEvent(event);
        } catch (Throwable t) {
            logger.warn("Updating ServiceElement [{}]", sElem.getName(), t);
            throw new OperationalStringException("Updating ServiceElement [" + sElem.getName() + "]", t);
        }
View Full Code Here

        throws OperationalStringException {
        if (instance == null)
            throw new IllegalArgumentException("instance is null");
        try {
            ServiceElement sElem = doUpdateServiceBeanInstance(instance);
            ProvisionMonitorEvent event = new ProvisionMonitorEvent(serviceProxy,
                                                                    sElem.getOperationalStringName(),
                                                                    instance);
            eventProcessor.processEvent(event);
        } catch (Throwable t) {
            logger.warn("Updating ServiceBeanInstance [{}] {}: {}",
View Full Code Here

            ServiceElement changed = svcElemMgr.increment(permanent, preparedListener);
            if (changed == null)
                return;
            stateChanged(false);
            updateServiceElements(new ServiceElement[]{changed});
            ProvisionMonitorEvent event = new ProvisionMonitorEvent(serviceProxy,
                                                                    ProvisionMonitorEvent.Action.SERVICE_BEAN_INCREMENTED,
                                                                    changed);
            eventProcessor.processEvent(event);
        } catch (Throwable t) {
            String message = String.format("Incrementing ServiceElement [%s] %s: %s" ,
View Full Code Here

            numTrimmed = svcElemMgr.trim(trimUp);
            if (numTrimmed > 0) {
                stateChanged(false);
                ServiceElement updatedElement = svcElemMgr.getServiceElement();
                updateServiceElements(new ServiceElement[]{updatedElement});
                ProvisionMonitorEvent event = new ProvisionMonitorEvent(serviceProxy,
                                                                        ProvisionMonitorEvent.Action.SERVICE_BEAN_DECREMENTED,
                                                                        updatedElement);
                eventProcessor.processEvent(event);
            }
            return (numTrimmed);
View Full Code Here

        ServiceElement sElem = svcElemMgr.decrement(instance, recommended, destroy);
        if(sElem==null)
            return;
        stateChanged(false);
        updateServiceElements(new ServiceElement[]{sElem});
        ProvisionMonitorEvent event = new ProvisionMonitorEvent(serviceProxy,
                                                                ProvisionMonitorEvent.Action.SERVICE_BEAN_DECREMENTED,
                                                                sElem.getOperationalStringName(),
                                                                sElem,
                                                                instance);
        eventProcessor.processEvent(event);
View Full Code Here

TOP

Related Classes of org.rioproject.monitor.ProvisionMonitorEvent

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.