Examples of PropertyKey


Examples of org.apache.helix.PropertyKey

        callback._message.getResultMap()
            .get(DefaultSchedulerMessageHandlerFactory.SCHEDULER_MSG_ID);

    for (int j = 0; j < 10; j++) {
      Thread.sleep(200);
      PropertyKey controllerTaskStatus =
          keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(), msgId);
      ZNRecord statusUpdate = helixDataAccessor.getProperty(controllerTaskStatus).getRecord();
      if (statusUpdate.getMapFields().containsKey("SentMessageCount")) {
        Assert.assertEquals(
            statusUpdate.getMapFields().get("SentMessageCount").get("MessageCount"), ""
                + (_PARTITIONS * 3));
        break;
      }
    }

    for (int i = 0; i < _PARTITIONS * 3 / 5; i++) {
      for (int j = 0; j < 10; j++) {
        Thread.sleep(300);
        if (factory._messageCount == 5 * (i + 1))
          break;
      }
      Thread.sleep(300);
      Assert.assertEquals(factory._messageCount, 5 * (i + 1));
      factory.signal();
      // System.err.println(i);
    }

    for (int j = 0; j < 10; j++) {
      Thread.sleep(200);
      PropertyKey controllerTaskStatus =
          keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(), msgId);
      ZNRecord statusUpdate = helixDataAccessor.getProperty(controllerTaskStatus).getRecord();
      if (statusUpdate.getMapFields().containsKey("Summary")) {
        break;
      }
    }

    Assert.assertEquals(_PARTITIONS, factory._results.size());
    PropertyKey controllerTaskStatus =
        keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(), msgId);
    ZNRecord statusUpdate = helixDataAccessor.getProperty(controllerTaskStatus).getRecord();
    Assert.assertTrue(statusUpdate.getMapField("SentMessageCount").get("MessageCount")
        .equals("" + (_PARTITIONS * 3)));
    int messageResultCount = 0;
View Full Code Here

Examples of org.apache.jetspeed.prefs.om.PropertyKey

        {
            boolean foundKey = false;
            String currentPropertyKeyName = (String) i.next();
            for (Iterator j = propertyKeys.iterator(); j.hasNext();)
            {
                PropertyKey existingPpk = (PropertyKey) j.next();
                if (propertyKeysMap.containsKey(existingPpk.getPropertyKeyName()))
                {
                    if (logger.isDebugEnabled())
                        logger.debug("Existing Property: " + (String) propertyKeysMap.get(currentPropertyKeyName));
                    foundKey = true;
                    newPropertyKeys.add(existingPpk);
                    break;
                }
            }
            if (!foundKey)
            {
                if (logger.isDebugEnabled())
                    logger.debug("New Property: " + currentPropertyKeyName);
                PropertyKey ppk = new PropertyKeyImpl(currentPropertyKeyName, ((Integer) propertyKeysMap
                        .get(currentPropertyKeyName)).intValue());
                newPropertyKeys.add(ppk);
            }
        }
View Full Code Here

Examples of org.apache.myfaces.trinidad.bean.PropertyKey

    return uixBean;
  }

  protected PropertyKey getPropertyKey(String name)
  {
    PropertyKey key = getBeanType().findKey(name);
    if (key == null)
      key = PropertyKey.createPropertyKey(name);

    return key;
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.bean.PropertyKey

  public ValueExpression getValueExpression(String name)
  {
    if (name == null)
      throw new NullPointerException();

    PropertyKey key = getPropertyKey(name);

    // Support standard RI behavior where getValueBinding()
    // doesn't complain about being asked for a ValueBinding -
    // but continue supporting strict behavior at FacesBean layer.
    if (!key.getSupportsBinding())
      return null;

    return getFacesBean().getValueExpression(key);
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.bean.PropertyKey

          FacesContext.getCurrentInstance().getELContext();
      getAttributes().put(name, expression.getValue(context));
    }
    else
    {
      PropertyKey key = getPropertyKey(name);
      getFacesBean().setValueExpression(key, expression);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.bean.PropertyKey

  public ValueBinding getValueBinding(String name)
  {
    if (name == null)
      throw new NullPointerException();

    PropertyKey key = getPropertyKey(name);

    // Support standard RI behavior where getValueBinding()
    // doesn't complain about being asked for a ValueBinding -
    // but continue supporting strict behavior at FacesBean layer.
    if (!key.getSupportsBinding())
      return null;

    return getFacesBean().getValueBinding(key);
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.bean.PropertyKey

  public void setValueBinding(String name, ValueBinding binding)
  {
    if (name == null)
      throw new NullPointerException();

    PropertyKey key = getPropertyKey(name);
    getFacesBean().setValueBinding(key, binding);
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.bean.PropertyKey

  /**
   * Restores a persisted PropertyKey.
   */
  static public PropertyKey restoreKey(FacesBean.Type type, Object value)
  {
    PropertyKey key;
    if (value instanceof Number)
    {
      key = type.findKey(((Number) value).intValue());
      if (key == null)
        throw new IllegalStateException(_LOG.getMessage(
View Full Code Here

Examples of org.apache.myfaces.trinidad.bean.PropertyKey

    Object[] values = new Object[2 * size];
    int i = 0;
    for(Map.Entry<PropertyKey, Object> entry : map.entrySet())
    {
      PropertyKey key = entry.getKey();
      if (key.isTransient())
      {
        // TRINIDAD-1956: due to the view root caching functionality, the transient properties
        // may be retained too long. By removing the value here we can ensure that the next
        // request will not have the transient values.
        entry.setValue(null);
        continue;
      }

      Object value = entry.getValue();

      values[i] = saveKey(key);
      if (_LOG.isFinest())
      {
        _LOG.finest("SAVE {" + key + "=" + value + "}");
      }

      Object saveValue;

      if (useStateHolder)
        saveValue = saveStateHolder(context, value);
      else
        saveValue = key.saveValue(context, value);

      // aggressively check the serializability of the value
      if (_checkPropertyStateSerialization())
      {
        try
View Full Code Here

Examples of org.apache.myfaces.trinidad.bean.PropertyKey

      Object savedKey = values[i * 2];
      if (savedKey == null)
        continue;

      Object savedValue = values[i * 2 + 1];
      PropertyKey key = restoreKey(type, savedKey);
      Object value;

      if (useStateHolder)
        value = restoreStateHolder(context, savedValue);
      else
        value = key.restoreValue(context, savedValue);

      if (_LOG.isFinest())
      {
        _LOG.finest("RESTORE {" + key + "=" + value + "}");
      }
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.