Examples of Updater


Examples of org.apache.commons.betwixt.expression.Updater

          log.trace(
            "Attr LocalName:" + attributeDescriptor.getLocalName());
          log.trace(value);
        }

        Updater updater = attributeDescriptor.getUpdater();
        log.trace(updater);
        if (updater != null && value != null) {
          updater.update(this, value);
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Updater

        // TODO: think about whether this is right
        //       it makes some sense to look back up the
        //       stack until a non-empty updater is found.
        //       actions who need to put a stock to this
        //       behaviour can always use an ignoring implementation.
        Updater result = null;
        if (!updaterStack.empty()) {
            result = (Updater) updaterStack.peek();
            if ( result == null && updaterStack.size() >1 ) {
                result = (Updater) updaterStack.peek(1);
            }
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Updater

   

    public void body(String text, ReadContext context) throws Exception {
        // add dyna-bean support!
        // probably refactoring needed
        Updater updater = context.getCurrentUpdater();
        if (updater != null)
        {
            updater.update(context, text);
        } else {
            if (context.getLog().isDebugEnabled())
            {
                context.getLog().debug("No updater for simple type '" + context.getCurrentElement() + "'");
            }
View Full Code Here

Examples of org.apache.hadoop.metrics.Updater

        if (isMonitoring) {
            // Run all the registered updates
            // for (Updater updater : updaters) {
            Iterator it = updaters.iterator();
            while (it.hasNext()) {
                Updater updater = (Updater) it.next();
                try {
                    updater.doUpdates(this);
                }
                catch (Throwable throwable) {
                    throwable.printStackTrace();
                }
            }
View Full Code Here

Examples of org.apache.hadoop.metrics.Updater

        if (isMonitoring) {
            // Run all the registered updates
            // for (Updater updater : updaters) {
            Iterator it = updaters.iterator();
            while (it.hasNext()) {
                Updater updater = (Updater) it.next();
                try {
                    updater.doUpdates(this);
                }
                catch (Throwable throwable) {
                    throwable.printStackTrace();
                }
            }
View Full Code Here

Examples of org.chromium.debug.ui.DialogUtils.Updater

  WizardLogicBuilder(PushChangesWizard.PageSet pageSet, LogicBasedWizard wizardImpl) {
    this.pageSet = pageSet;
    this.wizardImpl = wizardImpl;

    updater = new Updater();
  }
View Full Code Here

Examples of org.chromium.debug.ui.DialogUtils.Updater

   * Builds an updater-based dialog logic. This is more a function-style programming inside
   * (to better deal with various states and transitions of dialog).
   */
  static Handle buildDialogLogic(final DialogImpl.Elements elements,
      final DialogImpl.DialogPreferencesStore dialogPreferencesStore, final Value uiValue) {
    final Updater updater = new Updater();
    Scope rootScope = updater.rootScope();

    // A global dialog warning collection (those warnings that are not tied to the primary
    // result value).
    List<ValueSource<String>> warningSources = new ArrayList<ValueSource<String>>(2);

    // 'Property expression' editor raw value.
    final ValueSource<String> propertyExpressionEditorValue = new ValueSource<String>() {
      private final Text textElement = elements.getExpressionText();
      {
        String text = dialogPreferencesStore.getExpressionText();
        textElement.setText(text);
        // Select all expression but a first dot.
        int selectionStart = text.startsWith(".") ? 1 : 0; //$NON-NLS-1$
        textElement.setSelection(selectionStart, text.length());
        addModifyListener(textElement, this, updater);
      }
      public String getValue() {
        return textElement.getText();
      }
    };
    updater.addSource(rootScope, propertyExpressionEditorValue);

    // A preview context value. It is constant but optional (so it's passed via updater).
    final ValueSource<Optional<DialogLogic.PreviewContext>> evaluatorValue =
        createConstant(PreviewContext.build(uiValue), updater);

    // Property expression parsed as Expression. Parse errors are kept in Optional.
    final ValueProcessor<Optional<DialogLogic.Expression>> parsedPropertyExpressionValue =
      createProcessor(new Gettable<Optional<DialogLogic.Expression>>() {
        @Override
        public Optional<DialogLogic.Expression> getValue() {
          return parseExpression(propertyExpressionEditorValue.getValue());
        }
      });
    updater.addConsumer(rootScope, parsedPropertyExpressionValue);
    updater.addSource(rootScope, parsedPropertyExpressionValue);
    updater.addDependency(parsedPropertyExpressionValue, propertyExpressionEditorValue);


    // 'Show preview' check box value.
    final ValueSource<Boolean> previewCheckBoxValue = new ValueSource<Boolean>() {
      private final Button checkBox = elements.getPreviewCheckBox();
      {
        checkBox.setSelection(dialogPreferencesStore.getPreviewCheck());
        addModifyListener(checkBox, this, updater);
      }
      @Override
      public Boolean getValue() {
        return checkBox.getSelection();
      }
    };

    // A conditional block that holds optional preview section.
    Switcher<Boolean> checkerSwitch = rootScope.addSwitch(previewCheckBoxValue);

    PreviewSwitchOutput switchBlockOutput = fillShowPreviewSwitch(checkerSwitch, updater,
        rootScope, elements, evaluatorValue, parsedPropertyExpressionValue);

    // Preview block may emit warning.
    warningSources.add(switchBlockOutput.warningSource());

    // 'Add watch expression' check box value.
    final ValueSource<Boolean> addWatchExpressionValue = new ValueSource<Boolean>() {
      private final Button checkBox = elements.getAddWatchCheckBox();
      {
        checkBox.setSelection(dialogPreferencesStore.getAddWatchExpression());
        addModifyListener(checkBox, this, updater);
      }
      @Override
      public Boolean getValue() {
        return checkBox.getSelection();
      }
    };
    updater.addSource(rootScope, addWatchExpressionValue);

    // An OK button implementation that do set property in remote VM.
    final ValueProcessor<Optional<? extends Runnable>> okRunnable = createProcessor(handleErrors(
        new NormalExpression<Runnable>() {
          @Calculate
          public Runnable calculate(DialogLogic.PreviewContext previewContext,
              DialogLogic.Expression expression) {
            return new OkRunnable(elements.getParentShell(), expression, previewContext,
                addWatchExpressionValue.getValue());
          }

          @DependencyGetter
          public ValueSource<Optional<DialogLogic.PreviewContext>> previewContextSource() {
            return evaluatorValue;
          }

          @DependencyGetter
          public ValueSource<Optional<DialogLogic.Expression>> parsedPropertyExpressionSource() {
            return parsedPropertyExpressionValue;
          }
        })
    );
    updater.addSource(rootScope, okRunnable);
    updater.addConsumer(rootScope, okRunnable);
    updater.addDependency(okRunnable, evaluatorValue);
    updater.addDependency(okRunnable, parsedPropertyExpressionValue);
    updater.addDependency(okRunnable, addWatchExpressionValue);

    final OkButtonControl<Runnable> okButtonControl =
        new OkButtonControl<Runnable>(okRunnable, warningSources, elements);
    updater.addConsumer(rootScope, okButtonControl);
    updater.addDependency(okButtonControl, okButtonControl.getDependencies());

    return new Handle() {
      @Override
      public void updateAll() {
        updater.updateAll();
      }
      @Override
      public Runnable getOkRunnable() {
        return okButtonControl.getNormalValue();
      }
View Full Code Here

Examples of org.conserve.tools.Updater

        + ObjectTools.getSystemicName(adapter.getClass())
        + " for connection " + connectionstring);
    // set up a new protection manager
    protectionManager = new ProtectionManager();
    // set up the object responsible for updating objects
    updater = new Updater(adapter);

    arrayEntryWriter = new ArrayEntryWriter(adapter);

    // set up a manager for system tables and table creation
    tableManager = new TableManager(this.isCreateSchema(), connectionPool,
View Full Code Here

Examples of org.fluxtream.core.connectors.annotations.Updater

    private static void extractConnectorMetadata(final BeanDefinition bd) {
        String beanClassName = bd.getBeanClassName();
        String connectorName = getConnectorName(beanClassName);
        Connector connector = new Connector();
        connector.updaterClass = getUpdaterClass(beanClassName);
        Updater updaterAnnotation = connector.updaterClass
                .getAnnotation(Updater.class);
        // set connectors' pretty name
        connector.prettyName = updaterAnnotation.prettyName();
        connector.deviceNickname = updaterAnnotation.deviceNickname().equals(Updater.DEVICE_NICKNAME_NONE)
                                 ? updaterAnnotation.prettyName()==null ? connectorName : updaterAnnotation.prettyName()
                                 : updaterAnnotation.deviceNickname();
        connector.value = updaterAnnotation.value();
        connector.updateStrategyType = updaterAnnotation
                .updateStrategyType();
        connector.hasFacets = updaterAnnotation.hasFacets();
        connector.name = connectorName;
        connector.sharedConnectorFilterClass = updaterAnnotation.sharedConnectorFilter();
        connector.deleteOrder = updaterAnnotation.deleteOrder();
        // set connectors' object types
        Class<? extends AbstractFacet>[] facetTypes = updaterAnnotation
                .objectTypes();
        if (updaterAnnotation.extractor() != AbstractFacetExtractor.class)
            connector.extractorClass = updaterAnnotation.extractor();
        if (facetTypes.length == 1) {
            connector.facetClass = facetTypes[0];
        }
        if (updaterAnnotation.userProfile() != AbstractUserProfile.class)
            connector.userProfileClass = updaterAnnotation
                    .userProfile();
        connector.defaultChannels = updaterAnnotation.defaultChannels();
        List<ObjectType> connectorObjectTypes = new ArrayList<ObjectType>();
        for (Class<? extends AbstractFacet> facetType : facetTypes) {
            final ObjectType objectType = getFacetTypeMetadata(connector, facetTypes, facetType);
            connectorObjectTypes.add(objectType);
            ObjectType.addObjectType(objectType.name(), connector, objectType);
        }

        if (connectorObjectTypes.size()>0)
            connector.objectTypes = connectorObjectTypes.toArray(new ObjectType[0]);

        connectors.put(connectorName, connector);
        connectorsByValue.put(connector.value(), connector);
        connectorsByDeviceNickname.put(connector.deviceNickname, connector);
        if (connector.prettyName != null) {
            connectorsByPrettyName.put(connector.prettyName.toLowerCase(), connector);
        }
        connector.bodytrackResponder = updaterAnnotation.bodytrackResponder();

    }
View Full Code Here

Examples of org.jfx4ee.adm4ee.business.updater.Updater

*/
public class AbstractServer implements Server {
   
    public AbstractServer(Domain domain) {
        this.domain = domain;
        this.updater = new Updater(this);
    }
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.