Examples of Throttle


Examples of org.apache.cassandra.utils.Throttle

    public FileStreamTask(StreamHeader header, InetAddress to)
    {
        this.header = header;
        this.to = to;
        this.throttle = new Throttle(toString(), new Throttle.ThroughputFunction()
        {
            /** @return Instantaneous throughput target in bytes per millisecond. */
            public int targetThroughput()
            {
                if (DatabaseDescriptor.getStreamThroughputOutboundMegabitsPerSec() < 1)
View Full Code Here

Examples of org.fusesource.ide.camel.model.generated.Throttle

        imageProvider.addIconsForClass(new SetProperty());
        imageProvider.addIconsForClass(new Sort());
        imageProvider.addIconsForClass(new Split());
        imageProvider.addIconsForClass(new Stop());
        imageProvider.addIconsForClass(new Threads());
        imageProvider.addIconsForClass(new Throttle());
        imageProvider.addIconsForClass(new ThrowException());
        imageProvider.addIconsForClass(new Transacted());
        imageProvider.addIconsForClass(new Transform());
        imageProvider.addIconsForClass(new Try());
        imageProvider.addIconsForClass(new Unmarshal());
View Full Code Here

Examples of org.objectstyle.wolips.baseforplugins.util.Throttle

  private ComponentEditorInteraction _editorInteraction;

  private Throttle _wodOutlineUpdateThrottle;

  public WodEditor() {
    _wodOutlineUpdateThrottle = new Throttle("WodOutline", 1000, new WodOutlineUpdater());
    _cursorPositionSupport = new CursorPositionSupport(this);
    setSourceViewerConfiguration(new WodSourceViewerConfiguration(this));
  }
View Full Code Here

Examples of org.objectstyle.wolips.baseforplugins.util.Throttle

  public SelectionThrottle(String name, IThrottledSelectionHandler selectionHandler) {
    _name = name;
    _selectionHandler = selectionHandler;
    _addedObjects = new LinkedList();
    _removedObjects = new LinkedList();
    _throttle = new Throttle(_name, 150, this);
  }
View Full Code Here

Examples of org.wso2.throttle.Throttle

     */

    public Throttle loadThrottle(MessageContext messageContext,
                                 int throttleType) throws ThrottleException {

        Throttle throttle = null;
        ConfigurationContext configContext = messageContext.getConfigurationContext();
        //the Parameter which hold throttle ipbase object
        // to get throttles map from the configuration context

        Map throttles = (Map) configContext.getPropertyNonReplicable(ThrottleConstants.THROTTLES_MAP);
View Full Code Here

Examples of org.wso2.throttle.Throttle

    }

    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
        //Load throttle
        try {
            Throttle throttle = loadThrottle(msgContext, getThrottleType());
            if (throttle != null) {
                process(throttle, msgContext);
            }
        } catch (ThrottleException e) {
            log.error(e.getMessage());
View Full Code Here

Examples of org.wso2.throttle.Throttle

    public static void enguage(AxisDescription axisDescription, ConfigurationContext configctx,
                               Throttle defaultThrottle) throws AxisFault {
        String currentServiceName;
        if (axisDescription instanceof AxisService) {
            Throttle throttle = null;
            AxisService currentService = ((AxisService) axisDescription);
            PolicySubject policySubject = currentService.getPolicySubject();
            if (policySubject != null) {
                try {
                    List policies = new ArrayList(policySubject.getAttachedPolicyComponents());
                    Policy currentPolicy = PolicyUtil.getMergedPolicy(policies, currentService);
                    if (currentPolicy != null) {
                        throttle = ThrottleFactory.createServiceThrottle(currentPolicy);
                        if(throttle == null) {
                            //this is for the scenario when throttle policy is empty rather than
                            // null (eg: removing the throttle policy via policy editor)
                            throttle = defaultThrottle;
                        }
                        //todo - done by isuru, recheck
                    } else {
                        AxisConfiguration axisConfig = configctx.getAxisConfiguration();
                        AxisModule throttleModule = axisConfig.getModule(
                                ThrottleConstants.THROTTLE_MODULE_NAME);
                        policySubject = throttleModule.getPolicySubject();
                        if (policySubject != null) {
                            currentPolicy = ThrottleEnguageUtils.getThrottlePolicy(
                                    policySubject.getAttachedPolicyComponents());
                            if (currentPolicy != null) {
                                throttle = ThrottleFactory.createModuleThrottle(currentPolicy);
                            }
                        }
                        //todo - done by isuru
                    }
                } catch (ThrottleException e) {

                    log.error("Error was occurred when engaging throttle module for" +
                              " the service :" +
                              currentService.getName() + e.getMessage());
                    log.info("Throttling will occur using default module policy");
                    throttle = defaultThrottle;
                }
                if (throttle != null) {
                    Map throttles =
                            (Map) configctx.getPropertyNonReplicable(
                                    ThrottleConstants.THROTTLES_MAP);
                    if (throttles == null) {
                        throttles = new HashMap();
                        configctx.setNonReplicableProperty(
                                ThrottleConstants.THROTTLES_MAP, throttles);
                    }
                    String serviceName = currentService.getName();
                    throttle.setId(serviceName);
                    throttles.put(serviceName, throttle);
                    ConcurrentAccessController cac = throttle.getConcurrentAccessController();
                    if (cac != null) {
                        String cacKey = ThrottleConstants.THROTTLE_PROPERTY_PREFIX
                                        + serviceName + ThrottleConstants.CAC_SUFFIX;
                        configctx.setProperty(cacKey, cac);
                    }
                }
            }
        } else if (axisDescription instanceof AxisOperation) {

            Throttle throttle = null;
            AxisOperation currentOperation = ((AxisOperation) axisDescription);
            AxisService axisService = (AxisService) currentOperation.getParent();
            if (axisService != null) {
                currentServiceName = axisService.getName();
                PolicySubject policySubject = currentOperation.getPolicySubject();
                if (policySubject != null) {
                    try {
                        List policies = new ArrayList(policySubject.getAttachedPolicyComponents());
                        Policy currentPolicy = PolicyUtil.getMergedPolicy(policies,
                                                                          currentOperation);
                        if (currentPolicy != null) {
                            throttle = ThrottleFactory.createOperationThrottle(currentPolicy);
                        }
                    } catch (ThrottleException e) {
                        log.error("Error was occurred when engaging throttle module " +
                                  "for operation : " +
                                  currentOperation.getName() + " in the service :" +
                                  currentServiceName + e.getMessage());
                        log.info("Throttling will occur using default module policy");
                    }

                    // if current throttle is null, use the default throttle
                    if (throttle == null) {
                        throttle = defaultThrottle;
                    }

                    Map throttles = (Map) configctx
                            .getPropertyNonReplicable(ThrottleConstants.THROTTLES_MAP);
                    if (throttles == null) {
                        throttles = new HashMap();
                        configctx.setNonReplicableProperty(ThrottleConstants.THROTTLES_MAP
                                , throttles);
                    }
                    QName opQName = currentOperation.getName();
                    if (opQName != null) {
                        String opName = opQName.getLocalPart();
                        String key = currentServiceName + opName;
                        throttle.setId(key);
                        throttles.put(key, throttle);
                        ConcurrentAccessController cac =
                                throttle.getConcurrentAccessController();
                        if (cac != null) {
                            String cacKey = ThrottleConstants.THROTTLE_PROPERTY_PREFIX
                                    + key + ThrottleConstants.CAC_SUFFIX;
                            configctx.setProperty(cacKey, cac);
                        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.