Package org.glassfish.web.sniffer
Class WebSniffer
- java.lang.Object
-
- org.glassfish.internal.deployment.GenericSniffer
-
- org.glassfish.web.sniffer.WebSniffer
-
- All Implemented Interfaces:
Sniffer
@Service(name="web") @Singleton public class WebSniffer extends GenericSniffer
Implementation of the Sniffer for the web container.- Author:
- Jerome Dochez
-
-
Field Summary
-
Fields inherited from class org.glassfish.internal.deployment.GenericSniffer
habitat, modulesRegistry
-
-
Constructor Summary
Constructors Constructor Description WebSniffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String[]
getContainerModuleNames()
String[]
getContainersNames()
Returns the list of Containers that this Sniffer enables.protected List<String>
getDeploymentConfigurationPaths()
Returns the web-oriented descriptor paths that might exist in a web app.String[]
getIncompatibleSnifferTypes()
String[]
getURLPatterns()
Returns the pattern to apply against the request URL If the pattern matches the URL, the service method of the associated container will be invokedboolean
handles(ReadableArchive location)
Returns true if the passed file or directory is recognized by this instance.boolean
handles(DeploymentContext context)
Returns true if the passed file or directory is recognized by this sniffer.boolean
isJavaEE()
boolean
isUserVisible()
boolean
supportsArchiveType(ArchiveType archiveType)
This API is used to help determine if the sniffer should recognize the current archive.-
Methods inherited from class org.glassfish.internal.deployment.GenericSniffer
equals, getAnnotationNames, getAnnotationTypes, getDeploymentConfigurations, getModuleType, hashCode, setup, tearDown
-
-
-
-
Method Detail
-
getURLPatterns
public String[] getURLPatterns()
Description copied from class:GenericSniffer
Returns the pattern 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
- Overrides:
getURLPatterns
in classGenericSniffer
- Returns:
- pattern instance
-
handles
public boolean handles(DeploymentContext context)
Returns true if the passed file or directory is recognized by this sniffer.- Specified by:
handles
in interfaceSniffer
- Overrides:
handles
in classGenericSniffer
- Parameters:
context
- deployment context- Returns:
- true if the location is recognized by this sniffer
-
handles
public boolean handles(ReadableArchive location)
Returns true if the passed file or directory is recognized by this instance.- Specified by:
handles
in interfaceSniffer
- Overrides:
handles
in classGenericSniffer
- Parameters:
location
- the file or directory to explore- Returns:
- true if this sniffer handles this application type
-
getContainersNames
public 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.- Returns:
- list of container names known to the habitat for this sniffer
-
isUserVisible
public boolean isUserVisible()
- Specified by:
isUserVisible
in interfaceSniffer
- Overrides:
isUserVisible
in classGenericSniffer
- Returns:
- whether this sniffer should be visible to user
-
isJavaEE
public boolean isJavaEE()
- Specified by:
isJavaEE
in interfaceSniffer
- Overrides:
isJavaEE
in classGenericSniffer
- Returns:
- whether this sniffer represents a Java EE container type
-
getDeploymentConfigurationPaths
protected List<String> getDeploymentConfigurationPaths()
Returns the web-oriented descriptor paths that might exist in a web app.- Overrides:
getDeploymentConfigurationPaths
in classGenericSniffer
- Returns:
- list of the deployment descriptor paths
-
getIncompatibleSnifferTypes
public String[] getIncompatibleSnifferTypes()
- Specified by:
getIncompatibleSnifferTypes
in interfaceSniffer
- Overrides:
getIncompatibleSnifferTypes
in classGenericSniffer
- 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
-
supportsArchiveType
public boolean supportsArchiveType(ArchiveType archiveType)
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.- Parameters:
archiveType
- the archive type to check- Returns:
- whether the sniffer supports the archive type
-
getContainerModuleNames
protected String[] getContainerModuleNames()
- Overrides:
getContainerModuleNames
in classGenericSniffer
-
-