Class ResourcesDeployer

    • Method Detail

      • postConstruct

        public void postConstruct()
        Specified by:
        postConstruct in interface org.glassfish.hk2.api.PostConstruct
      • preDestroy

        public void preDestroy()
        Specified by:
        preDestroy in interface org.glassfish.hk2.api.PreDestroy
      • getResources

        public void getResources​(ReadableArchive archive,
                                 String appName,
                                 List<Resource> connectorResources,
                                 List<Resource> nonConnectorResources,
                                 Map<Resource,​ResourcesXMLParser> resourceXmlParsers)
        Retrieve connector and non-connector resources from the archive.
        Parameters:
        archive - Archieve from which the resources to be retrieved.
        appName - Name of the application
        connectorResources - Connector resources will be added to this list.
        nonConnectorResources - Non connector resources will be added to this list.
        resourceXmlParsers - Resource xml parsers corresponding to both connector and non connector resources will be stored in this.
      • retainResourceConfig

        public void retainResourceConfig​(DeploymentContext dc,
                                         Map<String,​Resources> allResources)
                                  throws Exception
        retain old resource configuration for the new archive being deployed.
        Parameters:
        dc - DeploymentContext
        allResources - all resources (app scoped, module scoped) of old application
        Throws:
        Exception - when unable to retain old resource configuration.
      • populateResourceConfigInAppInfo

        public void populateResourceConfigInAppInfo​(DeploymentContext dc)
        During "load()" event (eg: app/app-ref enable, server start), populate resource-config in app-info so that it can be used for constructing connector-classloader for the application.
        Parameters:
        dc - DeploymentContext
      • createResources

        public void createResources​(DeploymentContext dc,
                                    boolean embedded,
                                    boolean deployResources)
                             throws jakarta.resource.ResourceException
        Parameters:
        dc -
        embedded -
        deployResources -
        Throws:
        jakarta.resource.ResourceException
      • deployResourcesFromConfiguration

        public void deployResourcesFromConfiguration​(String appName,
                                                     boolean embedded)
                                              throws Exception
        Throws:
        Exception
      • deployResources

        public void deployResources​(String applicationName,
                                    boolean postDeployPhase)
                             throws Exception
        Throws:
        Exception
      • retrieveAllResourcesXMLs

        public void retrieveAllResourcesXMLs​(Map<String,​String> fileNames,
                                             ReadableArchive archive,
                                             String actualArchiveName)
                                      throws IOException
        Puts all glassfish-resources.xml files of an archive into a map

        If the archive is an ear all sub archives will be searched as well

        Parameters:
        fileNames - Map of all glassfish-resources files. All found glassfish-resource files will be added to it
        archive - The archive to search for glassfish-resources.xml files
        actualArchiveName - The path of the archive
        Throws:
        IOException
      • event

        public void event​(EventListener.Event event)
        Event listener to listen to application undeploy validation and if preserveResources flag is set, cache the <resources> config for persisting it in domain.xml
        Specified by:
        event in interface EventListener
        Parameters:
        event -