org.jboss.profileservice.cluster.repository
Class DefaultRepositoryClusteringHandler

java.lang.Object
  extended by org.jboss.profileservice.cluster.repository.DefaultRepositoryClusteringHandler
All Implemented Interfaces:
org.jboss.kernel.spi.dependency.KernelControllerContextAware, RepositoryClusteringHandler

public class DefaultRepositoryClusteringHandler
extends Object
implements RepositoryClusteringHandler, org.jboss.kernel.spi.dependency.KernelControllerContextAware

RepositoryClusteringHandler implementation that uses HAPartition.

Version:
$Revision: $
Author:
Brian Stansberry

Nested Class Summary
 class DefaultRepositoryClusteringHandler.DRMListener
           
 class DefaultRepositoryClusteringHandler.RpcTarget
           
 
Field Summary
static long DEFAULT_TIMEOUT
           
 
Constructor Summary
DefaultRepositoryClusteringHandler()
           
 
Method Summary
 RepositoryItemMetadata addDeploymentContent(String vfsPath, InputStream contentIS)
           
protected  DefaultRepositoryClusteringHandler.DRMListener getDRMListener()
          For benefit of unit tests, exposes the object we register with the DRM as a DistributedReplicantManager.ReplicantListener.
 String getLocalNodeName()
           
 long getLockTimeout()
           
 long getMethodCallTimeout()
           
 org.jboss.ha.framework.interfaces.HAPartition getPartition()
           
 String getPartitionName()
           
 String getProfileDomain()
           
 org.jboss.profileservice.spi.ProfileKey getProfileKey()
           
 String getProfileName()
           
 String getProfileServer()
           
protected  DefaultRepositoryClusteringHandler.RpcTarget getRpcTarget()
          For benefit of unit tests, exposes the object we register with the HAPartition.
 String getServiceHAName()
          Gets the name under which we register ourself with the HAPartition.
 SynchronizationPolicy getSynchronizationPolicy()
           
 void initialize(LocalContentManager<?> persister)
           
 boolean isImmutable()
           
 boolean lockGlobally()
           
 boolean lockLocally()
           
 void removeDeploymentContent(org.jboss.virtual.VirtualFile vf)
           
 void setImmutable(boolean immutable)
           
 void setKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext context)
          Registers the context name as the serviceHAName if it is not already set.
 void setLockTimeout(long lockTimeout)
           
 void setMethodCallTimeout(long methodCallTimeout)
           
 void setPartition(org.jboss.ha.framework.interfaces.HAPartition partition)
           
 void setProfileDomain(String profileDomain)
           
 void setProfileName(String profileName)
           
 void setProfileServer(String profileServer)
           
 void setServiceHAName(String serviceHAName)
          Sets the name under which we register ourself with the HAPartition.
 void setSynchronizationPolicy(SynchronizationPolicy synchronizationPolicy)
           
 void shutdown()
           
 RepositoryContentMetadata synchronizeContent(boolean pullFromCluster)
           
 void unlockGlobally()
           
 void unlockLocally()
           
 void unsetKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext context)
          This implementation is a no-op.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT

public static final long DEFAULT_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

DefaultRepositoryClusteringHandler

public DefaultRepositoryClusteringHandler()
Method Detail

getPartition

public org.jboss.ha.framework.interfaces.HAPartition getPartition()

setPartition

public void setPartition(org.jboss.ha.framework.interfaces.HAPartition partition)

getProfileDomain

public String getProfileDomain()

setProfileDomain

public void setProfileDomain(String profileDomain)

getProfileServer

public String getProfileServer()

setProfileServer

public void setProfileServer(String profileServer)

getProfileName

public String getProfileName()

setProfileName

public void setProfileName(String profileName)

getServiceHAName

public String getServiceHAName()
Gets the name under which we register ourself with the HAPartition.

Returns:
the name

setServiceHAName

