@Contract
public interface Sniffer
For clients who want to work with Sniffers, see SnifferManager in the kernel.
Modifier and Type | Method and Description |
---|---|
String[] |
getAnnotationNames(DeploymentContext context)
Returns the list of annotation names that this sniffer is interested in.
|
Class<? extends Annotation>[] |
getAnnotationTypes()
Returns the list of annotations types that this sniffer is interested in.
|
String[] |
getContainersNames()
Returns the list of Containers that this Sniffer enables.
|
Map<String,String> |
getDeploymentConfigurations(ReadableArchive source)
Returns a map of deployment configurations for this Sniffer from the
specific archive source.
|
String[] |
getIncompatibleSnifferTypes() |
String |
getModuleType()
Returns the container type associated with this sniffer
|
String[] |
getURLPatterns()
Returns the array of patterns to apply against the request URL
If the pattern matches the URL, the service method of the associated
container will be invoked
|
boolean |
handles(DeploymentContext context)
Returns true if the passed file or directory is recognized by this
sniffer.
|
boolean |
handles(ReadableArchive source)
Returns true if the passed file or directory is recognized by this
sniffer.
|
boolean |
isJavaEE() |
boolean |
isUserVisible() |
com.sun.enterprise.module.HK2Module[] |
setup(String containerHome,
Logger logger)
Sets up the container libraries so that any imported bundle from the
connector jar file will now be known to the module subsystem
This method returns a
Module s for the module containing
the core implementation of the container. |
boolean |
supportsArchiveType(ArchiveType archiveType)
This API is used to help determine if the sniffer should recognize
the current archive.
|
void |
tearDown()
Tears down a container, remove all imported libraries from the module
subsystem.
|
boolean handles(DeploymentContext context)
context
- deployment contextboolean handles(ReadableArchive source)
source
- the file or directory abstracted as an archive
resources from the source archive.String[] getURLPatterns()
Class<? extends Annotation>[] getAnnotationTypes()
String[] getAnnotationNames(DeploymentContext context)
context
- deployment contextString getModuleType()
com.sun.enterprise.module.HK2Module[] setup(String containerHome, Logger logger) throws IOException
Module
s for the module containing
the core implementation of the container. That means that this module
will be locked as long as there is at least one module loaded in the
associated container.containerHome
- is where the container implementation resideslogger
- the logger to useIOException
- exception if something goes sourvoid tearDown()
String[] getContainersNames()
boolean isUserVisible()
boolean isJavaEE()
Map<String,String> getDeploymentConfigurations(ReadableArchive source) throws IOException
Many sniffers (esp. Java EE sniffers) will choose to set the key of each map entry to the relative path within the ReadableArchive of the deployment descriptor and the value of that map entry to the descriptor's contents.
source
- the contents of the application's archiveIOException
- in case of errors searching or reading the
archive for the deployment configuration(s)String[] getIncompatibleSnifferTypes()
boolean supportsArchiveType(ArchiveType archiveType)
archiveType
- the archive type to checkCopyright © 2021. All rights reserved.