Package java.lang.ref

Examples of java.lang.ref.Reference


    public SerializedBeanFactoryReference(String id) {
      this.id = id;
    }

    private Object readResolve() {
      Reference ref = serializableFactories.get(this.id);
      if (ref == null) {
        throw new IllegalStateException(
            "Cannot deserialize BeanFactory with id " + this.id + ": no factory registered for this id");
      }
      Object result = ref.get();
      if (result == null) {
        throw new IllegalStateException(
            "Cannot deserialize BeanFactory with id " + this.id + ": factory has been garbage-collected");
      }
      return result;
View Full Code Here


   */
  static CachedIntrospectionResults forClass(Class beanClass) throws BeansException {
    CachedIntrospectionResults results;
    Object value = classCache.get(beanClass);
    if (value instanceof Reference) {
      Reference ref = (Reference) value;
      results = (CachedIntrospectionResults) ref.get();
    }
    else {
      results = (CachedIntrospectionResults) value;
    }
    if (results == null) {
View Full Code Here

    public SerializedBeanFactoryReference(String id) {
      this.id = id;
    }

    private Object readResolve() {
      Reference ref = serializableFactories.get(this.id);
      if (ref == null) {
        throw new IllegalStateException(
            "Cannot deserialize BeanFactory with id " + this.id + ": no factory registered for this id");
      }
      Object result = ref.get();
      if (result == null) {
        throw new IllegalStateException(
            "Cannot deserialize BeanFactory with id " + this.id + ": factory has been garbage-collected");
      }
      return result;
View Full Code Here

         }
      }

      private void clearCollected()
      {
         Reference ref;
         while ((ref = queue.poll()) != null)
         {
            observer.remove(ref);
         }
View Full Code Here

        }
        if (iFixedOffsetCache == null) {
            iFixedOffsetCache = new HashMap();
        }
        DateTimeZone zone;
        Reference ref = (Reference) iFixedOffsetCache.get(id);
        if (ref != null) {
            zone = (DateTimeZone) ref.get();
            if (zone != null) {
                return zone;
            }
        }
        zone = new FixedDateTimeZone(id, null, offset, offset);
View Full Code Here

       */
      IPath resolved = null;
      Map mapForBaseResource = null;
      mapForBaseResource = (Map) fResolvedMap.get(basePath);
      if (mapForBaseResource != null) {
        Reference resolvedReference = (Reference) mapForBaseResource.get(reference);
        if (resolvedReference != null)
          resolved = (IPath) resolvedReference.get();
      }
      else {
        mapForBaseResource = new HashMap();
        fResolvedMap.put(basePath, mapForBaseResource);
      }
View Full Code Here

    IFile webxmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(webxmlPath);
    if (!webxmlFile.isAccessible())
      return null;

    Reference descriptorHolder = (Reference) fDeploymentDescriptors.get(webxmlPath);
    DeploymentDescriptor descriptor = null;

    if (descriptorHolder == null || ((descriptor = (DeploymentDescriptor) descriptorHolder.get()) == null) || (descriptor.modificationStamp == IResource.NULL_STAMP) || (descriptor.modificationStamp != webxmlFile.getModificationStamp())) {
      descriptor = fetchDescriptor(webxmlPath, new NullProgressMonitor());
    }
    return descriptor;
  }
View Full Code Here

    if (grammerURI == null)
      return null;
   
    CMDocument cmDocument = null;
    if (CACHE_FIXED_DOCUMENTS) {
      Reference ref = (Reference) fFixedCMDocuments.get(publicId);
      if (ref != null) {
        cmDocument = (CMDocument) ref.get();
        if (cmDocument != null) {
          return cmDocument;
        }
      }
    }
View Full Code Here

     * care must be taken if, for instance, you want stale
     * mappings to be removed on a periodic basis by some
     * background thread.
     */
    protected void purge() {
        Reference ref = queue.poll();
        while (ref != null) {
            purge(ref);
            ref = queue.poll();
        }
    }
View Full Code Here

   */
  static CachedIntrospectionResults forClass(Class beanClass) throws BeansException {
    CachedIntrospectionResults results;
    Object value = classCache.get(beanClass);
    if (value instanceof Reference) {
      Reference ref = (Reference) value;
      results = (CachedIntrospectionResults) ref.get();
    }
    else {
      results = (CachedIntrospectionResults) value;
    }
    if (results == null) {
View Full Code Here

TOP

Related Classes of java.lang.ref.Reference

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.