View Javadoc

1   package com.atlassian.plugin.loaders.classloading;
2   
3   import java.util.Collection;
4   import java.util.Collections;
5   
6   import org.slf4j.Logger;
7   import org.slf4j.LoggerFactory;
8   
9   /**
10   * A {@link Scanner} which never finds anything.
11   *
12   * @since 3.0.16
13   */
14  public class EmptyScanner implements Scanner
15  {
16      private static final Logger log = LoggerFactory.getLogger(EmptyScanner.class);
17  
18      public Collection<DeploymentUnit> scan()
19      {
20          return Collections.emptyList();
21      }
22  
23      public Collection<DeploymentUnit> getDeploymentUnits()
24      {
25          return Collections.emptyList();
26      }
27  
28      public void reset()
29      {
30          // Nothing to reset
31      }
32  
33      public void remove(final DeploymentUnit unit)
34      {
35          // Nothing to remove, but the caller shouldn't be trying really, so WARN - it's
36          // recoverable, but probably indicates a bug
37          log.warn("EmptyScanner.remove called for {}", unit);
38      }
39  }