[jboss-cvs] JBossAS SVN: r99077 - trunk/system/src/main/java/org/jboss/system/server/profileservice/repository/clustered.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 6 16:03:21 EST 2010


Author: bstansberry at jboss.com
Date: 2010-01-06 16:03:21 -0500 (Wed, 06 Jan 2010)
New Revision: 99077

Modified:
   trunk/system/src/main/java/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java
Log:
Prune commented out code

Modified: trunk/system/src/main/java/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java
===================================================================
--- trunk/system/src/main/java/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java	2010-01-06 20:17:10 UTC (rev 99076)
+++ trunk/system/src/main/java/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java	2010-01-06 21:03:21 UTC (rev 99077)
@@ -63,10 +63,6 @@
    
    /** Handles interaction with the cluster */
    private RepositoryClusteringHandler clusteringHandler;
-   /** Handles storing our RepositoryContentMetadata */
-//   private final ContentMetadataPersister persister;
-   /** Our current view of our content */
-//   private RepositoryContentMetadata contentMetadata;
    /** URIs of the VFS roots we monitor, keyed by their name */
    private final Map<String, URI> namedURIMap;
    
@@ -74,7 +70,6 @@
    private final Set<LocalContentManagerFactory<?>> localContentManagerFactories ;
    private LocalContentManager<?> localContentManager;
    
