Package org.rioproject.servicecore

Examples of org.rioproject.servicecore.Service


    }

    class FeederTask implements Runnable {
       
        public void run() {
            Service s = getService();
            if(s!=null) {
                try {
                    CalculablePatient c = checkAdd(s, "pulse", lastPulse);
                    if(c!=null) {
                        lastPulse = c;
View Full Code Here


        bedAssignmentCheckingPool.shutdownNow();
        patientStats.shutdown();
    }

    private void wireUpProvisionMonitorEventListener(final Object o) throws Exception {
        Service s = (Service)o;
        ServiceAdmin sAdmin = (ServiceAdmin) s.getAdmin();
        ServiceItem items[] = null;
        for(ServiceRegistrar sr : sAdmin.getJoinSet()) {
            ServiceMatches sm = sr.lookup(new ServiceTemplate(null, new Class[]{ProvisionMonitor.class}, null),
                                          Integer.MAX_VALUE);
            if(sm.items!=null && sm.items.length>0) {
View Full Code Here

    }

    private ServiceHandle getServiceHandle(Object o, List<String> watches, Entry[] entries) {
        ServiceHandle handle = new ServiceHandle();
        if(o instanceof Service) {
            Service s = (Service)o;
            try {
                ServiceElement elem = ((ServiceAdmin)s.getAdmin()).getServiceElement();
                OperationalStringManager opMgr = ((DeployAdmin)monitor.getAdmin()).getOperationalStringManager(elem.getOperationalStringName());
                handle.setElem(elem);
                handle.setOpMgr(opMgr);
                for(String watch : watches) {
                    try {
                        WatchDataSource wds = s.fetch(watch);
                        logger.debug("WatchDataSource for watch [{}]: {}", watch, wds);
                        if(wds==null)
                            continue;
                        handle.addToWatchMap(watch, wds);
                        ThresholdValues tVals = wds.getThresholdValues();
                        if(tVals instanceof SLA) {
                            handle.addToSLAMap(watch, (SLA)tVals);
                        }
                    } catch (RemoteException e) {
                        logger.warn("Could not add AssociationsWatchDataReplicator to remote WatchDataSource.", e);
                    }
                }
            } catch (RemoteException e) {
                handle = null;
                logger.warn("Could not get ServiceElement or OperationalStringManager.", e);

            } catch (OperationalStringException e) {
                handle = null;
                logger.error("Could not get OperationalStringManager, unable to create AssociationsWatchDataReplicator.",
                             e);
            }
        } else {
            String opStringName = null;
            for(Entry e : entries) {
                if(e instanceof OperationalStringEntry) {
                    opStringName = ((OperationalStringEntry)e).name;
                    break;
                }
            }
            logger.info("OperationalString for service: [{}]", opStringName);
            if(opStringName!=null) {
                try {
                    OperationalStringManager opMgr = ((DeployAdmin)monitor.getAdmin()).getOperationalStringManager(opStringName);
                    ServiceElement elem = opMgr.getServiceElement(o);
                    if(elem==null) {
                        logger.warn("Unable to obtain ServiceElement for service [{}], cannot create AssociationsWatchDataReplicator.",
                                    o.toString());
                        return null;
                    }
                    handle.setElem(elem);
                    handle.setOpMgr(opMgr);
                    Cybernode c = null;

                    for(ServiceBeanInstance sbi : opMgr.getServiceBeanInstances(elem)) {
                        if(o.equals(sbi.getService())) {
                            elem.setServiceBeanConfig(sbi.getServiceBeanConfig());
                            Uuid uuid = sbi.getServiceBeanInstantiatorID();
                            for(ServiceBeanInstantiator s : monitor.getServiceBeanInstantiators()) {
                                if(uuid.equals(s.getInstantiatorUuid())) {
                                    c = (Cybernode)s;
                                    break;
                                }
                            }
                        }
View Full Code Here

TOP

Related Classes of org.rioproject.servicecore.Service

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.