public class GhostDeployerUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ENABLED |
static String |
GHOST_DEPLOYMENT |
static String |
PARTIAL_UPDATE_MODE |
Modifier and Type | Method and Description |
---|---|
static void |
addServiceGroupToTransitMap(org.apache.axis2.description.AxisServiceGroup serviceGroup,
org.apache.axis2.engine.AxisConfiguration axisConfig)
Adds the given service group to the transit map
|
static String |
calculateGhostFileName(String fileName,
String repoPath)
Calculate the ghost file name using the original file name.
|
static org.apache.axis2.description.AxisServiceGroup |
createGhostServiceGroup(org.apache.axis2.engine.AxisConfiguration axisConfig,
File ghostFile,
URL originalFile)
Creates the Ghost ServiceGroup by reading the ghost metadata file.
|
static org.apache.axis2.description.AxisService |
deployActualService(org.apache.axis2.engine.AxisConfiguration axisConfig,
org.apache.axis2.description.AxisService ghostService)
Removes the given ghost service and deploys the actual service.
|
static void |
deployGhostArtifacts(org.apache.axis2.engine.AxisConfiguration axisConfig) |
static void |
deployGhostServiceGroup(File ghostFile,
org.apache.axis2.deployment.repository.util.DeploymentFileData deploymentFileData,
org.apache.axis2.engine.AxisConfiguration axisConfig)
Load ghost services corresponding to a given axis2 service group
|
static org.apache.axis2.description.AxisService |
dispatchServiceFromTransitGhosts(org.apache.axis2.context.MessageContext msgCtx)
When a ghost service is removed from the axisConfig and the corresponding actual service is
deployed, there's a time interval in which there's no AxisService in the AxisConfiguration
for the particular service name.
|
static GhostArtifactRepository |
getGhostArtifactRepository(org.apache.axis2.engine.AxisConfiguration axisConfig)
get the ghost registry that store @DeploymentFileData objects of services
that are in ghost state.
|
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,org.apache.axis2.description.AxisService> |
getTransitGhostServicesMap(org.apache.axis2.engine.AxisConfiguration axisConfig)
Get the map of services which are in transit.
|
static boolean |
isGhostOn()
Read the "Enabled" property under "GhostDeployment" config from the carbon.xml and return the boolean value
|
static boolean |
isGhostService(org.apache.axis2.description.AxisService axisService)
Checks if the given Axis service is a ghost service.
|
static boolean |
isPartialUpdateEnabled()
Deprecated.
|
static void |
removeGhostFile(String filePath,
org.apache.axis2.engine.AxisConfiguration axisConfig) |
static void |
removeServiceGroupFromTransitMap(org.apache.axis2.description.AxisServiceGroup serviceGroup,
org.apache.axis2.engine.AxisConfiguration axisConfig)
Removes given service group from transit map
|
static String |
separatorsToUnix(String path) |
static void |
serializeServiceGroup(Set<org.apache.axis2.description.AxisService> services,
org.apache.axis2.deployment.repository.util.DeploymentFileData deploymentFileData,
org.apache.axis2.engine.AxisConfiguration axisConfig)
Creates the ghost file for the current service group.
|
static void |
setGhostArtifactRepository(GhostArtifactRepository ghostArtifactRepository,
org.apache.axis2.engine.AxisConfiguration axisConfig)
ghost registry stores @DeploymentFileData objects of services
that are in ghost state.
|
static void |
updateLastUsedTime(org.apache.axis2.description.AxisService service)
Updates the last used timestamp of the given service.
|
static void |
waitForServiceToLeaveTransit(String serviceName,
org.apache.axis2.engine.AxisConfiguration axisConfig)
When a ghost service is removed from the AxisConfiguration, name of that service is kept
temporary in a map.
|
public static final String GHOST_DEPLOYMENT
public static final String ENABLED
public static final String PARTIAL_UPDATE_MODE
public static org.apache.axis2.description.AxisService deployActualService(org.apache.axis2.engine.AxisConfiguration axisConfig, org.apache.axis2.description.AxisService ghostService) throws org.apache.axis2.AxisFault
axisConfig
- - AxisConfiguration instanceghostService
- - Existing Ghost serviceorg.apache.axis2.AxisFault
- - On errors while removing existing servicepublic static void updateLastUsedTime(org.apache.axis2.description.AxisService service)
service
- - AxisService instancepublic static boolean isGhostOn()
@Deprecated public static boolean isPartialUpdateEnabled()
public static Map<String,org.apache.axis2.description.AxisService> getTransitGhostServicesMap(org.apache.axis2.engine.AxisConfiguration axisConfig) throws org.apache.axis2.AxisFault
axisConfig
- - AxisConfiguration instanceorg.apache.axis2.AxisFault
- - on error while getting or setting mappublic static org.apache.axis2.description.AxisService dispatchServiceFromTransitGhosts(org.apache.axis2.context.MessageContext msgCtx) throws org.apache.axis2.AxisFault
msgCtx
- - MessageContext for the current requestorg.apache.axis2.AxisFault
- - on errors while calling Axis2 APIspublic static void waitForServiceToLeaveTransit(String serviceName, org.apache.axis2.engine.AxisConfiguration axisConfig) throws org.apache.axis2.AxisFault
serviceName
- - name of the serviceaxisConfig
- - current axisConfig instanceorg.apache.axis2.AxisFault
- - on errors while reading ghost mappublic static boolean isGhostService(org.apache.axis2.description.AxisService axisService)
axisService
- - The AxisService object to be checked if it's a ghost servicepublic static org.apache.axis2.description.AxisServiceGroup createGhostServiceGroup(org.apache.axis2.engine.AxisConfiguration axisConfig, File ghostFile, URL originalFile)
axisConfig
- - AxisConfiguration instanceghostFile
- - Ghost metadata fileoriginalFile
- - URL of the original service artifactpublic static void serializeServiceGroup(Set<org.apache.axis2.description.AxisService> services, org.apache.axis2.deployment.repository.util.DeploymentFileData deploymentFileData, org.apache.axis2.engine.AxisConfiguration axisConfig)
services
- - Services to be serializeddeploymentFileData
- - Absolute path to the service artifactaxisConfig
- - AxisConfiguration instancepublic static String calculateGhostFileName(String fileName, String repoPath)
fileName
- - original file namerepoPath
- - path of the axis2 repositorypublic static File getGhostFile(String fileName, org.apache.axis2.engine.AxisConfiguration axisConfig)
fileName
- - original service file nameaxisConfig
- - AxisConfiguration instancepublic static void addServiceGroupToTransitMap(org.apache.axis2.description.AxisServiceGroup serviceGroup, org.apache.axis2.engine.AxisConfiguration axisConfig) throws org.apache.axis2.AxisFault
serviceGroup
- - to be added to transit mapaxisConfig
- - current axis configurationorg.apache.axis2.AxisFault
- - on errorpublic static void removeServiceGroupFromTransitMap(org.apache.axis2.description.AxisServiceGroup serviceGroup, org.apache.axis2.engine.AxisConfiguration axisConfig) throws org.apache.axis2.AxisFault
serviceGroup
- - to be removed from transit mapaxisConfig
- - current axis configurationorg.apache.axis2.AxisFault
- - on errorpublic static void deployGhostArtifacts(org.apache.axis2.engine.AxisConfiguration axisConfig) throws org.apache.axis2.deployment.DeploymentException
org.apache.axis2.deployment.DeploymentException
public static void removeGhostFile(String filePath, org.apache.axis2.engine.AxisConfiguration axisConfig)
public static void setGhostArtifactRepository(GhostArtifactRepository ghostArtifactRepository, org.apache.axis2.engine.AxisConfiguration axisConfig) throws org.apache.axis2.deployment.DeploymentException
ghostArtifactRepository
- Set the ghost artifact registry for this tenantaxisConfig
- The axis configuration of the tenantorg.apache.axis2.deployment.DeploymentException
- if error occurred while saving the ghost artifact registrypublic static GhostArtifactRepository getGhostArtifactRepository(org.apache.axis2.engine.AxisConfiguration axisConfig)
axisConfig
- The axis configuration of the tenantpublic static void deployGhostServiceGroup(File ghostFile, org.apache.axis2.deployment.repository.util.DeploymentFileData deploymentFileData, org.apache.axis2.engine.AxisConfiguration axisConfig) throws org.apache.axis2.deployment.DeploymentException
ghostFile
- The ghost file that contains meta information to deploy a ghost servicedeploymentFileData
- The deployment file data of the artifact we are about to deployaxisConfig
- The axis configuration of the tenantorg.apache.axis2.deployment.DeploymentException
Copyright © 2016 WSO2 Inc. All rights reserved.