[dna-commits] DNA SVN: r496 - in trunk: dna-repository/src/main/java/org/jboss/dna/repository and 10 other directories.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Thu Sep 4 10:34:21 EDT 2008


Author: rhauch
Date: 2008-09-04 10:34:21 -0400 (Thu, 04 Sep 2008)
New Revision: 496

Modified:
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrRepository.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSession.java
   trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositorySourceManager.java
   trunk/dna-repository/src/test/java/org/jboss/dna/repository/RepositoryServiceTest.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnection.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnectionFactory.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnectionPool.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositorySource.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/AbstractCommandExecutor.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/CommandExecutor.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/DelegatingCommandExecutor.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/LoggingCommandExecutor.java
   trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/RepositoryConnectionPoolTest.java
   trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/RepositorySourceLoadHarness.java
   trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/SimpleRepositorySource.java
   trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/TimeDelayingRepositorySource.java
   trunk/dna-spi/src/test/java/org/jboss/dna/spi/graph/commands/executor/AbstractCommandExecutorTest.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositoryConnection.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositorySource.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederationI18n.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutor.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/SingleProjectionCommandExecutor.java
   trunk/extensions/dna-connector-federation/src/main/resources/org/jboss/dna/connector/federation/FederationI18n.properties
   trunk/extensions/dna-connector-inmemory/src/main/java/org/jboss/dna/connector/inmemory/InMemoryRepositoryConnection.java
   trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheConnection.java
Log:
DNA-217 - Connector SPI should have protocol for cancelling operations
http://jira.jboss.com/jira/browse/DNA-217

Removed the use of the InterruptedException from most of the connector SPI methods.  (It is still used on "ping(), since that's more akin to other interruptable methods).

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrRepository.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrRepository.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrRepository.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -252,11 +252,7 @@
         // Ensure valid workspace name
         if (workspaceName == null) workspaceName = JcrI18n.defaultWorkspaceName.text();
         // Create session
-        try {
-            return new JcrSession(this, execContext, workspaceName, connectionFactory.createConnection(workspaceName),
-                                  new WeakHashMap<UUID, WeakReference<Node>>());
-        } catch (InterruptedException error) {
-            throw new RepositoryException(error);
-        }
+        return new JcrSession(this, execContext, workspaceName, connectionFactory.createConnection(workspaceName),
+                              new WeakHashMap<UUID, WeakReference<Node>>());
     }
 }

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSession.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSession.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSession.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -425,9 +425,6 @@
             assert executionContext.getLoginContext() != null;
             executionContext.getLoginContext().logout();
             isLive = false;
-        } catch (InterruptedException error) {
-            // TODO: Change to DnaException once DNA-180 is addressed
-            throw new RuntimeException(error);
         } catch (LoginException error) {
         }
     }

Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositorySourceManager.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositorySourceManager.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositorySourceManager.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -368,7 +368,7 @@
      * 
      * @see org.jboss.dna.spi.connector.RepositoryConnectionFactory#createConnection(java.lang.String)
      */
