public class GhostWebappDeployerUtils extends Object
Modifier and Type | Method and Description |
---|---|
static WebApplication |
addGhostWebApp(File ghostFile,
File originalFile,
TomcatGenericWebappsDeployer applicationDeployer,
org.apache.axis2.context.ConfigurationContext configContext)
Creates the Ghost webapplication by reading the ghost metadata file.
|
static String |
calculateGhostFileName(String fileName,
String repoPath)
Calculate the ghost file name using the original file name.
|
static WebApplication |
deployActualWebApp(WebApplication ghostWebapp,
org.apache.axis2.context.ConfigurationContext configurationContext)
Removes the given ghostWebapp and deploys the actual webapp.
|
static void |
deployGhostArtifacts(org.apache.axis2.context.ConfigurationContext configContext) |
static WebApplication |
dispatchWebAppFromTransitGhosts(String ctxName,
org.apache.axis2.context.ConfigurationContext cfgContext)
When a ghost webapp is removed from the webappsholder and the corresponding actual webapp is
deployed, there's a time interval in which there's no Webapp in the webapps holder for the
particular webapp context.
|
static WebApplication |
findDeployedWebapp(org.apache.axis2.context.ConfigurationContext configurationContext,
String webappFilePath)
This method is used to find a webapplication from the webapps holder by comparing the webapp
file absolute path.
|
static String |
getDummyContextDirectoryPath(String contextName,
org.apache.axis2.engine.AxisConfiguration axisConfig)
Method which will return the dummy context directory path for current tenant which will be
created in /tmp/tenants/ directory
|
static File |
getDummyContextFile(String fileName,
org.apache.axis2.engine.AxisConfiguration axisConfig)
Calculate the dummy context file name using the original file name.
|
static File |
getGhostFile(String fileName,
org.apache.axis2.engine.AxisConfiguration axisConfig)
Creates a File instance for the ghost service according to the original file name..
|
static Map<String,WebApplication> |
getTransitGhostWebAppsMap(org.apache.axis2.context.ConfigurationContext cfgContext)
Get the map of services which are in transit.
|
static boolean |
isGhostWebApp(WebApplication webApplication)
Checks if the given webapp is a ghost webapp.
|
static String |
separatorsToUnix(String path) |
static void |
serializeWebApp(WebApplication webApplication,
org.apache.axis2.engine.AxisConfiguration axisConfig,
String webappPath)
Creates the ghost file for the current web application.
|
static boolean |
skipUndeploy(String fileName)
Method to check if the undeploying of ghost related files needs to be skipped
|
static void |
updateLastUsedTime(WebApplication webApplication)
Updates the last used timestamp of the given webapp.
|
static void |
waitForWebAppToLeaveTransit(String contextName,
org.apache.axis2.context.ConfigurationContext cfgContext)
When a ghost webapp is removed from the WebappsHolder, context name of that webapp is kept
temporary in a map.
|
public static WebApplication deployActualWebApp(WebApplication ghostWebapp, org.apache.axis2.context.ConfigurationContext configurationContext)
ghostWebapp
- Existing ghost WebappconfigurationContext
- ConfigurationContext instancepublic static void updateLastUsedTime(WebApplication webApplication)
webApplication
- to be updatedpublic static Map<String,WebApplication> getTransitGhostWebAppsMap(org.apache.axis2.context.ConfigurationContext cfgContext)
cfgContext
- - ConfigurationContext that holds the transitMap propertypublic static WebApplication dispatchWebAppFromTransitGhosts(String ctxName, org.apache.axis2.context.ConfigurationContext cfgContext)
ctxName
- - contextName of webappcfgContext
- - ConfigurationContext to get the transitGhost webapps mappublic static void waitForWebAppToLeaveTransit(String contextName, org.apache.axis2.context.ConfigurationContext cfgContext)
contextName
- - contextName to bec checked with the ghostTransitMapcfgContext
- - ConfigurationContext to get the transitGhost webapps mappublic static boolean isGhostWebApp(WebApplication webApplication)
webApplication
- - the webapp to be checked for ghost parampublic static WebApplication addGhostWebApp(File ghostFile, File originalFile, TomcatGenericWebappsDeployer applicationDeployer, org.apache.axis2.context.ConfigurationContext configContext)
ghostFile
- - ghost metadata fileoriginalFile
- - original webapp fileconfigContext
- - configContext to get tenant details and webapp deployer instancepublic static void serializeWebApp(WebApplication webApplication, org.apache.axis2.engine.AxisConfiguration axisConfig, String webappPath)
webApplication
- - Webapplication to be serializedaxisConfig
- - AxisConfiguration instancewebappPath
- - Absolute path to the webapp artifactpublic static File getGhostFile(String fileName, org.apache.axis2.engine.AxisConfiguration axisConfig)
fileName
- - original service file nameaxisConfig
- - AxisConfiguration instancepublic static String calculateGhostFileName(String fileName, String repoPath)
fileName
- - original file namerepoPath
- - path of the axis2 repositorypublic static WebApplication findDeployedWebapp(org.apache.axis2.context.ConfigurationContext configurationContext, String webappFilePath)
configurationContext
- - configurationContext instance that has the webapps holder propertywebappFilePath
- - absolute path of the webapp to be compared with other webapps in the holderpublic static String getDummyContextDirectoryPath(String contextName, org.apache.axis2.engine.AxisConfiguration axisConfig)
contextName
- - context nameaxisConfig
- - axisConfig used to get tenant infopublic static File getDummyContextFile(String fileName, org.apache.axis2.engine.AxisConfiguration axisConfig)
fileName
- - original file nameaxisConfig
- - axisConfigpublic static boolean skipUndeploy(String fileName)
fileName
- name of the webapp filepublic static void deployGhostArtifacts(org.apache.axis2.context.ConfigurationContext configContext)
Copyright © 2018 WSO2. All rights reserved.