org.jboss.system.server.profileservice.repository
Class BasicDeploymentRepository

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
All Implemented Interfaces:
org.jboss.profileservice.spi.DeploymentRepository
Direct Known Subclasses:
HotDeploymentRepository

public class BasicDeploymentRepository
extends AbstractDeploymentRepository

A basic deployment repository.

Version:
$Revision: 89042 $
Author:
Emanuel Muckenhuber

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
BasicDeploymentRepository(org.jboss.profileservice.spi.ProfileKey key, URI[] uris)
           
 
Method Summary
 void addDeployment(String vfsPath, org.jboss.profileservice.spi.ProfileDeployment d)
          Add a deployment to this profile source.
 String addDeploymentContent(String vfsPath, InputStream contentIS)
           
 String addDeploymentContent(String vfsPath, InputStream contentIS, org.jboss.profileservice.spi.DeploymentOption... options)
           
protected  void cleanUpRoot(org.jboss.virtual.VirtualFile vf)
          A way for the hot-deployment repository to cleanup the root (modification checker).
 Collection<org.jboss.profileservice.spi.ModificationInfo> getModifiedDeployments()
           
 URI getUploadUri()
           
protected  void internalAddDeployment(String vfsPath, org.jboss.profileservice.spi.ProfileDeployment deployment)
          Internal add the deployment, without locking the repository.
 boolean isFailIfAlreadyExists()
           
 void load()
           
protected  void lockRead()
          Lock for read
protected  void lockWrite()
          Lock for write
 void remove()
           
 org.jboss.profileservice.spi.ProfileDeployment removeDeployment(String vfsPath)
          Remove a deployment from this source.
protected  org.jboss.profileservice.spi.ProfileDeployment removeDeployment(String vfsPath, boolean deleteFile)
          Remove deployment.
 void setFailIfAlreadyExists(boolean failIfAlreadyExists)
           
 void setUploadUri(URI uploadUri)
           
protected  void unlockRead()
          Unlock for read
protected  void unlockWrite()
          Unlock for write
 
Methods inherited from class org.jboss.system.server.profileservice.repository.AbstractDeploymentRepository
acceptsDeployment, clearDeploymentContentFlags, create, getDeployment, getDeploymentContent, getDeploymentContentFlags, getProfileKey, getRepositoryNames, hasDeploymentContentFlags, lockDeploymentContent, setDeploymentContentFlags, unload, 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

BasicDeploymentRepository

public BasicDeploymentRepository(org.jboss.profileservice.spi.ProfileKey key,
                                 URI[] uris)
Method Detail

isFailIfAlreadyExists

public boolean isFailIfAlreadyExists()

setFailIfAlreadyExists

public void setFailIfAlreadyExists(boolean failIfAlreadyExists)

getUploadUri

public URI getUploadUri()

setUploadUri

public void setUploadUri(URI uploadUri)

load

public void load()
          throws Exception
Throws:
Exception

addDeployment

public void addDeployment(String vfsPath,
                          org.jboss.profileservice.spi.ProfileDeployment d)
                   throws Exception
Description copied from class: AbstractVFSProfileSource
Add a deployment to this profile source.

Specified by:
addDeployment in interface org.jboss.profileservice.spi.DeploymentRepository
Overrides:
addDeployment in class AbstractVFSProfileSource
Parameters:
vfsPath - the deployment name
d - the deployment
Throws:
Exception

getModifiedDeployments

public Collection<org.jboss.profileservice.spi.ModificationInfo> getModifiedDeployments()
                                                                                 throws Exception
Throws:
Exception

addDeploymentContent

public String addDeploymentContent(String vfsPath,
                                   InputStream contentIS)
                            throws IOException
Throws:
IOException

addDeploymentContent

public String addDeploymentContent(String vfsPath,
                                   InputStream contentIS,
                                   org.jboss.profileservice.spi.DeploymentOption... options)
                            throws IOException
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 AbstractDeploymentRepository
Parameters:
vfsPath - the deployment name
Returns:
the deployment
Throws:
Exception

internalAddDeployment

protected void internalAddDeployment(String vfsPath,
                                     org.jboss.profileservice.spi.ProfileDeployment deployment)
                              throws Exception
Internal add the deployment, without locking the repository.

Parameters:
vfsPath - - the name of the deployment
deployment - - the deployment
Throws:
Exception

removeDeployment

protected org.jboss.profileservice.spi.ProfileDeployment removeDeployment(String vfsPath,
                                                                          boolean deleteFile)
                                                                   throws Exception
Remove deployment.

Parameters:
vfsPath - the vfs path
deleteFile - do we delete the file
Returns:
found profile deployment
Throws:
Exception - for any error

cleanUpRoot

protected void cleanUpRoot(org.jboss.virtual.VirtualFile vf)
A way for the hot-deployment repository to cleanup the root (modification checker).

Parameters:
vf - the deployment root

remove

public void remove()
            throws Exception
Throws:
Exception

lockRead

protected void lockRead()
Lock for read


unlockRead

protected void unlockRead()
Unlock for read


lockWrite

protected void lockWrite()
Lock for write


unlockWrite

protected void unlockWrite()
Unlock for write



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