Class MicroProfileSniffer

    • Constructor Detail

      • MicroProfileSniffer

        public MicroProfileSniffer()
    • 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.
        Specified by:
        handles in interface Sniffer
        Parameters:
        context - deployment context
        Returns:
        true if the location 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 interface Sniffer
        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.
        Specified by:
        handles in interface Sniffer
        Parameters:
        archive - the file or directory abstracted as an archive resources from the source archive.
        Returns:
        true if the location 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 interface Sniffer
        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 interface Sniffer
        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 a Modules 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 interface Sniffer
        Parameters:
        containerHome - is where the container implementation resides
        logger - 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.
        Specified by:
        tearDown in interface Sniffer
      • 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 interface Sniffer
        Parameters:
        type - the archive type to check
        Returns:
        whether the sniffer supports the archive type
      • getIncompatibleSnifferTypes

        public String[] getIncompatibleSnifferTypes()
        Specified by:
        getIncompatibleSnifferTypes in interface Sniffer
        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()
        Specified by:
        isJavaEE in interface Sniffer
        Returns:
        whether this sniffer represents a Java EE container type
      • isUserVisible

        public boolean isUserVisible()
        Specified by:
        isUserVisible in interface Sniffer
        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 interface Sniffer
        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)