@Service public class ResourcesDeployer extends JavaEEDeployer<ResourcesContainer,ResourcesApplication> implements org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy, EventListener
EventListener.Event<T>env, habitat, undeploymentVisitor| Constructor and Description |
|---|
ResourcesDeployer(ResourceFactory resourceFactoryParam,
ApplicationRegistry appRegistryParam,
javax.inject.Provider<ResourceManagerFactory> resourceManagerFactoryProviderParam,
ResourcesBinder resourcesBinderParam,
Applications applicationsParam) |
| Modifier and Type | Method and Description |
|---|---|
void |
createResources(DeploymentContext dc,
boolean embedded,
boolean deployResources) |
void |
deployResources(String applicationName,
boolean postDeployPhase) |
void |
deployResources(String applicationName,
String moduleName,
Collection<Resource> resources,
boolean postDeployPhase) |
void |
deployResourcesFromConfiguration(String appName,
boolean embedded) |
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
|
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.
|
ResourcesApplication |
load(ResourcesContainer container,
DeploymentContext context)
Loads a previously prepared application in its execution environment and
return a ContractProvider instance that will identify this environment in
future communications with the application's container runtime.
|
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.
|
void |
postConstruct() |
void |
preDestroy() |
void |
retainResourceConfig(DeploymentContext dc,
Map<String,Resources> allResources)
retain old resource configuration for the new archive being deployed.
|
void |
retrieveAllResourcesXMLs(Map<String,String> fileNames,
ReadableArchive archive,
String actualArchiveName)
Puts all glassfish-resources.xml files of an archive into a map
|
void |
unload(ResourcesApplication appContainer,
DeploymentContext context)
Unload or stop a previously running application identified with the
ContractProvider instance.
|
clean, generateArtifacts, getApplicationFromApplicationInfo, getCommonClassPath, getMetaData, getModuleClassPath, getObjectType, loadMetaData, prepare@Inject public ResourcesDeployer(ResourceFactory resourceFactoryParam, ApplicationRegistry appRegistryParam, javax.inject.Provider<ResourceManagerFactory> resourceManagerFactoryProviderParam, ResourcesBinder resourcesBinderParam, Applications applicationsParam)
public void postConstruct()
postConstruct in interface org.glassfish.hk2.api.PostConstructpublic void preDestroy()
preDestroy in interface org.glassfish.hk2.api.PreDestroypublic ResourcesApplication load(ResourcesContainer container, DeploymentContext context)
load in interface Deployer<ResourcesContainer,ResourcesApplication>load in class JavaEEDeployer<ResourcesContainer,ResourcesApplication>container - in which the application will residecontext - of the deploymentpublic void unload(ResourcesApplication appContainer, DeploymentContext context)
Deployerunload in interface Deployer<ResourcesContainer,ResourcesApplication>appContainer - instance to be stoppedcontext - of the undeploymentpublic void getResources(ReadableArchive archive, String appName, List<Resource> connectorResources, List<Resource> nonConnectorResources, Map<Resource,ResourcesXMLParser> resourceXmlParsers)
archive - Archieve from which the resources to be retrieved.appName - Name of the applicationconnectorResources - 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.public void retainResourceConfig(DeploymentContext dc, Map<String,Resources> allResources) throws Exception
dc - DeploymentContextallResources - all resources (app scoped, module scoped) of old applicationException - when unable to retain old resource configuration.public void populateResourceConfigInAppInfo(DeploymentContext dc)
dc - DeploymentContextpublic void createResources(DeploymentContext dc, boolean embedded, boolean deployResources) throws javax.resource.ResourceException
dc - embedded - deployResources - javax.resource.ResourceExceptionpublic void deployResourcesFromConfiguration(String appName, boolean embedded) throws Exception
Exceptionpublic void deployResources(String applicationName, boolean postDeployPhase) throws Exception
Exceptionpublic void deployResources(String applicationName, String moduleName, Collection<Resource> resources, boolean postDeployPhase) throws Exception
Exceptionpublic void retrieveAllResourcesXMLs(Map<String,String> fileNames, ReadableArchive archive, String actualArchiveName) throws IOException
If the archive is an ear all sub archives will be searched as well
fileNames - Map of all glassfish-resources files.
All found glassfish-resource files will be added to itarchive - The archive to search for glassfish-resources.xml filesactualArchiveName - The path of the archiveIOExceptionpublic void event(EventListener.Event event)
event in interface EventListenerevent - Copyright © 2017. All rights reserved.