// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/ResourceTaskProvidersExtensionPoint.java
// public class ResourceTaskProvidersExtensionPoint {
//   private static final String EXTENSION_POINT_NAME = "resourcetaskproviders";
//   private static final String TAG_TASK = "provider";
//   private static final String ATTR_CLASS = "class";
// 
//   // Initialization On Demand Holder Idiom
//   // http://crazybob.org/2007/01/lazy-loading-singletons.html
//   private static class SingletonHolder {
//     static SimpleExtensionPointManager<IResourceTaskProvider> instance =
//         SimpleExtensionPointManager.newInstance(
//             EXTENSION_POINT_NAME,
//             IResourceTaskProvider.class,
//             TAG_TASK,
//             ATTR_CLASS,
//             null);
//   }
// 
//   private ResourceTaskProvidersExtensionPoint() {
//   }
// 
//   /**
//    * Return the {@link IResourceTaskProvider} supplier, initializing it if required.
//    *
//    * <p>The supplier is memoized, so it will return the same instantiated
//    * objects upon repeated calls.
//    */
//   public static Supplier<List<IResourceTaskProvider>> getInstance() {
//     return Suppliers.memoize(new Supplier<List<IResourceTaskProvider>>() {
//       public List<IResourceTaskProvider> get() {
//         return SingletonHolder.instance.getInstances();
//       }
//     });
//   }
// 
//   /**
//    * Clears the list of task providers.
//    * 
//    * <p><em>This should only be called by {@link MechanicPlugin#stop}.</em>
//    */
//   public static void dispose() {
//     SingletonHolder.instance = null;
//   }
// }


import java.util.List;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import com.google.eclipse.mechanic.internal.ResourceTaskProvidersExtensionPoint;
/*******************************************************************************
 * Copyright (C) 2009, Google Inc.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

package com.google.eclipse.mechanic;



/**
 * Scanner that looks in the registered {@link IResourceTaskProvider}s
 * for tasks.
 */
public abstract class ResourceTaskScanner implements TaskScanner {

  private final Supplier<List<IResourceTaskProvider>> supplier;

  public ResourceTaskScanner() {
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/ResourceTaskProvidersExtensionPoint.java
// public class ResourceTaskProvidersExtensionPoint {
//   private static final String EXTENSION_POINT_NAME = "resourcetaskproviders";
//   private static final String TAG_TASK = "provider";
//   private static final String ATTR_CLASS = "class";
// 
//   // Initialization On Demand Holder Idiom
//   // http://crazybob.org/2007/01/lazy-loading-singletons.html
//   private static class SingletonHolder {
//     static SimpleExtensionPointManager<IResourceTaskProvider> instance =
//         SimpleExtensionPointManager.newInstance(
//             EXTENSION_POINT_NAME,
//             IResourceTaskProvider.class,
//             TAG_TASK,
//             ATTR_CLASS,
//             null);
//   }
// 
//   private ResourceTaskProvidersExtensionPoint() {
//   }
// 
//   /**
//    * Return the {@link IResourceTaskProvider} supplier, initializing it if required.
//    *
//    * <p>The supplier is memoized, so it will return the same instantiated
//    * objects upon repeated calls.
//    */
//   public static Supplier<List<IResourceTaskProvider>> getInstance() {
//     return Suppliers.memoize(new Supplier<List<IResourceTaskProvider>>() {
//       public List<IResourceTaskProvider> get() {
//         return SingletonHolder.instance.getInstances();
//       }
//     });
//   }
// 
//   /**
//    * Clears the list of task providers.
//    * 
//    * <p><em>This should only be called by {@link MechanicPlugin#stop}.</em>
//    */
//   public static void dispose() {
//     SingletonHolder.instance = null;
//   }
// }


// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ResourceTaskScanner.java
import java.util.List;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import com.google.eclipse.mechanic.internal.ResourceTaskProvidersExtensionPoint;

/*******************************************************************************
 * Copyright (C) 2009, Google Inc.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

package com.google.eclipse.mechanic;



/**
 * Scanner that looks in the registered {@link IResourceTaskProvider}s
 * for tasks.
 */
public abstract class ResourceTaskScanner implements TaskScanner {

  private final Supplier<List<IResourceTaskProvider>> supplier;

  public ResourceTaskScanner() {
    this(ResourceTaskProvidersExtensionPoint.getInstance());