org.wso2.carbon.deployment.synchronizer.internal
Class DeploymentSynchronizationManager

java.lang.Object
  extended by org.wso2.carbon.deployment.synchronizer.internal.DeploymentSynchronizationManager

public final class DeploymentSynchronizationManager
extends Object

This class is responsible for creating DeploymentSynchronizer instances as and when necessary and keeping track of them for management purposes. It also provides a base framework for scheduling automatic repository synchronization tasks.


Method Summary
 DeploymentSynchronizer createSynchronizer(int tenantId, ArtifactRepository artifactRepository, String filePath)
          Creates a new DeploymentSynchronizer instance using the provided parameters.
 DeploymentSynchronizer deleteSynchronizer(int tenantId)
           
 DeploymentSynchronizer deleteSynchronizer(String filePath)
          Deletes the DeploymentSynchronizer for the specified file path.
static DeploymentSynchronizationManager getInstance()
           
 DeploymentSynchronizer getSynchronizer(int tenantId)
           
 DeploymentSynchronizer getSynchronizer(String filePath)
           
 Map<String,DeploymentSynchronizer> getSynchronizers()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DeploymentSynchronizationManager getInstance()

createSynchronizer

public DeploymentSynchronizer createSynchronizer(int tenantId,
                                                 ArtifactRepository artifactRepository,
                                                 String filePath)
Creates a new DeploymentSynchronizer instance using the provided parameters. A given file path may only have one DeploymentSynchronizer engaged on it. Any attempts to create multiple DeploymentSynchronizer instances on the same file path will result in an IllegalStateException. This method only creates DeploymentSynchronizer instances. The caller should take action to customize and further initialize the repository as required.

Parameters:
artifactRepository - ArtifactRepository representing the remote repository
filePath - File path in the local file system
Returns:
a DeploymentSynchronizer instance

getSynchronizer

public DeploymentSynchronizer getSynchronizer(String filePath)

getSynchronizer

public DeploymentSynchronizer getSynchronizer(int tenantId)

getSynchronizers

public Map<String,DeploymentSynchronizer> getSynchronizers()

deleteSynchronizer

public DeploymentSynchronizer deleteSynchronizer(String filePath)
Deletes the DeploymentSynchronizer for the specified file path. This will simply remove the repository from the control of the DeploymentSynchronizationManager. Any tasks spawned by the synchronizer will continue to run until the synchronizer is properly stopped.

Parameters:
filePath - File path on which the repository is created
Returns:
A RegistryBasedRepository or null

deleteSynchronizer

public DeploymentSynchronizer deleteSynchronizer(int tenantId)


Copyright © 2015 WSO2. All rights reserved.