/** * @return true if the archivist is handling the provided archive */ @Override protected boolean postHandles(ReadableArchive abstractArchive) throws IOException { /* * Connectors can be defined via annotations only within RARs. The * Archivist's handles method will invoke this postHandles only if * the archive is a directory; if it were truly a JAR file then it * would have a file type of .rar, the ArchivistFactory.getArchivist * method would already have chosen to provide a ConnectorArchivist. * So the fact that control reaches here means either that this is * a directory or it's a non-.rar archive file. So we need to run the anno * detector only if the archive is a directory. * * (This is particularly helpful in the case of an app client being * run in the ACC, because the archive is a JAR file, not an * expanded directory. We know that no connectors will be defined * in a file with type .jar so there's no need to scan the archive's * classes looking for the relevant annos.) */ if (abstractArchive instanceof InputJarArchive) { return false; } ConnectorAnnotationDetector detector = new ConnectorAnnotationDetector(new ResourceAdapterAnnotationScanner()); return detector.hasAnnotationInArchive(abstractArchive); }
String entryName = entries.nextElement(); if (entryName.endsWith(".class")) { if (containsAnnotation(archive, entryName)) { return true; JarEntry jarEntry = jarEntries.nextElement(); if (jarEntry.getName().endsWith(".class")) { if (containsAnnotation(jarFile.getInputStream( jarEntry), jarEntry.getSize())) { return true;
String entryName = entries.nextElement(); if (entryName.endsWith(".class")) { if (containsAnnotation(archive, entryName)) { return true; JarEntry jarEntry = jarEntries.nextElement(); if (jarEntry.getName().endsWith(".class")) { if (containsAnnotation(jarFile.getInputStream( jarEntry), jarEntry.getSize())) { return true;