-//   private final Map<Object, OutputStream> tempStreamMap = new ConcurrentHashMap<Object, OutputStream>();
    /** 
     * Whether we are loaded. Mutations of this field must occur with
     * at least a local lock.
@@ -270,7 +265,6 @@
          // Revert back to unloaded status
          this.loadStatus = LoadStatus.UNLOADED;
          
-//         this.contentMetadata = null;
          if (t instanceof Exception)
          {
             throw (Exception) t;
@@ -459,7 +453,6 @@
                log.warn("remove(): failed to acquire local lock");
             }
             this.loadStatus = LoadStatus.UNLOADED;
-//            this.contentMetadata = null;
                         
             super.unload();
             
@@ -490,239 +483,7 @@
       this.created = false;     
    }
 
-   // --------------------------------------  Legacy RepositoryContentPersister
-
-   
-//   public TemporaryOutputStreamHandback getTemporaryOutputStream() throws IOException
-//   {
-//      if (this.loadStatus != LoadStatus.UNLOADED)
-//      {
-//         File tmp = createTempFile();
-//         tmp.deleteOnExit();
-//         OutputStream os = new FileOutputStream(tmp);
-//         this.tempStreamMap.put(tmp, os);
-//         return new TemporaryOutputStreamHandback(tmp, os);
-//      }
-//      else
-//      {
-//         // We don't accept changes from the cluster when we are unloaded.
-//         // Satisfy the contract with an object that does nothing
-//         return new TemporaryOutputStreamHandback(LoadStatus.UNLOADED, new NullOutputStream());
-//      }
-//   }
-//   
-//   public void destroyTemporaryOutputStream(TemporaryOutputStreamHandback handback)
-//   {
-//      if (handback == null)
-//      {
-//         throw new IllegalArgumentException("handback is null");
-//      }
-//      
-//      FileUtil.safeCloseStream(handback.getOutputStream(), handback.getHandback());
-//
-//      Object key = handback.getHandback();
-//      if (key instanceof File)
-//      {
-//         try
-//         {
-//            ((File) key).delete();
-//         }
-//         catch (Exception e)
-//         {
-//            log.trace("Failed to delete temporary file " + key, e);
-//         }
-//      }
-//   }
-//
-//   public void installRepositoryContentItem(TemporaryOutputStreamHandback handback, 
-//         String repositoryRoot, List<String> path, long timestamp) throws IOException
-//   {
-//      if (handback == null)
-//      {
-//         throw new IllegalArgumentException("handback is null");
-//      }
-//      
-//      Object key = handback.getHandback();
-//      File tmpFile = null;
-//      if (key instanceof File)
-//      {
-//         tmpFile = (File) key;
-//      }
-//      else if (key == LoadStatus.UNLOADED)
-//      {
-//         // We weren't ready to deal with this request so we returned
-//         // a fake. Ignore this call.
-//         log.trace("Current status is " + LoadStatus.UNLOADED + " so ignoring" +
-//                   " request to add/update " + path + " in " + repositoryRoot);
-//         return;
-//      }
-//      else
-//      {
-//         throw new IllegalArgumentException("Unknown handback type " + handback);
-//      }
-//      
-//      OutputStream ourOS = tempStreamMap.remove(key);
-//      if (ourOS == null)
-//      {
-//         // Tilt! But to be tidy close the stream
-//         FileUtil.safeCloseStream(handback.getOutputStream(), key);
-//         throw new IllegalStateException("Unknown handback " + key);
-//      }
-//      
-//      try
-//      { 
-//         FileUtil.safeCloseStream(ourOS, key);
-//         
-//         URI rootURI = namedURIMap.get(repositoryRoot);
-//         if (rootURI == null)
-//         {
-//            throw new IllegalArgumentException("Unknown root " + repositoryRoot);
-//         }
-//         
-//         File toReplace = new File(rootURI);
-//         for (String element : path)
-//         {
-//            toReplace = new File(toReplace, element);
-//         }
-//         if (toReplace.exists())
-//         {
-//            toReplace.delete();
-//         }
-//         
-//         FileUtil.localMove(tmpFile, toReplace );
-//         toReplace.setLastModified(timestamp);
-//         
-//         RepositoryItemMetadata itemMD = new RepositoryItemMetadata();
-//         itemMD.setRelativePathElements(path);
-//         itemMD.setTimestamp(timestamp);
-//         
-//         RepositoryRootMetadata rootMD = contentMetadata.getRepositoryRootMetadata(repositoryRoot);
-//         rootMD.addItemMetadata(itemMD);
-//         
-//         try
-//         {
-//            this.persister.store(getPartitionName(), this.contentMetadata);
-//         }
-//         catch (Exception e)
-//         {
-//            log.error("Exception peristent contentMetadata", e);
-//         }         
-//      }
-//      finally
-//      {
-//         if (tmpFile.exists())
-//         {
-//            if(!tmpFile.delete())
-//            {
-//               log.info("Could not delete file "+ tmpFile);
-//            }
-//         }
-//      }
-//      
-//   }
-//
-//   public void removeRepositoryContentItem(String repositoryRoot, List<String> path)
-//   {
-//      if (this.loadStatus == LoadStatus.UNLOADED)
-//      {
-//         // We don't accept changes from the cluster when we aren't loaded
-//         log.trace("Current status is " + LoadStatus.UNLOADED + " so ignoring" +
-//               " request to remove " + path + " from " + repositoryRoot);
-//         return;
-//      }
-//      
-//      URI rootURI = namedURIMap.get(repositoryRoot);
-//      if (rootURI == null)
-//      {
-//         throw new IllegalArgumentException("Unknown root " + repositoryRoot);
-//      }
-//      
-//      File file = new File(rootURI);
-//      for (String element : path)
-//      {
-//         file = new File(file, element);
-//      }
-//      if (file.exists())
-//      {
-//         file.delete();
-//      }
-//      
-//      RepositoryRootMetadata rootMD = contentMetadata.getRepositoryRootMetadata(repositoryRoot);
-//      if (rootMD != null)
-//      {
-//         if (rootMD.removeItemMetadata(path))
-//         {
-//            try
-//            {
-//               this.persister.store(getPartitionName(), this.contentMetadata);
-//            }
-//            catch (Exception e)
-//            {
-//               log.error("Exception peristing contentMetadata", e);
-//            }
-//         }
-//      }
-//   }
-
    // ----------------------------------------------------------------- Private
-   
-   // BES -- retained for now in case I decide to scope the RepositoryClusteringHandler
-   // to a partition rather than to a ProfileKey
-   
-//   private boolean coordinateClusteringHandler(RepositoryClusteringHandler handler, 
-//                                               String partitionName)
-//   {
-//      boolean updated = false;
-//      
-//      if (this.clusteringHandler != null)
-//      {
-//         // We've had a handler injected, so this must be setting the 
-//         // partition name property. Check for consistency.
-//         if (getPartitionName().equals(partitionName) == false)
-//         {
-//            throw new IllegalStateException("Cannot set partition name to " + 
-//                  partitionName + " it is already set to " + getPartitionName());
-//         }
-//         
-//         if (this.clusteringHandler != handler)
-//         {
-//            log.debug("Updating handler for partition " + partitionName);
-//            this.clusteringHandler = handler;
-//            updated = true;
-//         }
-//      }
-//      else if (handler == null)
-//      {
-//         // No handler set and none passed in. Must be a call to set partitionName.
-//         // Use a null-safe equals check to see if it's an update.
-//         boolean same = (partitionName == this.partitionName 
-//               || (partitionName != null && partitionName.equals(this.partitionName)));
-//         if (!same)
-//         {
-//            this.partitionName = partitionName;
-//            updated = true;
-//         }
-//      }
-//      else
-//      {
-//         // It's an attempt to inject a handler. See if it matches our
-//         // required partition name
-//         String handlerPartition = handler.getPartitionName();
-//         if (this.partitionName == null || this.partitionName.equals(handlerPartition))
-//         {
-//            this.clusteringHandler = handler;
-//            updated = true;
-//         }
-//         else
-//         {
-//            log.debug("Ignoring injected handler for partition " + 
-//                  handlerPartition + "as we are configured for partition " + 
-//                  this.partitionName);
-//         }
-//      }
-//      
-//      return updated;      
-//   }
 
    private static URI[] validateURIs(URI[] uris, ProfileKey profileKey)
    {




More information about the jboss-cvs-commits mailing list