Class JarArchive
- java.lang.Object
-
- org.glassfish.hk2.classmodel.reflect.util.AbstractAdapter
-
- org.glassfish.hk2.classmodel.reflect.util.JarArchive
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ArchiveAdapter
public class JarArchive extends AbstractAdapter
Jar based archive abstraction
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.hk2.classmodel.reflect.ArchiveAdapter
ArchiveAdapter.Entry, ArchiveAdapter.EntryTask, ArchiveAdapter.Selector
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.jar.JarFile
jar
private Parser
parser
private java.util.concurrent.atomic.AtomicInteger
releaseCount
We need to maintain how many internal jars got opened so that we don't close our jar archive until all the sub scanning has been done successfully.private java.net.URI
uri
-
Constructor Summary
Constructors Constructor Description JarArchive(Parser parser, java.net.URI uri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.util.jar.Manifest
getManifest()
Returns the manifest instance for the archive.java.net.URI
getURI()
Returns the URI of the archivevoid
onSelectedEntries(ArchiveAdapter.Selector selector, ArchiveAdapter.EntryTask task, java.util.logging.Logger logger)
perform a task on selected archive entries(package private) void
releaseCount()
-
Methods inherited from class org.glassfish.hk2.classmodel.reflect.util.AbstractAdapter
onAllEntries
-
-
-
-
Field Detail
-
parser
private final Parser parser
-
jar
private final java.util.jar.JarFile jar
-
uri
private final java.net.URI uri
-
releaseCount
private final java.util.concurrent.atomic.AtomicInteger releaseCount
We need to maintain how many internal jars got opened so that we don't close our jar archive until all the sub scanning has been done successfully.
-
-
Constructor Detail
-
JarArchive
public JarArchive(Parser parser, java.net.URI uri) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getURI
public java.net.URI getURI()
Description copied from interface:ArchiveAdapter
Returns the URI of the archive- Returns:
- URI of the archive
-
onSelectedEntries
public void onSelectedEntries(ArchiveAdapter.Selector selector, ArchiveAdapter.EntryTask task, java.util.logging.Logger logger) throws java.io.IOException
Description copied from interface:ArchiveAdapter
perform a task on selected archive entries- Parameters:
selector
- implementation to select the archive archive entries on which the task should be performed.task
- the task to performlogger
- for any logging activity- Throws:
java.io.IOException
- can be generated while reading the archive entries
-
getManifest
public java.util.jar.Manifest getManifest() throws java.io.IOException
Description copied from interface:ArchiveAdapter
Returns the manifest instance for the archive.- Returns:
- the archive's manifest
- Throws:
java.io.IOException
- if the manifest cannot be loaded.
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
releaseCount
void releaseCount() throws java.io.IOException
- Throws:
java.io.IOException
-
-