コード例 #1
0
 private <T extends Sniffer> List<T> getApplicableSniffers(
     DeploymentContext context, Collection<T> sniffers, boolean checkPath) {
   Types types = context.getTransientAppMetaData(Types.class.getName(), Types.class);
   ArchiveHandler handler = context.getArchiveHandler();
   List<URI> uris = handler.getClassPathURIs(context.getSource());
   return getApplicableSniffers(uris, types, sniffers, checkPath);
 }
コード例 #2
0
 /**
  * Returns a collection of sniffers that recognized some parts of the passed archive as components
  * their container handle.
  *
  * <p>If no sniffer recognize the passed archive, an empty collection is returned.
  *
  * @param context the deployment context
  * @return possibly empty collection of sniffers that handle the passed archive.
  */
 public Collection<Sniffer> getSniffers(DeploymentContext context) {
   ReadableArchive archive = context.getSource();
   ArchiveHandler handler = context.getArchiveHandler();
   List<URI> uris = handler.getClassPathURIs(archive);
   Types types = context.getTransientAppMetaData(Types.class.getName(), Types.class);
   return getSniffers(context, uris, types);
 }