Interface InstallHookProcessor
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
InstallHookProcessorImpl
The install hook processor is used for handle the install hooks, from registration to execution.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Cleans up any registered hooksbooleanexecute(InstallContext context) Executes the registered hooks with the currentInstallContext.Phase.booleanhasHooks()Checks if this process has any hooks registered.voidregisterHook(VaultInputSource input, ClassLoader classLoader) Register the hook provided by the given input source.voidregisterHooks(Archive archive, ClassLoader classLoader) Register all hooks found in the given archive.
-
Method Details
-
registerHooks
Register all hooks found in the given archive.- Parameters:
archive- the archive.classLoader- the class loader- Throws:
PackageException- if an error occurs.
-
registerHook
void registerHook(VaultInputSource input, ClassLoader classLoader) throws IOException, PackageException Register the hook provided by the given input source.- Parameters:
input- a vault input source containing the jar file of the install hookclassLoader- the class loader- Throws:
IOException- if an I/O error occursPackageException- if an error occurs.
-
hasHooks
boolean hasHooks()Checks if this process has any hooks registered.- Returns:
trueif there are hooks registered.
-
execute
Executes the registered hooks with the currentInstallContext.Phase.- Parameters:
context- the context- Returns:
trueif successful.
-
close
Cleans up any registered hooks- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-