Package com.google.gwt.core.ext

Examples of com.google.gwt.core.ext.CachedGeneratorResult


    return false;
  }
 
  protected boolean findCacheableImplementationAndMarkForReuseIfAvailable(JClassType baseIntf)
  {
    CachedGeneratorResult lastResult = context.getCachedGeneratorResult();
    if (lastResult == null || !context.isGeneratorResultCachingEnabled())
    {
      return false;
    }

    String proxyName = getProxyQualifiedName();

    // check that it is available for reuse
    if (!lastResult.isTypeCached(proxyName))
    {
      return false;
    }

    try
    {
      long lastModified = 0L;
      if (baseIntf instanceof JRealClassType)
      {
        lastModified = ((JRealClassType)baseIntf).getLastModifiedTime();
      }

      if (lastModified != 0L && lastModified < lastResult.getTimeGenerated())
      {
        return context.tryReuseTypeFromCache(proxyName);
      }
    }
    catch (RuntimeException ex)
View Full Code Here


   * Check cached dependent resources.
   */
  private boolean checkCachedDependentResources(TreeLogger logger,
      GeneratorContext genContext) {

    CachedGeneratorResult lastRebindResult = genContext.getCachedGeneratorResult();

    if (lastRebindResult == null
        || !genContext.isGeneratorResultCachingEnabled()) {
      return false;
    }
    long lastTimeGenerated = lastRebindResult.getTimeGenerated();

    // check that resource URL's haven't moved, and haven't been modified
    @SuppressWarnings("unchecked")
    Map<String, URL> cachedResolvedResources = (Map<String, URL>)
      lastRebindResult.getClientData(CACHED_RESOURCE_INFORMATION);

    if (cachedResolvedResources == null) {
      return false;
    }

View Full Code Here

  /**
   * Check cached properties.
   */
  private boolean checkCachedPropertyInformation(TreeLogger logger, GeneratorContext genContext) {

    CachedGeneratorResult lastRebindResult = genContext.getCachedGeneratorResult();

    if (lastRebindResult == null
        || !genContext.isGeneratorResultCachingEnabled()) {
      return false;
    }

    /*
     * Do a check of deferred-binding and configuration properties, comparing
     * the cached values saved previously with the current properties.
     */
    CachedPropertyInformation cpi = (CachedPropertyInformation)
        lastRebindResult.getClientData(CACHED_PROPERTY_INFORMATION);

    return cpi != null && cpi.checkPropertiesWithPropertyOracle(logger,
        genContext.getPropertyOracle());
  }
View Full Code Here

  /**
   * Check cached source types.
   */
  private boolean checkCachedSourceTypes(TreeLogger logger, GeneratorContext genContext) {

    CachedGeneratorResult lastRebindResult = genContext.getCachedGeneratorResult();

    if (lastRebindResult == null
        || !genContext.isGeneratorResultCachingEnabled()) {
      return false;
    }

    /*
     * Do a check over the cached list of types that were previously flagged as
     * required.  Check that none of these types has undergone a version change
     * since the previous cached result was generated.
     */
    @SuppressWarnings("unchecked")
    Map<String, Long> cachedTypeLastModifiedTimes = (Map<String, Long>)
      lastRebindResult.getClientData(CACHED_TYPE_INFORMATION);

    return cachedTypeLastModifiedTimes != null
      && checkCachedTypeLastModifiedTimes(logger, genContext, cachedTypeLastModifiedTimes);
  }
View Full Code Here

   * return false.
   */
  private boolean findReusableCachedFieldSerializerIfAvailable(TreeLogger logger,
      GeneratorContext ctx, JType type, JType customFieldSerializer) {

    CachedGeneratorResult lastResult = ctx.getCachedGeneratorResult();
    if (lastResult == null || !ctx.isGeneratorResultCachingEnabled()) {
      return false;
    }

    String fieldSerializerName = SerializationUtils.getStandardSerializerName((JClassType) type);

    if (type instanceof JClassType) {
      // check that it is available for reuse
      if (!lastResult.isTypeCached(fieldSerializerName)) {
        if (logger.isLoggable(TreeLogger.TRACE)) {
          if (ctx.getTypeOracle().findType(fieldSerializerName) == null) {
            logger.log(TreeLogger.TRACE, "No cached field serializer available for "
                + type.getQualifiedSourceName());
          }
        }
        return false;
      }
    } else {
      return false;
    }

    @SuppressWarnings("unchecked")
    CachedRpcTypeInformation cachedTypeInfo =
        (CachedRpcTypeInformation) lastResult.getClientData(ProxyCreator.CACHED_TYPE_INFO_KEY);

    assert cachedTypeInfo != null;
    boolean foundMatch = false;
    if (cachedTypeInfo.checkLastModifiedTime(type)
        && ((customFieldSerializer != null && cachedTypeInfo
View Full Code Here

  }

  private boolean checkCachedGeneratorResultValid(TreeLogger logger, GeneratorContext ctx,
      SerializableTypeOracle typesSentFromBrowser, SerializableTypeOracle typesSentToBrowser) {

    CachedGeneratorResult lastResult = ctx.getCachedGeneratorResult();
    if (lastResult == null || !ctx.isGeneratorResultCachingEnabled()) {
      return false;
    }

    CachedPropertyInformation cpi =
        (CachedPropertyInformation) lastResult.getClientData(CACHED_PROPERTY_INFO_KEY);
    if (cpi == null) {
      return false;
    }

    CachedRpcTypeInformation cti =
        (CachedRpcTypeInformation) lastResult.getClientData(CACHED_TYPE_INFO_KEY);
    if (cti == null) {
      return false;
    }

    if (!cti.checkTypeInformation(logger, ctx.getTypeOracle(), typesSentFromBrowser,
View Full Code Here

        if (rule == null) {
          return typeName;
        }

        CachedGeneratorResult cachedResult = rebindCacheGet(rule, typeName);
        if (cachedResult != null) {
          genCtx.setCachedGeneratorResult(cachedResult);
        }

        // realize the rule (call a generator, or do type replacement, etc.)
View Full Code Here

  }

  private boolean checkCachedGeneratorResultValid(TreeLogger logger, GeneratorContext ctx,
      SerializableTypeOracle typesSentFromBrowser, SerializableTypeOracle typesSentToBrowser) {

    CachedGeneratorResult lastResult = ctx.getCachedGeneratorResult();
    if (lastResult == null || !ctx.isGeneratorResultCachingEnabled()) {
      return false;
    }

    CachedPropertyInformation cpi =
        (CachedPropertyInformation) lastResult.getClientData(CACHED_PROPERTY_INFO_KEY);
    if (cpi == null) {
      return false;
    }

    CachedRpcTypeInformation cti =
        (CachedRpcTypeInformation) lastResult.getClientData(CACHED_TYPE_INFO_KEY);
    if (cti == null) {
      return false;
    }

    if (!cti.checkTypeInformation(logger, ctx.getTypeOracle(), typesSentFromBrowser,
View Full Code Here

TOP

Related Classes of com.google.gwt.core.ext.CachedGeneratorResult

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.