public void setServiceHAName(String serviceHAName)
Sets the name under which we register ourself with the HAPartition.

Parameters:
serviceHAName - the name

getSynchronizationPolicy

public SynchronizationPolicy getSynchronizationPolicy()

setSynchronizationPolicy

public void setSynchronizationPolicy(SynchronizationPolicy synchronizationPolicy)

isImmutable

public boolean isImmutable()
Specified by:
isImmutable in interface RepositoryClusteringHandler

setImmutable

public void setImmutable(boolean immutable)
Specified by:
setImmutable in interface RepositoryClusteringHandler

getLockTimeout

public long getLockTimeout()

setLockTimeout

public void setLockTimeout(long lockTimeout)

getMethodCallTimeout

public long getMethodCallTimeout()

setMethodCallTimeout

public void setMethodCallTimeout(long methodCallTimeout)

initialize

public void initialize(LocalContentManager<?> persister)
                throws Exception
Specified by:
initialize in interface RepositoryClusteringHandler
Throws:
Exception

shutdown

public void shutdown()
              throws Exception
Specified by:
shutdown in interface RepositoryClusteringHandler
Throws:
Exception

getPartitionName

public String getPartitionName()
Specified by:
getPartitionName in interface RepositoryClusteringHandler

getLocalNodeName

public String getLocalNodeName()
Specified by:
getLocalNodeName in interface RepositoryClusteringHandler

getProfileKey

public org.jboss.profileservice.spi.ProfileKey getProfileKey()
Specified by:
getProfileKey in interface RepositoryClusteringHandler

synchronizeContent

public RepositoryContentMetadata synchronizeContent(boolean pullFromCluster)
                                             throws InconsistentRepositoryStructureException,
                                                    IOException
Specified by:
synchronizeContent in interface RepositoryClusteringHandler
Throws:
InconsistentRepositoryStructureException
IOException

addDeploymentContent

public RepositoryItemMetadata addDeploymentContent(String vfsPath,
                                                   InputStream contentIS)
                                            throws IOException
Specified by:
addDeploymentContent in interface RepositoryClusteringHandler
Throws:
IOException

removeDeploymentContent

public void removeDeploymentContent(org.jboss.virtual.VirtualFile vf)
                             throws Exception
Specified by:
removeDeploymentContent in interface RepositoryClusteringHandler
Throws:
Exception

lockGlobally

public boolean lockGlobally()
Specified by:
lockGlobally in interface RepositoryClusteringHandler

lockLocally

public boolean lockLocally()
Specified by:
lockLocally in interface RepositoryClusteringHandler

unlockGlobally

public void unlockGlobally()
Specified by:
unlockGlobally in interface RepositoryClusteringHandler

unlockLocally

public void unlockLocally()
Specified by:
unlockLocally in interface RepositoryClusteringHandler

setKernelControllerContext

public void setKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext context)
                                throws Exception
Registers the context name as the serviceHAName if it is not already set.

Specified by:
setKernelControllerContext in interface org.jboss.kernel.spi.dependency.KernelControllerContextAware
Throws:
Exception

unsetKernelControllerContext

public void unsetKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext context)
                                  throws Exception
This implementation is a no-op.

Specified by:
unsetKernelControllerContext in interface org.jboss.kernel.spi.dependency.KernelControllerContextAware
Throws:
Exception

getRpcTarget

protected DefaultRepositoryClusteringHandler.RpcTarget getRpcTarget()
For benefit of unit tests, exposes the object we register with the HAPartition. Not intended for use outside of unit tests. TODO see if we can eliminate this by having the unit tests capture the object registered with the HAPartition.


getDRMListener

protected DefaultRepositoryClusteringHandler.DRMListener getDRMListener()
For benefit of unit tests, exposes the object we register with the DRM as a DistributedReplicantManager.ReplicantListener. Not intended for use outside of unit tests. TODO see if we can eliminate this by having the unit tests capture the object registered with the DRM.



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