Package org.rioproject.impl.container

Examples of org.rioproject.impl.container.ServiceBeanDelegate


         * @throws Exception if the fault detection handler cannot be attached
         */
        protected void setFaultDetectionHandler(final Object service, final ServiceID serviceID) throws Exception {
            FaultDetectionHandler<ServiceID> fdh = null;
            if(container!=null) {
                ServiceBeanDelegate delegate =
                    container.getServiceBeanDelegate(UuidFactory.create(serviceID.getMostSignificantBits(),
                                                                        serviceID.getLeastSignificantBits()));
                if(delegate!=null) {
                    logger.debug("Create FDH to monitor colocated service [{}]", association.getName());
                    fdh = new ColocatedListener();
View Full Code Here


        return (backend.getComputeResource().getComputeResourceUtilization());
    }

    public ComputeResourceUtilization getComputeResourceUtilization(Uuid serviceUuid) {
        ComputeResourceUtilization cru = null;
        ServiceBeanDelegate delegate =
            backend.getServiceBeanContainer().getServiceBeanDelegate(serviceUuid);
        if(delegate!=null)
            cru = delegate.getComputeResourceUtilization();
        return cru; 
    }
View Full Code Here

    /**
     * @see org.rioproject.impl.container.ServiceBeanContainer#started(Object)
     */
    public void started(Object identifier) {
        ServiceBeanDelegate delegate;
        synchronized(controllerMap) {
            delegate = controllerMap.get(identifier);
        }
        if(delegate == null) {
            return;
        }
        ServiceRecord record = delegate.getServiceRecord();
        if(record==null) {
            logger.warn("ServiceRecord for [{}] is null, no way to notify container of instantiation",
                           delegate.getServiceElement().getName());
            return;
        }
        notifyOnInstantiation(delegate.getServiceRecord());
    }
View Full Code Here

    /**
     * @see org.rioproject.impl.container.ServiceBeanContainer#discarded(Object)
     */
    public void discarded(Object identifier) {
        ServiceBeanDelegate delegate;
        synchronized(controllerMap) {
            delegate = controllerMap.get(identifier);
        }
        if(delegate == null)
            return;
        notifyOnDiscard(delegate.getServiceRecord());
    }
View Full Code Here

    public synchronized void removeListener(ServiceBeanContainerListener l) {
        listeners.remove(l);
    }

    public ServiceBeanDelegate getServiceBeanDelegate(Uuid serviceUuid) {
        ServiceBeanDelegate delegate = null;
        ServiceBeanDelegate[] delegates = getDelegates();
        for(ServiceBeanDelegate d : delegates) {
            if(d.getServiceBeanInstance()!=null &&
               d.getServiceBeanInstance().getServiceBeanID().equals(serviceUuid)) {
                delegate = d;
View Full Code Here

    public List<DeployedService> getDeployedServices() {
        List<DeployedService> list = new ArrayList<DeployedService>();

        for (ServiceRecord record :
            impl.getServiceRecords(ServiceRecord.ACTIVE_SERVICE_RECORD)) {
            ServiceBeanDelegate delegate = impl.getServiceBeanContainer().getServiceBeanDelegate(record.getServiceID());

            if(delegate!=null) {
                DeployedService deployed = new DeployedService(delegate.getServiceElement(),
                                                               delegate.getServiceBeanInstance(),
                                                               delegate.getComputeResourceUtilization());
                list.add(deployed);
            }

        }
        return Collections.unmodifiableList(list);
View Full Code Here

            this.container = container;
            container.addListener(this);
        }

        private ServiceBeanInstance getServiceBeanInstance(final ServiceRecord r) {
            ServiceBeanDelegate delegate = container.getServiceBeanDelegate(r.getServiceID());
            return delegate.getServiceBeanInstance();
        }
View Full Code Here

TOP

Related Classes of org.rioproject.impl.container.ServiceBeanDelegate

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.