コード例 #1
0
  /**
   * loadCache is called automatically on startup of the cache factory, as a result of implementing
   * the CacheLoader interface. This should be used to load any data that needs loading, and to set
   * up variables.
   *
   * @param ResourceName The name of the resource to load for
   * @param CacheName The name of the cache to load for
   * @throws InitializationException
   */
  @Override
  public void loadCache(String ResourceName, String CacheName) throws InitializationException {
    String tmpHelper;

    // load the value of the invalidate duplicates setting
    tmpHelper =
        PropertyUtils.getPropertyUtils()
            .getDataCachePropertyValueDef(
                ResourceName, CacheName, SERVICE_INVALIDATE_DUPLICATE, "False");

    // process it
    processControlEvent(SERVICE_INVALIDATE_DUPLICATE, true, tmpHelper);

    // load the value of the invalidate duplicates setting
    tmpHelper =
        PropertyUtils.getPropertyUtils()
            .getDataCachePropertyValueDef(
                ResourceName, CacheName, SERVICE_DATE_FORMAT, internalDateFormat);

    // Initialise the conversion object
    conv.setInputDateFormat(tmpHelper);

    // Do the parent processing
    super.loadCache(ResourceName, CacheName);
  }
コード例 #2
0
  /**
   * loadCache is called automatically on startup of the cache factory, as a result of implementing
   * the CacheLoader interface. This should be used to load any data that needs loading, and to set
   * up variables.
   *
   * @throws InitializationException
   */
  @Override
  public void loadCache(String ResourceName, String CacheName) throws InitializationException {
    // Variable definitions
    String tmpValue;

    // Get the number of key fields (the rest are treated as results)
    tmpValue =
        PropertyUtils.getPropertyUtils()
            .getDataCachePropertyValueDef(ResourceName, CacheName, "KeyFields", "None");
    if (tmpValue.equals("None")) {
      // We will use calculate the default assuming 1 result field
      KeyFormFactor = 0;
    } else {
      try {
        KeyFormFactor = Integer.parseInt(tmpValue);
      } catch (NumberFormatException nfe) {
        message =
            "KeyFields entry for cache <"
                + getSymbolicName()
                + "> not numeric. Found value <"
                + tmpValue
                + ">";
        OpenRate.getOpenRateFrameworkLog().error(message);
        throw new InitializationException(message, getSymbolicName());
      }
    }

    // Now perform the base initialisation
    super.loadCache(ResourceName, CacheName);
  }
コード例 #3
0
 @Override
 protected boolean getDataStatements(String ResourceName, String CacheName)
     throws InitializationException {
   CustomerDataSelectQuery =
       PropertyUtils.getPropertyUtils()
           .getDataCachePropertyValueDef(
               ResourceName, CacheName, "CustomerSelectStatement", "None");
   if (CustomerDataSelectQuery.equals("None")) {
     return false;
   } else {
     return true;
   }
 }