Class MicroProfileSniffer
- java.lang.Object
-
- fish.payara.microprofile.connector.MicroProfileSniffer
-
- All Implemented Interfaces:
Sniffer
- Direct Known Subclasses:
ConfigSniffer
,FaultToleranceSniffer
,HealthSniffer
,JwtAuthSniffer
,MetricsSniffer
,OpenApiSniffer
@Contract public abstract class MicroProfileSniffer extends Object implements Sniffer
-
-
Constructor Summary
Constructors Constructor Description MicroProfileSniffer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String[]
getAnnotationNames(DeploymentContext ctx)
Returns the list of annotation names that this sniffer is interested in.protected abstract Class<?>
getContainersClass()
String[]
getContainersNames()
Returns the list of Containers that this Sniffer enables.Map<String,String>
getDeploymentConfigurations(ReadableArchive archive)
Returns a map of deployment configurations for this Sniffer from the specific archive source.String[]
getIncompatibleSnifferTypes()
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 invokedboolean
handles(ReadableArchive archive)
Returns true if the passed file or directory is recognized by this sniffer.boolean
handles(DeploymentContext context)
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 aModule
s for the module containing the core implementation of the container.boolean
supportsArchiveType(ArchiveType type)
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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.glassfish.api.container.Sniffer
getAnnotationTypes, getModuleType
-
-
-
-
Method Detail
-
handles
public boolean handles(DeploymentContext context)
Description copied from interface:Sniffer
Returns true if the passed file or directory is recognized by this sniffer.
-
getContainersClass
protected abstract Class<?> getContainersClass()
-
getContainersNames
public final String[] getContainersNames()
Description copied from interface:Sniffer
Returns the list of Containers that this Sniffer enables. The runtime will look up each container implementing using the names provided in the habitat.- Specified by:
getContainersNames
in interfaceSniffer
- Returns:
- list of container names known to the habitat for this sniffer
-
handles
public boolean handles(ReadableArchive archive)
Description copied from interface:Sniffer
Returns true if the passed file or directory is recognized by this sniffer.
-
getURLPatterns
public final String[] getURLPatterns()
Description copied from interface:Sniffer
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- Specified by:
getURLPatterns
in interfaceSniffer
- Returns:
- array of patterns
-
getAnnotationNames
public final String[] getAnnotationNames(DeploymentContext ctx)
Description copied from interface:Sniffer
Returns the list of annotation names that this sniffer is interested in. If an application bundle contains at least one class annotated with one of the returned annotations, the deployment process will not call the handles method but will invoke the containers deployers as if the handles method had been called and returned true.- Specified by:
getAnnotationNames
in interfaceSniffer
- Parameters:
ctx
- deployment context- Returns:
- list of annotation names this sniffer is interested in or an empty array
-
setup
public final com.sun.enterprise.module.HK2Module[] setup(String containerHome, Logger logger) throws IOException
Description copied from interface:Sniffer
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 aModule
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.- Specified by:
setup
in interfaceSniffer
- Parameters:
containerHome
- is where the container implementation resideslogger
- the logger to use- Returns:
- the module definition of the core container implementation.
- Throws:
IOException
- exception if something goes sour
-
tearDown
public final void tearDown()
Description copied from interface:Sniffer
Tears down a container, remove all imported libraries from the module subsystem.
-
supportsArchiveType
public final boolean supportsArchiveType(ArchiveType type)
Description copied from interface:Sniffer
This API is used to help determine if the sniffer should recognize the current archive. If the sniffer does not support the archive type associated with the current deployment, the sniffer should not recognize the archive.- Specified by:
supportsArchiveType
in interfaceSniffer
- Parameters:
type
- the archive type to check- Returns:
- whether the sniffer supports the archive type
-
getIncompatibleSnifferTypes
public String[] getIncompatibleSnifferTypes()
- Specified by:
getIncompatibleSnifferTypes
in interfaceSniffer
- Returns:
- the set of the sniffers that should not co-exist for the same module. For example, ejb and appclient sniffers should not be returned in the sniffer list for a certain module. This method will be used to validate and filter the retrieved sniffer lists for a certain module
-
isJavaEE
public final boolean isJavaEE()
-
isUserVisible
public boolean isUserVisible()
- Specified by:
isUserVisible
in interfaceSniffer
- Returns:
- whether this sniffer should be visible to user
-
getDeploymentConfigurations
public Map<String,String> getDeploymentConfigurations(ReadableArchive archive) throws IOException
Description copied from interface:Sniffer
Returns a map of deployment configurations for this Sniffer from the specific archive source.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.
- Specified by:
getDeploymentConfigurations
in interfaceSniffer
- Parameters:
archive
- the contents of the application's archive- Returns:
- map of configuration names to configurations for the application
- Throws:
IOException
- in case of errors searching or reading the archive for the deployment configuration(s)
-
-