Package org.rioproject.opstring

Examples of org.rioproject.opstring.OperationalStringManager


                return(false);
            }

            if(context.getServiceBeanManager() instanceof DefaultServiceBeanManager) {
                DefaultServiceBeanManager jsbMgr = (DefaultServiceBeanManager)context.getServiceBeanManager();
                OperationalStringManager mgr = jsbMgr.getOperationalStringManager();
                if(mgr!=null &&
                   !(mgr instanceof OpStringManagerProxy.OpStringManager)) {
                    jsbMgr.setOperationalStringManager(opMgr);
                }               
            } else {
View Full Code Here


    /**
     * @see org.rioproject.deploy.ServiceBeanInstantiator#update
     */
    public void update(ServiceElement[] sElements, OperationalStringManager opStringMgr) throws RemoteException {
        OperationalStringManager preparedOpStringMgr =
            (OperationalStringManager)operationalStringManagerPreparer.prepareProxy(opStringMgr);
        logger.trace("Prepared OperationalStringManager proxy: {}", preparedOpStringMgr.toString());
        container.update(sElements, preparedOpStringMgr);
    }
View Full Code Here

            synchronized(inProcess) {
                inProcessCount = inProcess.size() - container.getActivationInProcessCount();
            }
            int containerServiceCount = container.getServiceCounter();
            if((inProcessCount+containerServiceCount) <= serviceLimit) {
                OperationalStringManager opMgr = event.getOperationalStringManager();
                if(!event.getServiceElement().forkService()) {
                    if(loaderLogger.isTraceEnabled())
                        loaderLogger.trace("Get OpStringManagerProxy for {}", ServiceLogUtil.logName(event));
                    try {
                        opMgr = OpStringManagerProxy.getProxy(
View Full Code Here

        throws ServiceBeanInstantiationException {
        logger.info("Instantiating {}, service counter={}", sElem.getName(), container.getServiceCounter());
        if (container.getServiceCounter() > 0)
            throw new ServiceBeanInstantiationException("ServiceBeanExecutor has already instantiated a service");

        OperationalStringManager opMgr = opStringMgr;
        try {
            opMgr = OpStringManagerProxy.getProxy(sElem.getOperationalStringName(),
                                                  opStringMgr,
                                                  context.getDiscoveryManagement());
        } catch (Exception e) {
View Full Code Here

                                                                       final String opStringName)
        throws RemoteException, OperationalStringException {
    if (monitor == null)
      return null;
        DeployAdmin da = (DeployAdmin) ((Administrable)monitor).getAdmin();
        OperationalStringManager mgr = da.getOperationalStringManager(opStringName);
        return(mgr);
    }
View Full Code Here

            cancelDecrementTask();
           
            /* If we have pending increment tasks, trim them up. Make sure however
             * that we are not trimming pending requests that will drop the
             * minServices and/or maintain value below what has been declared */
            OperationalStringManager opMgr = context.getServiceBeanManager().
                                                     getOperationalStringManager();           
            int pendingCount = getPendingRequestCount(opMgr);
            logger.trace("[{}] ScalingPolicyHandler [{}] totalServices={}, pendingCount={}, pendingRequests={}, planned={}",
                         getName(), getID(), totalServices, pendingCount, pendingRequests, getServiceElement().getPlanned());
            if(((totalServices+pendingCount)+pendingRequests) >
               getServiceElement().getPlanned()) {
                try {
                    int numTrimmed = opMgr.trim(getServiceElement(), pendingRequests);
                    logger.trace("[{}] numTrimmed={}", getID(), numTrimmed);
                } catch(NoSuchObjectException e) {
                    logger.warn("Remote manager decomissioned for [{}] ScalingPolicyHandler [{}], force disconnect",
                                getName(), getID());
                    disconnect();
View Full Code Here

        }   
        return(pendingCount);
    }

    protected int getTotalKnownServices() throws Exception {
        OperationalStringManager opMgr = context.getServiceBeanManager().getOperationalStringManager();
        if(opMgr == null)
            throw new Exception("OperationalStringManager is null");
        ServiceBeanInstance[] instances =opMgr.getServiceBeanInstances(getServiceElement());
        return (instances.length);
    }
View Full Code Here

            logger.debug("[{}] ScalingPolicyHandler [{}]: INCREMENT CANCELLED, operating below High Threshold, value [{}] high [{}]",
                         getName(), getID(), lastCalculable.getValue(), lastThresholdValues.getHighThreshold());
            return;
        }
        try {
            OperationalStringManager opMgr = context.getServiceBeanManager().getOperationalStringManager();
            if(opMgr==null) {
                logger.debug("[{}] No OperationalStringManager, increment aborted", getName());
                return;
            }
            ServiceElement elem = getServiceElement();
            ServiceBeanInstance[] instances = opMgr.getServiceBeanInstances(elem);
            int pendingCount = getPendingRequestCount(opMgr);                      
            int realTotal = instances.length+pendingCount;
           
            /* If we have an unbounded maxServices property, always increment.
             * Otherwise check values to determine if incrementing is needed */
 
View Full Code Here

                (lastCalculable.getValue() < lastThresholdValues.getLowThreshold()))) {
            logger.debug("[{}] ScalingPolicyHandler [{}]: DECREMENT CANCELLED, operating above Low Threshold, value [{}] low [{}]",
                         getName(), getID(), lastCalculable.getValue(), lastThresholdValues.getLowThreshold());
            return false;
        }
        OperationalStringManager opMgr = context.getServiceBeanManager().getOperationalStringManager();
        if(opMgr==null) {
            logger.debug("[{}] ScalingPolicyHandler [{}]: unable to process decrement, " +
                         "null OperationalStringManager, abort decrement request",
                         getName(), getID());
            //scheduleDecrement();
            return false;
        }
        boolean reschedule = true;
        try {
            ServiceBeanInstance[] instances = opMgr.getServiceBeanInstances(getServiceElement());
            totalServices = instances.length;
            for (ServiceBeanInstance instance : instances) {
                if (instance.getServiceBeanID().equals(
                    context.getServiceBeanManager().getServiceID())) {
                    reschedule = false;
View Full Code Here

                            for(GraphNode node : nodes) {
                                if(node.getInstance()!=null)
                                    list.add(node.getInstance());
                            }
                            try {
                                OperationalStringManager mgr =
                                    Util.getOperationalStringManager(
                                        node.getProvisionMonitor(),
                                        node.getOpStringName());
                                sElemPanel.showServiceElement(
                                    node.getServiceElement(),
View Full Code Here

TOP

Related Classes of org.rioproject.opstring.OperationalStringManager

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.