org.apache.synapse.deployers
Class SynapseArtifactDeploymentStore

java.lang.Object
  extended by org.apache.synapse.deployers.SynapseArtifactDeploymentStore

public final class SynapseArtifactDeploymentStore
extends Object

Keeps track of the artifacts deployed with files inside the synapse repository

For hot deployment to properly work we need to, keep track fo not only the artifacts deployed by deployers but also the artifacts deployed from files at the startup as well. Otherwise it is not possible to track the hot update cases. This is introduced as a singleton for the startup to report back for the deployed artifacts at startup apart from the deployers.

See Also:
AbstractSynapseArtifactDeployer, MultiXMLConfigurationBuilder

Constructor Summary
SynapseArtifactDeploymentStore()
           
 
Method Summary
 void addArtifact(String fileName, String artifactName)
          Adds artifacts indexed with the respective filename
 void addBackedUpArtifact(String fileName)
          Adds an artifact to the backedUp artifacts
 void addRestoredArtifact(String fileName)
          Adds an artifact which is being restored
 void addUpdatingArtifact(String fileName, String artifactName)
          Adds an updating artifact for the given instance
 boolean containsFileName(String fileName)
          Checks whether there is an artifact indexed with the given filename
 String getArtifactNameForFile(String fileName)
          Retrieves the artifact name indexed with the given filename
static String getNormalizedAbsolutePath(String fileName)
           
 String getUpdatingArtifactWithFileName(String fileName)
          Retrieves the artifact name corresponds to the given updating artifact file name
 boolean isBackedUpArtifact(String fileName)
          Checks whether the given artifact is being backed up
 boolean isRestoredFile(String fileName)
          Checks whether the given artifact is being restored
 boolean isUpdatingArtifact(String fileName)
          Checks whether the given artifact is at the updating state in the given instance
 void removeArtifactWithFileName(String fileName)
          Removes the indexed artifacts to the filename mapping from the holder
 void removeBackedUpArtifact(String fileName)
          Removes a backedUp artifact
 void removeRestoredFile(String fileName)
          Removes a restored artifact
 void removeUpdatingArtifact(String fileName)
          Removes an updating artifact
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynapseArtifactDeploymentStore

public SynapseArtifactDeploymentStore()
Method Detail

addArtifact

public void addArtifact(String fileName,
                        String artifactName)
Adds artifacts indexed with the respective filename

Parameters:
fileName - name of the file from which the artifact being added is loaded
artifactName - name of the artifact being added

containsFileName

public boolean containsFileName(String fileName)
Checks whether there is an artifact indexed with the given filename

Parameters:
fileName - artifact filename to be checked for the existence
Returns:
boolean true if it is available, false if not

getArtifactNameForFile

public String getArtifactNameForFile(String fileName)
Retrieves the artifact name indexed with the given filename

Parameters:
fileName - name of the file which maps to the artifact
Returns:
String artifact name mapped with the give filename

removeArtifactWithFileName

public void removeArtifactWithFileName(String fileName)
Removes the indexed artifacts to the filename mapping from the holder

Parameters:
fileName - name of the file of which the artifact required to be removed

addUpdatingArtifact

public void addUpdatingArtifact(String fileName,
                                String artifactName)
Adds an updating artifact for the given instance

Parameters:
fileName - name of the file from which the artifact has been loaded
artifactName - name of the actual artifact being updated

isUpdatingArtifact

public boolean isUpdatingArtifact(String fileName)
Checks whether the given artifact is at the updating state in the given instance

Parameters:
fileName - name of the file which describes the artifact to be checked
Returns:
boolean true if it is at the updating state, false otherwise

getUpdatingArtifactWithFileName

public String getUpdatingArtifactWithFileName(String fileName)
Retrieves the artifact name corresponds to the given updating artifact file name

Parameters:
fileName - name of the file from which the artifact is being updated
Returns:
String artifact name corresponds to the given file name

removeUpdatingArtifact

public void removeUpdatingArtifact(String fileName)
Removes an updating artifact

Parameters:
fileName - name of the file of the artifact to be removed from the updating artifacts

addRestoredArtifact

public void addRestoredArtifact(String fileName)
Adds an artifact which is being restored

Parameters:
fileName - name of the file of the artifact which is being restored

isRestoredFile

public boolean isRestoredFile(String fileName)
Checks whether the given artifact is being restored

Parameters:
fileName - name of the file to be checked
Returns:
boolean true if the provided filename describes a restoring artifact, false otherwise

removeRestoredFile

public void removeRestoredFile(String fileName)
Removes a restored artifact

Parameters:
fileName - name of the file of the artifact to be removed

addBackedUpArtifact

public void addBackedUpArtifact(String fileName)
Adds an artifact to the backedUp artifacts

Parameters:
fileName - name of the file of the artifact to be added into the backedUp artifacts

isBackedUpArtifact

public boolean isBackedUpArtifact(String fileName)
Checks whether the given artifact is being backed up

Parameters:
fileName - name of the file of the artifact to be checked
Returns:
boolean true if the artifact is being backed up, false otherwise

removeBackedUpArtifact

public void removeBackedUpArtifact(String fileName)
Removes a backedUp artifact

Parameters:
fileName - name of the file of the artifact to be removed

getNormalizedAbsolutePath

public static String getNormalizedAbsolutePath(String fileName)


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.