Class Parser
java.lang.Object
org.glassfish.hk2.classmodel.reflect.Parser
- All Implemented Interfaces:
Closeable
,AutoCloseable
Parse jar files or directories and create the model for any classes found.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ParsingContext
private final int
static final String
private final ExecutorService
private final Stack
<Future<Parser.Result>> private final ReadWriteLock
private final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionawaitTermination
(int timeOut, TimeUnit unit) void
close()
private ArchiveAdapter
createArchiveAdapter
(File source, Runnable doneHook) private ExecutorService
private void
doJob
(ArchiveAdapter adapter, Runnable doneHook) Returns the context this parser instance was initialized with during the call toParser(ParsingContext)
private static URI
getDefiningURI
(File file) private static File
getFilePath
(String path, String resourceName) private Types
void
parse
(ArchiveAdapter source, Runnable doneHook) Parse the archive adapter entries and run the runnable hook on completion.private void
saveResult
(URI uri, Types types)
-
Field Details
-
DEFAULT_WAIT_SYSPROP
- See Also:
-
context
-
processedURI
-
futures
-
executorService
-
ownES
private final boolean ownES -
lock
-
DEFAULT_TIMEOUT
private final int DEFAULT_TIMEOUT
-
-
Constructor Details
-
Parser
-
-
Method Details
-
awaitTermination
- Throws:
InterruptedException
-
awaitTermination
- Throws:
InterruptedException
-
getDefiningURI
-
getFilePath
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
parse
- Throws:
IOException
-
createArchiveAdapter
- Throws:
IOException
-
parse
Parse the archive adapter entries and run the runnable hook on completion.- Parameters:
source
- the archive adapter to parsedoneHook
- the runnable hook to run after completion- Returns:
- the future object to monitor the result of the parsing.
- Throws:
IOException
- thrown by the source archive adapter when accessing entries
-
getResult
-
saveResult
-
doJob
- Throws:
Exception
-
getContext
Returns the context this parser instance was initialized with during the call toParser(ParsingContext)
- Returns:
- the parsing context this parser uses to store the parsing activities results.
-
createExecutorService
-