-    public RepositoryConnection createConnection( String sourceName ) throws InterruptedException {
+    public RepositoryConnection createConnection( String sourceName ) {
         try {
             this.sourcesLock.readLock().lock();
             for (RepositoryConnectionPool existingPool : this.pools) {

Modified: trunk/dna-repository/src/test/java/org/jboss/dna/repository/RepositoryServiceTest.java
===================================================================
--- trunk/dna-repository/src/test/java/org/jboss/dna/repository/RepositoryServiceTest.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-repository/src/test/java/org/jboss/dna/repository/RepositoryServiceTest.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -159,12 +159,6 @@
         service.getAdministrator().start();
     }
 
-    @Test( expected = FederationException.class )
-    public void shouldFailToStartUpIfInterruptedWhileConnectingToConfigurationRepository() throws Exception {
-        stub(sources.createConnection(configSourceName)).toThrow(new InterruptedException());
-        service.getAdministrator().start();
-    }
-
     @Test
     public void shouldStartUpUsingConfigurationRepositoryThatContainsSomeSources() throws Exception {
         // Use a real source manager for this test ...

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnection.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnection.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnection.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -86,15 +86,12 @@
      * @param context the environment in which the commands are being executed; never null
      * @param commands the commands to be executed; never null
      * @throws RepositorySourceException if there is a problem loading the node data
-     * @throws InterruptedException if the thread has been interrupted during the operation
      */
     void execute( ExecutionContext context,
-                  GraphCommand... commands ) throws RepositorySourceException, InterruptedException;
+                  GraphCommand... commands ) throws RepositorySourceException;
 
     /**
      * Close this connection to signal that it is no longer needed and that any accumulated resources are to be released.
-     * 
-     * @throws InterruptedException if the thread has been interrupted while the close was in progress
      */
-    void close() throws InterruptedException;
+    void close();
 }

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnectionFactory.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnectionFactory.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnectionFactory.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -35,8 +35,7 @@
      * @param sourceName the name of the source from which a connection should be obtained
      * @return the source, or null if no such source could be found (or created)
      * @throws RepositorySourceException if there was an error obtaining the new connection
-     * @throws InterruptedException if the thread was interrupted during the operation
      */
-    RepositoryConnection createConnection( String sourceName ) throws RepositorySourceException, InterruptedException;
+    RepositoryConnection createConnection( String sourceName ) throws RepositorySourceException;
 
 }

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnectionPool.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnectionPool.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositoryConnectionPool.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -555,12 +555,8 @@
             // If there are connections being used, close them now ...
             if (!this.inUseConnections.isEmpty()) {
                 for (ConnectionWrapper connectionInUse : this.inUseConnections) {
-                    try {
-                        this.logger.trace("Closing repository connection to {0}", getSourceName());
-                        connectionInUse.getOriginal().close();
-                    } catch (InterruptedException e) {
-                        // Ignore this ...
-                    }
+                    this.logger.trace("Closing repository connection to {0}", getSourceName());
+                    connectionInUse.getOriginal().close();
                 }
                 this.poolSize -= this.inUseConnections.size();
                 // The last connection that is closed will transition the runState to TERMINATED ...
@@ -684,10 +680,9 @@
      * 
      * @return a connection
      * @throws RepositorySourceException if there is a problem obtaining a connection
-     * @throws InterruptedException if the thread is interrupted while attempting to get a connection
      * @throws IllegalStateException if the factory is not in a state to create or return connections
      */
-    public RepositoryConnection getConnection() throws RepositorySourceException, InterruptedException {
+    public RepositoryConnection getConnection() throws RepositorySourceException {
         int attemptsAllowed = this.maxFailedAttemptsBeforeError.get();
         ConnectionWrapper connection = null;
         // Do this until we get a good connection ...
@@ -709,7 +704,13 @@
                 // Peek to see if there is a connection available ...
                 else if (this.availableConnections.peek() != null) {
                     // There is, so take it and return it ...
-                    connection = this.availableConnections.take();
+                    try {
+                        connection = this.availableConnections.take();
+                    } catch (InterruptedException e) {
+                        this.logger.trace("Cancelled obtaining a repository connection from pool {0}", getSourceName());
+                        Thread.interrupted();
+                        throw new RepositorySourceException(getSourceName(), e);
+                    }
                 }
                 // There is no connection available. If there are fewer total connections than the maximum size ...
                 else if (this.poolSize < this.maximumPoolSize) {
@@ -725,7 +726,13 @@
             if (connection == null) {
                 // There are not enough connections, so wait in line for the next available connection ...
                 this.logger.trace("Waiting for a repository connection from pool {0}", getSourceName());
-                connection = this.availableConnections.take();
+                try {
+                    connection = this.availableConnections.take();
+                } catch (InterruptedException e) {
+                    this.logger.trace("Cancelled obtaining a repository connection from pool {0}", getSourceName());
+                    Thread.interrupted();
+                    throw new RepositorySourceException(getSourceName(), e);
+                }
                 mainLock = this.mainLock;
                 mainLock.lock();
                 try {
@@ -738,7 +745,14 @@
                 this.logger.trace("Recieved a repository connection from pool {0}", getSourceName());
             }
             if (connection != null && this.validateConnectionBeforeUse.get()) {
-                connection = validateConnection(connection);
+                try {
+                    connection = validateConnection(connection);
+                } catch (InterruptedException e) {
+                    this.logger.trace("Cancelled validating a repository connection obtained from pool {0}", getSourceName());
+                    returnConnection(connection);
+                    Thread.interrupted();
+                    throw new RepositorySourceException(getSourceName(), e);
+                }
             }
         }
         if (connection == null) {
@@ -784,12 +798,7 @@
         }
         // Close the connection if we're supposed to (do it outside of the main lock)...
         if (wrapperToClose != null) {
-            try {
-                closeConnection(wrapper);
-            } catch (InterruptedException e) {
-                // catch this, as there's not much we can do and the caller doesn't care or know how to handle it
-                this.logger.trace(e, "Interrupted while closing a repository connection");
-            }
+            closeConnection(wrapper);
         }
     }
 
@@ -798,18 +807,15 @@
      * 
      * @param connection the connection to be validated; may not be null
      * @return the validated connection, or null if the connection did not validate and was removed from the pool
+     * @throws InterruptedException if the thread is interrupted while validating the connection
      */
-    protected ConnectionWrapper validateConnection( ConnectionWrapper connection ) {
+    protected ConnectionWrapper validateConnection( ConnectionWrapper connection ) throws InterruptedException {
         assert connection != null;
         ConnectionWrapper invalidConnection = null;
         try {
             if (!connection.ping(this.pingTimeout.get(), TimeUnit.NANOSECONDS)) {
                 invalidConnection = connection;
             }
-        } catch (InterruptedException e) {
-            // catch this, as there's not much we can do and the caller doesn't care or know how to handle it
-            this.logger.trace(e, "Interrupted while pinging a repository connection");
-            invalidConnection = connection;
         } finally {
             if (invalidConnection != null) {
                 connection = null;
@@ -827,10 +833,9 @@
      * 
      * @return the connection wrapper with a new connection
      * @throws RepositorySourceException if there was an error obtaining the new connection
-     * @throws InterruptedException if the thread was interrupted during the operation
      */
     @GuardedBy( "mainLock" )
-    protected ConnectionWrapper newWrappedConnection() throws RepositorySourceException, InterruptedException {
+    protected ConnectionWrapper newWrappedConnection() throws RepositorySourceException {
         RepositoryConnection connection = this.source.getConnection();
         ++this.poolSize;
         this.totalConnectionsCreated.incrementAndGet();
@@ -842,9 +847,8 @@
      * method does decrement the {@link #poolSize pool size}.
      * 
      * @param wrapper the wrapper for the connection to be closed
-     * @throws InterruptedException if the thread was interrupted during the operation
      */
-    protected void closeConnection( ConnectionWrapper wrapper ) throws InterruptedException {
+    protected void closeConnection( ConnectionWrapper wrapper ) {
         assert wrapper != null;
         RepositoryConnection original = wrapper.getOriginal();
         assert original != null;
@@ -881,12 +885,8 @@
         Collection<ConnectionWrapper> extraConnections = new LinkedList<ConnectionWrapper>();
         this.availableConnections.drainTo(extraConnections, count);
         for (ConnectionWrapper connection : extraConnections) {
-            try {
-                this.logger.trace("Closing repository connection to {0}", getSourceName());
-                connection.getOriginal().close();
-            } catch (InterruptedException e) {
-                // Ignore this ...
-            }
+            this.logger.trace("Closing repository connection to {0}", getSourceName());
+            connection.getOriginal().close();
         }
         int numClosed = extraConnections.size();
         this.poolSize -= numClosed;
@@ -895,7 +895,7 @@
     }
 
     @GuardedBy( "mainLock" )
-    protected boolean addConnectionIfUnderCorePoolSize() throws RepositorySourceException, InterruptedException {
+    protected boolean addConnectionIfUnderCorePoolSize() throws RepositorySourceException {
         // Add connection ...
         if (this.poolSize < this.corePoolSize) {
             this.availableConnections.offer(newWrappedConnection());
@@ -906,7 +906,7 @@
     }
 
     @GuardedBy( "mainLock" )
-    protected int addConnectionsIfUnderCorePoolSize() throws RepositorySourceException, InterruptedException {
+    protected int addConnectionsIfUnderCorePoolSize() throws RepositorySourceException {
         // Add connections ...
         int n = 0;
         while (this.poolSize < this.corePoolSize) {
@@ -978,7 +978,7 @@
          * {@inheritDoc}
          */
         public void execute( ExecutionContext context,
-                             GraphCommand... commands ) throws RepositorySourceException, InterruptedException {
+                             GraphCommand... commands ) throws RepositorySourceException {
             if (closed) throw new IllegalStateException(SpiI18n.closedConnectionMayNotBeUsed.text());
             this.original.execute(context, commands);
         }
@@ -995,7 +995,7 @@
         /**
          * {@inheritDoc}
          */
-        public void close() throws InterruptedException {
+        public void close() {
             if (!closed) {
                 this.lastUsed = System.currentTimeMillis();
                 this.original.close();

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositorySource.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositorySource.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/connector/RepositorySource.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -62,10 +62,9 @@
      * 
      * @return a connection
      * @throws RepositorySourceException if there is a problem obtaining a connection
-     * @throws InterruptedException if the thread is interrupted while attempting to get a connection
      * @throws IllegalStateException if the factory is not in a state to create or return connections
      */
-    RepositoryConnection getConnection() throws RepositorySourceException, InterruptedException;
+    RepositoryConnection getConnection() throws RepositorySourceException;
 
     /**
      * Get the maximum number of retries that may be performed on a given operation when using {@link #getConnection()

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/AbstractCommandExecutor.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/AbstractCommandExecutor.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/AbstractCommandExecutor.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -111,7 +111,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.GraphCommand)
      */
-    public void execute( GraphCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GraphCommand command ) throws RepositorySourceException {
         if (command == null) return;
         if (command instanceof CompositeCommand) {
             execute((CompositeCommand)command);
@@ -155,7 +155,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.CompositeCommand)
      */
-    public void execute( CompositeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CompositeCommand command ) throws RepositorySourceException {
         assert command != null;
         for (GraphCommand nestedCommand : command) {
             execute(nestedCommand);
@@ -172,7 +172,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetNodeCommand)
      */
-    public void execute( GetNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetNodeCommand command ) throws RepositorySourceException {
         execute((GetPropertiesCommand)command);
         execute((GetChildrenCommand)command);
     }
@@ -182,8 +182,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetPropertiesCommand)
      */
-    @SuppressWarnings( "unused" )
-    public void execute( GetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetPropertiesCommand command ) throws RepositorySourceException {
     }
 
     /**
@@ -191,8 +190,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetChildrenCommand)
      */
-    @SuppressWarnings( "unused" )
-    public void execute( GetChildrenCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetChildrenCommand command ) throws RepositorySourceException {
     }
 
     /**
@@ -200,8 +198,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.CreateNodeCommand)
      */
-    @SuppressWarnings( "unused" )
-    public void execute( CreateNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CreateNodeCommand command ) throws RepositorySourceException {
     }
 
     /**
@@ -209,8 +206,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.SetPropertiesCommand)
      */
-    @SuppressWarnings( "unused" )
-    public void execute( SetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( SetPropertiesCommand command ) throws RepositorySourceException {
     }
 
     /**
@@ -218,8 +214,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.CopyNodeCommand)
      */
-    @SuppressWarnings( "unused" )
-    public void execute( CopyNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CopyNodeCommand command ) throws RepositorySourceException {
     }
 
     /**
@@ -227,8 +222,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.CopyBranchCommand)
      */
-    @SuppressWarnings( "unused" )
-    public void execute( CopyBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CopyBranchCommand command ) throws RepositorySourceException {
     }
 
     /**
@@ -236,8 +230,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.DeleteBranchCommand)
      */
-    @SuppressWarnings( "unused" )
-    public void execute( DeleteBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( DeleteBranchCommand command ) throws RepositorySourceException {
     }
 
     /**
@@ -245,8 +238,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.MoveBranchCommand)
      */
-    @SuppressWarnings( "unused" )
-    public void execute( MoveBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( MoveBranchCommand command ) throws RepositorySourceException {
     }
 
     /**
@@ -254,8 +246,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.RecordBranchCommand)
      */
-    @SuppressWarnings( "unused" )
-    public void execute( RecordBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( RecordBranchCommand command ) throws RepositorySourceException {
     }
 
     /**
@@ -263,8 +254,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#close()
      */
-    @SuppressWarnings( "unused" )
-    public void close() throws InterruptedException {
+    public void close() {
     }
 
 }

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/CommandExecutor.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/CommandExecutor.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/CommandExecutor.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -46,9 +46,8 @@
      * 
      * @param command the command to be executed
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( GraphCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( GraphCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a composite command that contains other commands. This method should simply obtain and execute each of the nested
@@ -56,9 +55,8 @@
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( CompositeCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( CompositeCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to get the properties and children of a node. {@link GetNodeCommand} is a subtype of both
@@ -67,95 +65,83 @@
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( GetNodeCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( GetNodeCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to get the properties of a node.
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( GetPropertiesCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( GetPropertiesCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to get the children of a node.
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( GetChildrenCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( GetChildrenCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to create a node and set the node's properties.
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( CreateNodeCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( CreateNodeCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to set some (or all) of the properties on a node.
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( SetPropertiesCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( SetPropertiesCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to copy a node to a new location.
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( CopyNodeCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( CopyNodeCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to copy an entire branch to a new location.
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( CopyBranchCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( CopyBranchCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to record the structure of a branch.
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( RecordBranchCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( RecordBranchCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to delete an entire branch.
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( DeleteBranchCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( DeleteBranchCommand command ) throws RepositorySourceException;
 
     /**
      * Execute a command to move a branch from one location to another.
      * 
      * @param command the command to be executed; may not be null
      * @throws RepositorySourceException if there is an error executing the command
-     * @throws InterruptedException if the thread is interrupted during execution
      */
-    void execute( MoveBranchCommand command ) throws RepositorySourceException, InterruptedException;
+    void execute( MoveBranchCommand command ) throws RepositorySourceException;
 
     /**
      * Close this executor, allowing it to clean up any open resources.
-     * 
-     * @throws InterruptedException if the thread is interrupted while the connection is being closed
      */
-    void close() throws InterruptedException;
+    void close();
 }

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/DelegatingCommandExecutor.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/DelegatingCommandExecutor.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/DelegatingCommandExecutor.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -52,7 +52,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#close()
      */
-    public void close() throws InterruptedException {
+    public void close() {
         delegate.close();
     }
 
@@ -61,7 +61,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.GraphCommand)
      */
-    public void execute( GraphCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GraphCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -70,7 +70,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.CompositeCommand)
      */
-    public void execute( CompositeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CompositeCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -79,7 +79,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetNodeCommand)
      */
-    public void execute( GetNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetNodeCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -88,7 +88,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetPropertiesCommand)
      */
-    public void execute( GetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetPropertiesCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -97,7 +97,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetChildrenCommand)
      */
-    public void execute( GetChildrenCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetChildrenCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -106,7 +106,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.CreateNodeCommand)
      */
-    public void execute( CreateNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CreateNodeCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -115,7 +115,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.SetPropertiesCommand)
      */
-    public void execute( SetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( SetPropertiesCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -124,7 +124,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.CopyNodeCommand)
      */
-    public void execute( CopyNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CopyNodeCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -133,7 +133,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.CopyBranchCommand)
      */
-    public void execute( CopyBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CopyBranchCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -142,7 +142,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.RecordBranchCommand)
      */
-    public void execute( RecordBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( RecordBranchCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -151,7 +151,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.DeleteBranchCommand)
      */
-    public void execute( DeleteBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( DeleteBranchCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 
@@ -160,7 +160,7 @@
      * 
      * @see org.jboss.dna.spi.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.spi.graph.commands.MoveBranchCommand)
      */
-    public void execute( MoveBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( MoveBranchCommand command ) throws RepositorySourceException {
         delegate.execute(command);
     }
 

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/LoggingCommandExecutor.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/LoggingCommandExecutor.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/executor/LoggingCommandExecutor.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -80,7 +80,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#close()
      */
     @Override
-    public void close() throws InterruptedException {
+    public void close() {
         this.logger.log(level, SpiI18n.closingCommandExecutor);
         super.close();
         this.logger.log(level, SpiI18n.closedCommandExecutor);
@@ -92,7 +92,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.CompositeCommand)
      */
     @Override
-    public void execute( CompositeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CompositeCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -104,7 +104,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.CopyBranchCommand)
      */
     @Override
-    public void execute( CopyBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CopyBranchCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -116,7 +116,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.CopyNodeCommand)
      */
     @Override
-    public void execute( CopyNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CopyNodeCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -128,7 +128,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.CreateNodeCommand)
      */
     @Override
-    public void execute( CreateNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CreateNodeCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -140,7 +140,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.DeleteBranchCommand)
      */
     @Override
-    public void execute( DeleteBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( DeleteBranchCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -152,7 +152,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetChildrenCommand)
      */
     @Override
-    public void execute( GetChildrenCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetChildrenCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -164,7 +164,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetNodeCommand)
      */
     @Override
-    public void execute( GetNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetNodeCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -176,7 +176,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetPropertiesCommand)
      */
     @Override
-    public void execute( GetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetPropertiesCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -188,7 +188,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GraphCommand)
      */
     @Override
-    public void execute( GraphCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GraphCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -200,7 +200,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.MoveBranchCommand)
      */
     @Override
-    public void execute( MoveBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( MoveBranchCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -212,7 +212,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.RecordBranchCommand)
      */
     @Override
-    public void execute( RecordBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( RecordBranchCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);
@@ -224,7 +224,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.DelegatingCommandExecutor#execute(org.jboss.dna.spi.graph.commands.SetPropertiesCommand)
      */
     @Override
-    public void execute( SetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( SetPropertiesCommand command ) throws RepositorySourceException {
         this.logger.log(level, SpiI18n.executingGraphCommand, command);
         super.execute(command);
         this.logger.log(level, SpiI18n.executedGraphCommand, command);

Modified: trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/RepositoryConnectionPoolTest.java
===================================================================
--- trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/RepositoryConnectionPoolTest.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/RepositoryConnectionPoolTest.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -84,7 +84,7 @@
     }
 
     @Test
-    public void shouldCreateConnectionAndRecoverWhenClosed() throws RepositorySourceException, InterruptedException {
+    public void shouldCreateConnectionAndRecoverWhenClosed() throws RepositorySourceException {
         assertThat(pool.getTotalConnectionsCreated(), is(0l));
         assertThat(pool.getTotalConnectionsUsed(), is(0l));
 
@@ -142,8 +142,7 @@
     }
 
     @Test
-    public void shouldAllowConnectionsToBeClosedMoreThanOnceWithNoIllEffects()
-        throws RepositorySourceException, InterruptedException {
+    public void shouldAllowConnectionsToBeClosedMoreThanOnceWithNoIllEffects() throws RepositorySourceException {
         assertThat(pool.getTotalConnectionsCreated(), is(0l));
         assertThat(pool.getTotalConnectionsUsed(), is(0l));
 

Modified: trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/RepositorySourceLoadHarness.java
===================================================================
--- trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/RepositorySourceLoadHarness.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/RepositorySourceLoadHarness.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -34,9 +34,6 @@
 import org.jboss.dna.common.i18n.MockI18n;
 import org.jboss.dna.common.util.Logger;
 import org.jboss.dna.spi.ExecutionContext;
-import org.jboss.dna.spi.connector.RepositoryConnection;
-import org.jboss.dna.spi.connector.RepositoryConnectionPool;
-import org.jboss.dna.spi.connector.RepositorySourceException;
 
 /**
  * A test harness for using repository connections under load.
@@ -206,7 +203,7 @@
          *      org.jboss.dna.spi.connector.RepositoryConnection)
          */
         public Integer run( ExecutionContext context,
-                            RepositoryConnection connection ) throws RepositorySourceException, InterruptedException {
+                            RepositoryConnection connection ) throws RepositorySourceException {
             Logger.getLogger(RepositorySourceLoadHarness.class).debug("Running {0} operation", this.getClass().getSimpleName());
             int total = count;
             for (int i = 0; i != count; ++i) {

Modified: trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/SimpleRepositorySource.java
===================================================================
--- trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/SimpleRepositorySource.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/SimpleRepositorySource.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -231,7 +231,7 @@
          *      org.jboss.dna.spi.graph.commands.GraphCommand[])
          */
         public void execute( ExecutionContext context,
-                             GraphCommand... commands ) throws RepositorySourceException, InterruptedException {
+                             GraphCommand... commands ) throws RepositorySourceException {
             assert context != null;
             if (repository.isShutdown()) {
                 throw new RepositorySourceException(getName(), "The repository \"" + repository.getRepositoryName()

Modified: trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/TimeDelayingRepositorySource.java
===================================================================
--- trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/TimeDelayingRepositorySource.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/test/java/org/jboss/dna/spi/connector/TimeDelayingRepositorySource.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -296,9 +296,16 @@
          * {@inheritDoc}
          */
         public void execute( ExecutionContext context,
-                             GraphCommand... commands ) throws InterruptedException {
+                             GraphCommand... commands ) {
             long delay = this.loadDelay.get();
-            if (delay > 0l) Thread.sleep(delay);
+            if (delay > 0l) {
+                try {
+                    Thread.sleep(delay);
+                } catch (InterruptedException e) {
+                    Thread.interrupted();
+                    throw new RepositorySourceException(this.getSourceName(), e);
+                }
+            }
             this.loadCount.incrementAndGet();
         }
 
@@ -315,8 +322,13 @@
          * {@inheritDoc}
          */
         public boolean ping( long time,
-                             TimeUnit unit ) throws InterruptedException {
-            Thread.sleep(this.pingDelay.get());
+                             TimeUnit unit ) {
+            try {
+                Thread.sleep(this.pingDelay.get());
+            } catch (InterruptedException e) {
+                Thread.interrupted();
+                return false;
+            }
             return this.pingResponse.get();
         }
 

Modified: trunk/dna-spi/src/test/java/org/jboss/dna/spi/graph/commands/executor/AbstractCommandExecutorTest.java
===================================================================
--- trunk/dna-spi/src/test/java/org/jboss/dna/spi/graph/commands/executor/AbstractCommandExecutorTest.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/dna-spi/src/test/java/org/jboss/dna/spi/graph/commands/executor/AbstractCommandExecutorTest.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -218,64 +218,64 @@
         }
 
         @Override
-        public void execute( GraphCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( GraphCommand command ) throws RepositorySourceException {
             super.execute(command);
             validator.execute(command);
         }
 
         @Override
-        public void execute( CompositeCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( CompositeCommand command ) throws RepositorySourceException {
             super.execute(command);
             validator.execute(command);
         }
 
         @Override
-        public void execute( CopyBranchCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( CopyBranchCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
 
         @Override
-        public void execute( CopyNodeCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( CopyNodeCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
 
         @Override
-        public void execute( CreateNodeCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( CreateNodeCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
 
         @Override
-        public void execute( DeleteBranchCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( DeleteBranchCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
 
         @Override
-        public void execute( GetChildrenCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( GetChildrenCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
 
         @Override
-        public void execute( GetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( GetPropertiesCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
 
         @Override
-        public void execute( MoveBranchCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( MoveBranchCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
 
         @Override
-        public void execute( GetNodeCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( GetNodeCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
 
         @Override
-        public void execute( RecordBranchCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( RecordBranchCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
 
         @Override
-        public void execute( SetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+        public void execute( SetPropertiesCommand command ) throws RepositorySourceException {
             validator.execute(command);
         }
     }

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositoryConnection.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositoryConnection.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositoryConnection.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -112,7 +112,7 @@
      * {@inheritDoc}
      */
     public void execute( ExecutionContext context,
-                         GraphCommand... commands ) throws RepositorySourceException, InterruptedException {
+                         GraphCommand... commands ) throws RepositorySourceException {
         if (!this.repository.isRunning()) {
             throw new RepositorySourceException(FederationI18n.repositoryHasBeenShutDown.text(this.repository.getName()));
         }

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositorySource.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositorySource.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositorySource.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -845,9 +845,6 @@
         } catch (InvalidPathException err) {
             I18n msg = FederationI18n.federatedRepositoryCannotBeFound;
             throw new FederationException(msg.text(repositoryName));
-        } catch (InterruptedException err) {
-            I18n msg = FederationI18n.interruptedWhileUsingFederationConfigurationRepository;
-            throw new FederationException(msg.text(repositoryName));
         }
 
     }

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederationI18n.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederationI18n.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederationI18n.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -35,7 +35,6 @@
     public static I18n nodeDoesNotExistAtPath;
     public static I18n errorRemovingNodeFromCache;
 
-    public static I18n interruptedWhileUsingFederationConfigurationRepository;
     public static I18n unableToFindFederatedRepositoryInJndi;
     public static I18n unableToFindExecutionContextFactoryInJndi;
     public static I18n unableToCreateExecutionContext;

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutor.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutor.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutor.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -186,7 +186,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#close()
      */
     @Override
-    public void close() throws InterruptedException {
+    public void close() {
         try {
             super.close();
         } finally {
@@ -203,7 +203,7 @@
         }
     }
 
-    protected RepositoryConnection getConnectionToCache() throws RepositorySourceException, InterruptedException {
+    protected RepositoryConnection getConnectionToCache() throws RepositorySourceException {
         if (this.cacheConnection == null) {
             this.cacheConnection = getConnection(this.cacheProjection);
         }
@@ -211,7 +211,7 @@
         return this.cacheConnection;
     }
 
-    protected RepositoryConnection getConnection( Projection projection ) throws RepositorySourceException, InterruptedException {
+    protected RepositoryConnection getConnection( Projection projection ) throws RepositorySourceException {
         String sourceName = projection.getSourceName();
         RepositoryConnection connection = connectionsBySourceName.get(sourceName);
         if (connection == null) {
@@ -235,7 +235,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetNodeCommand)
      */
     @Override
-    public void execute( GetNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetNodeCommand command ) throws RepositorySourceException {
         BasicGetNodeCommand nodeInfo = getNode(command.getPath());
         if (nodeInfo.hasError()) return;
         for (Property property : nodeInfo.getProperties()) {
@@ -252,7 +252,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetPropertiesCommand)
      */
     @Override
-    public void execute( GetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetPropertiesCommand command ) throws RepositorySourceException {
         BasicGetNodeCommand nodeInfo = getNode(command.getPath());
         if (nodeInfo.hasError()) return;
         for (Property property : nodeInfo.getProperties()) {
@@ -266,7 +266,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetChildrenCommand)
      */
     @Override
-    public void execute( GetChildrenCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetChildrenCommand command ) throws RepositorySourceException {
         BasicGetNodeCommand nodeInfo = getNode(command.getPath());
         if (nodeInfo.hasError()) return;
         for (Segment child : nodeInfo.getChildren()) {
@@ -280,9 +280,8 @@
      * @param path the path of the node to be returned
      * @return the node information
      * @throws RepositorySourceException
-     * @throws InterruptedException
      */
-    protected BasicGetNodeCommand getNode( Path path ) throws RepositorySourceException, InterruptedException {
+    protected BasicGetNodeCommand getNode( Path path ) throws RepositorySourceException {
         // Check the cache first ...
         final ExecutionContext context = getExecutionContext();
         RepositoryConnection cacheConnection = getConnectionToCache();
@@ -370,7 +369,7 @@
 
     protected FederatedNode createFederatedNode( Path path,
                                                  List<Contribution> contributions,
-                                                 boolean updateCache ) throws RepositorySourceException, InterruptedException {
+                                                 boolean updateCache ) throws RepositorySourceException {
 
         // If there are no contributions from any source ...
         boolean foundNonEmptyContribution = false;
@@ -415,13 +414,11 @@
      * @param sourceNames the names of the sources from which contributions are to be loaded; may be empty or null if all
      *        contributions from all sources are to be loaded
      * @param contributions the list into which the contributions are to be placed
-     * @throws InterruptedException
      * @throws RepositorySourceException
      */
     protected void loadContributionsFromSources( Path path,
                                                  Set<String> sourceNames,
-                                                 List<Contribution> contributions )
-        throws RepositorySourceException, InterruptedException {
+                                                 List<Contribution> contributions ) throws RepositorySourceException {
         // At this point, there is no merge plan, so read information from the sources ...
         ExecutionContext context = getExecutionContext();
         PathFactory pathFactory = context.getValueFactories().getPathFactory();
@@ -528,7 +525,7 @@
         return value instanceof MergePlan ? (MergePlan)value : null;
     }
 
-    protected void updateCache( FederatedNode mergedNode ) throws RepositorySourceException, InterruptedException {
+    protected void updateCache( FederatedNode mergedNode ) throws RepositorySourceException {
         final ExecutionContext context = getExecutionContext();
         final RepositoryConnection cacheConnection = getConnectionToCache();
         final Path path = mergedNode.getPath();

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/SingleProjectionCommandExecutor.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/SingleProjectionCommandExecutor.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/SingleProjectionCommandExecutor.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -92,7 +92,7 @@
         assert this.pathFactory != null;
     }
 
-    protected RepositoryConnection getConnection() throws RepositorySourceException, InterruptedException {
+    protected RepositoryConnection getConnection() throws RepositorySourceException {
         if (connection == null) {
             // Create a connection ...
             connection = this.connectionFactory.createConnection(this.projection.getSourceName());
@@ -106,7 +106,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#close()
      */
     @Override
-    public void close() throws InterruptedException {
+    public void close() {
         if (this.connection != null) {
             try {
                 this.connection.close();
@@ -123,7 +123,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetChildrenCommand)
      */
     @Override
-    public void execute( GetChildrenCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetChildrenCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         getConnection().execute(this.getExecutionContext(), new ProjectedGetChildrenCommand(command, pathInSource));
     }
@@ -134,7 +134,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetPropertiesCommand)
      */
     @Override
-    public void execute( GetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetPropertiesCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         getConnection().execute(this.getExecutionContext(), new ProjectedGetPropertiesCommand(command, pathInSource));
     }
@@ -145,7 +145,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.GetNodeCommand)
      */
     @Override
-    public void execute( GetNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( GetNodeCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         getConnection().execute(this.getExecutionContext(), new ProjectedGetNodeCommand(command, pathInSource));
     }
@@ -156,7 +156,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.CreateNodeCommand)
      */
     @Override
-    public void execute( CreateNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CreateNodeCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         getConnection().execute(this.getExecutionContext(), new ProjectedCreateNodeCommand(command, pathInSource));
     }
@@ -167,7 +167,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.SetPropertiesCommand)
      */
     @Override
-    public void execute( SetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( SetPropertiesCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         getConnection().execute(this.getExecutionContext(), new ProjectedSetPropertiesCommand(command, pathInSource));
     }
@@ -178,7 +178,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.DeleteBranchCommand)
      */
     @Override
-    public void execute( DeleteBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( DeleteBranchCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         getConnection().execute(this.getExecutionContext(), new ProjectedDeleteBranchCommand(command, pathInSource));
     }
@@ -189,7 +189,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.MoveBranchCommand)
      */
     @Override
-    public void execute( MoveBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( MoveBranchCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         Path newPathInSource = getPathInSource(command.getNewPath());
         getConnection().execute(this.getExecutionContext(),
@@ -202,7 +202,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.RecordBranchCommand)
      */
     @Override
-    public void execute( RecordBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( RecordBranchCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         getConnection().execute(this.getExecutionContext(), new ProjectedRecordBranchCommand(command, pathInSource));
     }
@@ -213,7 +213,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.CopyBranchCommand)
      */
     @Override
-    public void execute( CopyBranchCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CopyBranchCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         Path newPathInSource = getPathInSource(command.getNewPath());
         getConnection().execute(this.getExecutionContext(),
@@ -226,7 +226,7 @@
      * @see org.jboss.dna.spi.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.spi.graph.commands.CopyNodeCommand)
      */
     @Override
-    public void execute( CopyNodeCommand command ) throws RepositorySourceException, InterruptedException {
+    public void execute( CopyNodeCommand command ) throws RepositorySourceException {
         Path pathInSource = getPathInSource(command.getPath());
         Path newPathInSource = getPathInSource(command.getNewPath());
         getConnection().execute(this.getExecutionContext(), new ProjectedCopyNodeCommand(command, pathInSource, newPathInSource));

Modified: trunk/extensions/dna-connector-federation/src/main/resources/org/jboss/dna/connector/federation/FederationI18n.properties
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/resources/org/jboss/dna/connector/federation/FederationI18n.properties	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/extensions/dna-connector-federation/src/main/resources/org/jboss/dna/connector/federation/FederationI18n.properties	2008-09-04 14:34:21 UTC (rev 496)
@@ -24,7 +24,6 @@
 nodeDoesNotExistAtPath = No node exists at {0} (or below {1})
 errorRemovingNodeFromCache = Error while removing {0} from cache
 
-interruptedWhileUsingFederationConfigurationRepository = Interrupted while using federation configuration repository "{0}"
 unableToFindFederatedRepositoryInJndi = Unable to find a FederatedRepository instance in JNDI under "{1}" when creating connection to federated source "{0}"
 unableToFindExecutionContextFactoryInJndi = Unable to find an ExecutionContextFactory instance in JNDI under "{1}" when creating connection to federated source "{0}"
 unableToCreateExecutionContext = Unable to create ExecutionContext for connection to federated source "{0}" when using factory in JNDI under "{1}" and security domain "{2}"

Modified: trunk/extensions/dna-connector-inmemory/src/main/java/org/jboss/dna/connector/inmemory/InMemoryRepositoryConnection.java
===================================================================
--- trunk/extensions/dna-connector-inmemory/src/main/java/org/jboss/dna/connector/inmemory/InMemoryRepositoryConnection.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/extensions/dna-connector-inmemory/src/main/java/org/jboss/dna/connector/inmemory/InMemoryRepositoryConnection.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -108,11 +108,10 @@
     /**
      * {@inheritDoc}
      * 
-     * @throws InterruptedException
      * @throws RepositorySourceException
      */
     public void execute( ExecutionContext context,
-                         GraphCommand... commands ) throws RepositorySourceException, InterruptedException {
+                         GraphCommand... commands ) throws RepositorySourceException {
         // Do any commands update/write?
         Lock lock = this.content.getLock().readLock();
         for (GraphCommand command : commands) {

Modified: trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheConnection.java
===================================================================
--- trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheConnection.java	2008-09-04 13:41:06 UTC (rev 495)
+++ trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheConnection.java	2008-09-04 14:34:21 UTC (rev 496)
@@ -147,7 +147,7 @@
      * {@inheritDoc}
      */
     public void execute( ExecutionContext context,
-                         GraphCommand... commands ) throws RepositorySourceException, InterruptedException {
+                         GraphCommand... commands ) throws RepositorySourceException {
         // Now execute the commands ...
         CommandExecutor executor = new Executor(context, this.getSourceName());
         for (GraphCommand command : commands) {




More information about the dna-commits mailing list