Class ConnectorSniffer
- java.lang.Object
-
- org.glassfish.internal.deployment.GenericSniffer
-
- com.sun.enterprise.connectors.connector.module.ConnectorSniffer
-
- All Implemented Interfaces:
Sniffer
@Service(name="connector") @Singleton public class ConnectorSniffer extends GenericSniffer
Sniffer for detecting resource-adapter modules- Author:
- Jagadish Ramu
-
-
Field Summary
-
Fields inherited from class org.glassfish.internal.deployment.GenericSniffer
habitat, modulesRegistry
-
-
Constructor Summary
Constructors Constructor Description ConnectorSniffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected List<String>
getDeploymentConfigurationPaths()
Returns the descriptor paths that might exist in a connector app.String[]
getIncompatibleSnifferTypes()
String
getModuleType()
Returns the Module typeboolean
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 subsystemboolean
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, getContainerModuleNames, getDeploymentConfigurations, getURLPatterns, handles, hashCode, tearDown
-
-
-
-
Method Detail
-
setup
public com.sun.enterprise.module.HK2Module[] setup(String containerHome, Logger logger) throws IOException
Sets up the container libraries so that any imported bundle from the connector jar file will now be known to the module subsystem- Specified by:
setup
in interfaceSniffer
- Overrides:
setup
in classGenericSniffer
- 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
-
getContainersNames
public String[] getContainersNames()
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
-
getModuleType
public String getModuleType()
Returns the Module type- Specified by:
getModuleType
in interfaceSniffer
- Overrides:
getModuleType
in classGenericSniffer
- Returns:
- the container name
-
getAnnotationTypes
public Class<? extends Annotation>[] getAnnotationTypes()
Returns the list of annotations types 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:
getAnnotationTypes
in interfaceSniffer
- Overrides:
getAnnotationTypes
in classGenericSniffer
- Returns:
- list of annotations this sniffer is interested in or an empty array
-
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
-
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
-
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
-
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
-
getDeploymentConfigurationPaths
protected List<String> getDeploymentConfigurationPaths()
Returns the descriptor paths that might exist in a connector app.- Overrides:
getDeploymentConfigurationPaths
in classGenericSniffer
- Returns:
- list of the deployment descriptor paths
-
-