org.jboss.system.server.profileservice.repository.clustered
Class ClusteredDeploymentRepository

java.lang.Object
  extended by org.jboss.system.server.profileservice.repository.AbstractVFSProfileSource
      extended by org.jboss.system.server.profileservice.repository.AbstractDeploymentRepository
          extended by org.jboss.system.server.profileservice.repository.BasicDeploymentRepository
              extended by org.jboss.system.server.profileservice.repository.HotDeploymentRepository
                  extended by org.jboss.system.server.profileservice.repository.clustered.ClusteredDeploymentRepository
All Implemented Interfaces:
org.jboss.profileservice.spi.DeploymentRepository
Direct Known Subclasses:
ImmutableClusteredDeploymentRepository

public class ClusteredDeploymentRepository
extends HotDeploymentRepository

DeploymentRepository that keeps its contents in sync across a cluster.

Version:
$Revision: $
Author:
Brian Stansberry

Field Summary
 
Fields inherited from class org.jboss.system.server.profileservice.repository.AbstractDeploymentRepository
ignoreFlags
 
Fields inherited from class org.jboss.system.server.profileservice.repository.AbstractVFSProfileSource
log, uris
 
Constructor Summary
ClusteredDeploymentRepository(org.jboss.profileservice.spi.ProfileKey key, URI[] uris, Map<org.jboss.profileservice.spi.ProfileKey,RepositoryClusteringHandler> clusteringHandlers, Set<LocalContentManagerFactory<?>> persisterFactories)
          Create a new ClusteredDeploymentRepository.
 
Method Summary
 String addDeploymentContent(String vfsPath, InputStream contentIS, org.jboss.profileservice.spi.DeploymentOption... options)
           
 void create()
          Extends superclass to check whether our configured URIs actually exist, if so validating that a clustering handler has been injected, throwing an IllegalStateException if not.
 RepositoryClusteringHandler getClusteringHandler()
           
 Collection<org.jboss.profileservice.spi.ModificationInfo> getModifiedDeployments()
           
 String getPartitionName()
           
 void load()
           
 boolean registerClusteringHandler(RepositoryClusteringHandler handler)
           
 void remove()
           
 org.jboss.profileservice.spi.ProfileDeployment removeDeployment(String vfsPath)
          Remove a deployment from this source.
 void unload()
           
 boolean unregisterClusteringHandler(RepositoryClusteringHandler handler)
           
 
Methods inherited from class org.jboss.system.server.profileservice.repository.HotDeploymentRepository
applyAddedDeployments, checkForAdditions, cleanUpRoot, getChecker, setChecker
 
Methods inherited from class org.jboss.system.server.profileservice.repository.BasicDeploymentRepository
addDeployment, addDeploymentContent, getUploadUri, internalAddDeployment, isFailIfAlreadyExists, lockRead, lockWrite, removeDeployment, setFailIfAlreadyExists, setUploadUri, unlockRead, unlockWrite
 
Methods inherited from class org.jboss.system.server.profileservice.repository.AbstractDeploymentRepository
acceptsDeployment, clearDeploymentContentFlags, getDeployment, getDeploymentContent, getDeploymentContentFlags, getProfileKey, getRepositoryNames, hasDeploymentContentFlags, lockDeploymentContent, setDeploymentContentFlags, unlockDeploymentContent
 
Methods inherited from class org.jboss.system.server.profileservice.repository.AbstractVFSProfileSource
addedDeployment, addedDeployments, addVirtualFileCache, createDeployment, destroy, findDeploymentContent, getCachedVirtualFile, getCachedVirtualFile, getDeploymentFilter, getDeploymentNames, getDeployments, getLastModified, getRepositoryURIs, isRecursiveScan, loadApplications, setDeploymentFilter, setRecursiveScan, updateLastModfied
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.profileservice.spi.DeploymentRepository
getDeploymentNames, getDeployments, getLastModified, getRepositoryURIs
 

Constructor Detail

ClusteredDeploymentRepository

public ClusteredDeploymentRepository(org.jboss.profileservice.spi.ProfileKey key,
                                     URI[] uris,
                                     Map<org.jboss.profileservice.spi.ProfileKey,RepositoryClusteringHandler> clusteringHandlers,
                                     Set<LocalContentManagerFactory<?>> persisterFactories)
                              throws IOException
Create a new ClusteredDeploymentRepository.

Parameters:
key -
uris -
Throws:
IOException
Method Detail

getPartitionName

public String getPartitionName()

getClusteringHandler

public RepositoryClusteringHandler getClusteringHandler()

registerClusteringHandler

public boolean registerClusteringHandler(RepositoryClusteringHandler handler)

unregisterClusteringHandler

public boolean unregisterClusteringHandler(RepositoryClusteringHandler handler)

create

public void create()
            throws Exception
Extends superclass to check whether our configured URIs actually exist, if so validating that a clustering handler has been injected, throwing an IllegalStateException if not. This allows this repository to function as an empty repository in a non-clustered server that doesn't have a RepositoryClusteringHandler, so long as the configured URIs don't actually exist (e.g. AS "default" config w/o a "farm/" dir). If the configured URIs *do* exist, that implies this repository is meant to work, and a missing clustering handler dependency is an exception condition.

Specified by:
create in interface org.jboss.profileservice.spi.DeploymentRepository
Overrides:
create in class AbstractDeploymentRepository
Throws:
Exception

load

public void load()
          throws Exception
Specified by:
load in interface org.jboss.profileservice.spi.DeploymentRepository
Overrides:
load in class BasicDeploymentRepository
Throws:
Exception

addDeploymentContent

public String addDeploymentContent(String vfsPath,
                                   InputStream contentIS,
                                   org.jboss.profileservice.spi.DeploymentOption... options)
                            throws IOException
Specified by:
addDeploymentContent in interface org.jboss.profileservice.spi.DeploymentRepository
Overrides:
addDeploymentContent in class BasicDeploymentRepository
Throws:
IOException

removeDeployment

public org.jboss.profileservice.spi.ProfileDeployment removeDeployment(String vfsPath)
                                                                throws Exception
Description copied from class: AbstractVFSProfileSource
Remove a deployment from this source.

Specified by:
removeDeployment in interface org.jboss.profileservice.spi.DeploymentRepository
Overrides:
removeDeployment in class BasicDeploymentRepository
Parameters:
vfsPath - the deployment name
Returns:
the deployment
Throws:
Exception

getModifiedDeployments

public Collection<org.jboss.profileservice.spi.ModificationInfo> getModifiedDeployments()
                                                                                 throws Exception
Specified by:
getModifiedDeployments in interface org.jboss.profileservice.spi.DeploymentRepository
Overrides:
getModifiedDeployments in class HotDeploymentRepository
Throws:
Exception

unload

public void unload()
Specified by:
unload in interface org.jboss.profileservice.spi.DeploymentRepository
Overrides:
unload in class AbstractDeploymentRepository

remove

public void remove()
            throws Exception
Specified by:
remove in interface org.jboss.profileservice.spi.DeploymentRepository
Overrides:
remove in class BasicDeploymentRepository
Throws:
Exception


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.