[dna-commits] DNA SVN: r277 - in trunk: dna-maven-classloader/src/main/java/org/jboss/dna/maven/spi and 3 other directories.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Thu Jun 12 16:13:18 EDT 2008


Author: jverhaeg at redhat.com
Date: 2008-06-12 16:13:18 -0400 (Thu, 12 Jun 2008)
New Revision: 277

Modified:
   trunk/dna-common/src/main/java/org/jboss/dna/common/text/Inflector.java
   trunk/dna-maven-classloader/src/main/java/org/jboss/dna/maven/spi/JcrMavenUrlProvider.java
   trunk/dna-repository/src/main/java/org/jboss/dna/repository/observation/ObservationService.java
   trunk/dna-repository/src/main/java/org/jboss/dna/repository/services/AbstractServiceAdministrator.java
   trunk/dna-repository/src/test/java/org/jboss/dna/repository/rules/RuleServiceTest.java
Log:
Updated code to eliminate compiler warnings related to invalid JavaDocs, etc., and corrected a few vague uses of generics

Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/text/Inflector.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/text/Inflector.java	2008-06-12 20:10:35 UTC (rev 276)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/text/Inflector.java	2008-06-12 20:13:18 UTC (rev 277)
@@ -30,6 +30,7 @@
 
 /**
  * Transforms words to singular, plural, humanized (human readable), underscore, camel case, or ordinal form.
+ * 
  * @author Randall Hauch
  */
 public class Inflector {
@@ -46,7 +47,8 @@
         protected final Pattern expressionPattern;
         protected final String replacement;
 
-        protected Rule( String expression, String replacement ) {
+        protected Rule( String expression,
+                        String replacement ) {
             this.expression = expression;
             this.replacement = replacement != null ? replacement : "";
             this.expressionPattern = Pattern.compile(this.expression, Pattern.CASE_INSENSITIVE);
@@ -55,6 +57,7 @@
         /**
          * Apply the rule against the input string, returning the modified string or null if the rule didn't apply (and no
          * modifications were made)
+         * 
          * @param input the input string
          * @return the modified string if this rule applied, or null if the input was not modified by this rule
          */
@@ -130,6 +133,7 @@
      * <p>
      * Note that if the {@link Object#toString()} is called on the supplied object, so this method works for non-strings, too.
      * </p>
+     * 
      * @param word the word that is to be pluralized.
      * @return the pluralized form of the word, or the word itself if it could not be pluralized
      * @see #singularize(Object)
@@ -146,7 +150,8 @@
         return wordStr;
     }
 
-    public String pluralize( Object word, int count ) {
+    public String pluralize( Object word,
+                             int count ) {
         if (word == null) return null;
         if (count == 1 || count == -1) {
             return word.toString();
@@ -172,6 +177,7 @@
      * <p>
      * Note that if the {@link Object#toString()} is called on the supplied object, so this method works for non-strings, too.
      * </p>
+     * 
      * @param word the word that is to be pluralized.
      * @return the pluralized form of the word, or the word itself if it could not be pluralized
      * @see #pluralize(Object)
@@ -201,6 +207,7 @@
      * </pre>
      * 
      * </p>
+     * 
      * @param lowerCaseAndUnderscoredWord the word that is to be converted to camel case
      * @param delimiterChars optional characters that are used to delimit word boundaries
      * @return the lower camel case version of the word
@@ -208,7 +215,8 @@
      * @see #camelCase(String, boolean, char[])
      * @see #upperCamelCase(String, char[])
      */
-    public String lowerCamelCase( String lowerCaseAndUnderscoredWord, char... delimiterChars ) {
+    public String lowerCamelCase( String lowerCaseAndUnderscoredWord,
+                                  char... delimiterChars ) {
         return camelCase(lowerCaseAndUnderscoredWord, false, delimiterChars);
     }
 
@@ -225,6 +233,7 @@
      * </pre>
      * 
      * </p>
+     * 
      * @param lowerCaseAndUnderscoredWord the word that is to be converted to camel case
      * @param delimiterChars optional characters that are used to delimit word boundaries
      * @return the upper camel case version of the word
@@ -232,7 +241,8 @@
      * @see #camelCase(String, boolean, char[])
      * @see #lowerCamelCase(String, char[])
      */
-    public String upperCamelCase( String lowerCaseAndUnderscoredWord, char... delimiterChars ) {
+    public String upperCamelCase( String lowerCaseAndUnderscoredWord,
+                                  char... delimiterChars ) {
         return camelCase(lowerCaseAndUnderscoredWord, true, delimiterChars);
     }
 
@@ -253,16 +263,19 @@
      * </pre>
      * 
      * </p>
+     * 
      * @param lowerCaseAndUnderscoredWord the word that is to be converted to camel case
      * @param uppercaseFirstLetter true if the first character is to be uppercased, or false if the first character is to be
-     * lowercased
+     *        lowercased
      * @param delimiterChars optional characters that are used to delimit word boundaries
      * @return the camel case version of the word
      * @see #underscore(String, char[])
      * @see #upperCamelCase(String, char[])
      * @see #lowerCamelCase(String, char[])
      */
-    public String camelCase( String lowerCaseAndUnderscoredWord, boolean uppercaseFirstLetter, char... delimiterChars ) {
+    public String camelCase( String lowerCaseAndUnderscoredWord,
+                             boolean uppercaseFirstLetter,
+                             char... delimiterChars ) {
         if (lowerCaseAndUnderscoredWord == null) return null;
         lowerCaseAndUnderscoredWord = lowerCaseAndUnderscoredWord.trim();
         if (lowerCaseAndUnderscoredWord.length() == 0) return "";
@@ -279,7 +292,8 @@
             return replaceAllWithUppercase(result, "(^|_)(.)", 2);
         }
         if (lowerCaseAndUnderscoredWord.length() < 2) return lowerCaseAndUnderscoredWord;
-        return "" + lowerCaseAndUnderscoredWord.charAt(0) + camelCase(lowerCaseAndUnderscoredWord, true, delimiterChars).substring(1);
+        return "" + lowerCaseAndUnderscoredWord.charAt(0)
+               + camelCase(lowerCaseAndUnderscoredWord, true, delimiterChars).substring(1);
     }
 
     /**
@@ -299,11 +313,13 @@
      * </pre>
      * 
      * </p>
+     * 
      * @param camelCaseWord the camel-cased word that is to be converted;
      * @param delimiterChars optional characters that are used to delimit word boundaries (beyond capitalization)
      * @return a lower-cased version of the input, with separate words delimited by the underscore character.
      */
-    public String underscore( String camelCaseWord, char... delimiterChars ) {
+    public String underscore( String camelCaseWord,
+                              char... delimiterChars ) {
         if (camelCaseWord == null) return null;
         String result = camelCaseWord.trim();
         if (result.length() == 0) return "";
@@ -320,6 +336,7 @@
 
     /**
      * Returns a copy of the input with the first character converted to uppercase and the remainder to lowercase.
+     * 
      * @param words the word to be capitalized
      * @return the string with the first character capitalized and the remaining characters lowercased
      */
@@ -343,12 +360,14 @@
      * </pre>
      * 
      * </p>
+     * 
      * @param lowerCaseAndUnderscoredWords the input to be humanized
      * @param removableTokens optional array of tokens that are to be removed
      * @return the humanized string
      * @see #titleCase(String, String[])
      */
-    public String humanize( String lowerCaseAndUnderscoredWords, String... removableTokens ) {
+    public String humanize( String lowerCaseAndUnderscoredWords,
+                            String... removableTokens ) {
         if (lowerCaseAndUnderscoredWords == null) return null;
         String result = lowerCaseAndUnderscoredWords.trim();
         if (result.length() == 0) return "";
@@ -377,11 +396,13 @@
      * </pre>
      * 
      * </p>
+     * 
      * @param words the input to be turned into title case
      * @param removableTokens optional array of tokens that are to be removed
      * @return the title-case version of the supplied words
      */
-    public String titleCase( String words, String... removableTokens ) {
+    public String titleCase( String words,
+                             String... removableTokens ) {
         String result = humanize(words, removableTokens);
         result = replaceAllWithUppercase(result, "\\b([a-z])", 1); // change first char of each word to uppercase
         return result;
@@ -390,6 +411,7 @@
     /**
      * Turns a non-negative number into an ordinal string used to denote the position in an ordered sequence, such as 1st, 2nd,
      * 3rd, 4th.
+     * 
      * @param number the non-negative number
      * @return the string with the number and ordinal suffix
      */
@@ -411,6 +433,7 @@
     /**
      * Determine whether the supplied word is considered uncountable by the {@link #pluralize(Object) pluralize} and
      * {@link #singularize(Object) singularize} methods.
+     * 
      * @param word the word
      * @return true if the plural and singular forms of the word are the same
      */
@@ -422,23 +445,27 @@
 
     /**
      * Get the set of words that are not processed by the Inflector. The resulting map is directly modifiable.
+     * 
      * @return the set of uncountable words
      */
     public Set<String> getUncountables() {
         return uncountables;
     }
 
-    public void addPluralize( String rule, String replacement ) {
+    public void addPluralize( String rule,
+                              String replacement ) {
         final Rule pluralizeRule = new Rule(rule, replacement);
         this.plurals.addFirst(pluralizeRule);
     }
 
-    public void addSingularize( String rule, String replacement ) {
+    public void addSingularize( String rule,
+                                String replacement ) {
         final Rule singularizeRule = new Rule(rule, replacement);
         this.singulars.addFirst(singularizeRule);
     }
 
-    public void addIrregular( String singular, String plural ) {
+    public void addIrregular( String singular,
+                              String plural ) {
         ArgCheck.isNotEmpty(singular, "singular rule");
         ArgCheck.isNotEmpty(plural, "plural rule");
         String singularRemainder = singular.length() > 1 ? singular.substring(1) : "";
@@ -463,12 +490,15 @@
      * string to uppercase or lowercase the backreferences. For example, <code>\L1</code> would lowercase the first
      * backreference, and <code>&#92;u3</code> would uppercase the 3rd backreference.
      * </p>
+     * 
      * @param input
      * @param regex
      * @param groupNumberToUppercase
-     * @return
+     * @return the input string with the appropriate characters converted to upper-case
      */
-    protected static String replaceAllWithUppercase( String input, String regex, int groupNumberToUppercase ) {
+    protected static String replaceAllWithUppercase( String input,
+                                                     String regex,
+                                                     int groupNumberToUppercase ) {
         Pattern underscoreAndDotPattern = Pattern.compile(regex);
         Matcher matcher = underscoreAndDotPattern.matcher(input);
         StringBuffer sb = new StringBuffer();

Modified: trunk/dna-maven-classloader/src/main/java/org/jboss/dna/maven/spi/JcrMavenUrlProvider.java
===================================================================
--- trunk/dna-maven-classloader/src/main/java/org/jboss/dna/maven/spi/JcrMavenUrlProvider.java	2008-06-12 20:10:35 UTC (rev 276)
+++ trunk/dna-maven-classloader/src/main/java/org/jboss/dna/maven/spi/JcrMavenUrlProvider.java	2008-06-12 20:13:18 UTC (rev 277)
@@ -191,7 +191,10 @@
     /**
      * {@inheritDoc}
      */
-    public URL getUrl( MavenId mavenId, ArtifactType artifactType, SignatureType signatureType, boolean createIfRequired ) throws MalformedURLException, MavenRepositoryException {
+    public URL getUrl( MavenId mavenId,
+                       ArtifactType artifactType,
+                       SignatureType signatureType,
+                       boolean createIfRequired ) throws MalformedURLException, MavenRepositoryException {
         final String path = getUrlPath(mavenId, artifactType, signatureType);
         MavenUrl mavenUrl = new MavenUrl();
         mavenUrl.setWorkspaceName(this.getWorkspaceName());
@@ -232,9 +235,14 @@
                 session.save();
                 this.logger.trace("Created Maven repository node for {0}", mavenUrl);
             } catch (LoginException err) {
-                throw new MavenRepositoryException(MavenI18n.unableToOpenSessiontoRepositoryWhenCreatingNode.text(mavenUrl, err.getMessage()), err);
+                throw new MavenRepositoryException(
+                                                   MavenI18n.unableToOpenSessiontoRepositoryWhenCreatingNode.text(mavenUrl,
+                                                                                                                  err.getMessage()),
+                                                   err);
             } catch (NoSuchWorkspaceException err) {
-                throw new MavenRepositoryException(MavenI18n.unableToFindWorkspaceWhenCreatingNode.text(this.getWorkspaceName(), mavenUrl, err.getMessage()), err);
+                throw new MavenRepositoryException(MavenI18n.unableToFindWorkspaceWhenCreatingNode.text(this.getWorkspaceName(),
+                                                                                                        mavenUrl,
+                                                                                                        err.getMessage()), err);
             } catch (PathNotFoundException err) {
                 return null;
             } catch (RepositoryException err) {
@@ -246,8 +254,11 @@
         return mavenUrl.getUrl(this.urlStreamHandler, this.urlEncoder);
     }
 
-    protected Node getOrCreatePath( Node root, String relPath, String nodeType )
-        throws PathNotFoundException, ItemExistsException, NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException {
+    protected Node getOrCreatePath( Node root,
+                                    String relPath,
+                                    String nodeType )
+        throws PathNotFoundException, ItemExistsException, NoSuchNodeTypeException, LockException, VersionException,
+        ConstraintViolationException, RepositoryException {
         // Create the "nt:unstructured" nodes for the folder structures ...
         Node current = root;
         boolean created = false;
@@ -267,7 +278,8 @@
         return current;
     }
 
-    protected Node getContentNodeForMavenResource( Session session, MavenUrl mavenUrl ) throws RepositoryException {
+    protected Node getContentNodeForMavenResource( Session session,
+                                                   MavenUrl mavenUrl ) throws RepositoryException {
         final String mavenPath = mavenUrl.getPath().replaceFirst("^/+", "");
         final String mavenRootPath = this.getPathToTopOfRepository().replaceFirst("^/+", "");
         Node root = session.getRootNode();
@@ -285,7 +297,9 @@
      * @param signatureType the type of signature; may be null if the signature file is not desired
      * @return the path
      */
-    protected String getUrlPath( MavenId mavenId, ArtifactType artifactType, SignatureType signatureType ) {
+    protected String getUrlPath( MavenId mavenId,
+                                 ArtifactType artifactType,
+                                 SignatureType signatureType ) {
         StringBuilder sb = new StringBuilder();
         sb.append("/");
         if (artifactType == null) {
@@ -335,7 +349,7 @@
     /**
      * Obtain an input stream to the existing content at the location given by the supplied {@link MavenUrl}. The Maven URL
      * should have a path that points to the node where the content is stored in the
-     * {@link #getContentProperty() content property}.
+     * {@link #CONTENT_PROPERTY_NAME content property}.
      * 
      * @param mavenUrl the Maven URL to the content; may not be null
      * @return the input stream to the content, or null if there is no existing content
@@ -354,9 +368,13 @@
             result = new MavenInputStream(session, result);
             return result;
         } catch (LoginException err) {
-            throw new MavenRepositoryException(MavenI18n.unableToOpenSessiontoRepositoryWhenReadingNode.text(mavenUrl, err.getMessage()), err);
+            throw new MavenRepositoryException(MavenI18n.unableToOpenSessiontoRepositoryWhenReadingNode.text(mavenUrl,
+                                                                                                             err.getMessage()),
+                                               err);
         } catch (NoSuchWorkspaceException err) {
-            throw new MavenRepositoryException(MavenI18n.unableToFindWorkspaceWhenReadingNode.text(this.getWorkspaceName(), mavenUrl, err.getMessage()), err);
+            throw new MavenRepositoryException(MavenI18n.unableToFindWorkspaceWhenReadingNode.text(this.getWorkspaceName(),
+                                                                                                   mavenUrl,
+                                                                                                   err.getMessage()), err);
         } catch (PathNotFoundException err) {
             return null;
         } catch (RepositoryException err) {
@@ -371,7 +389,7 @@
     /**
      * Obtain an output stream to the existing content at the location given by the supplied {@link MavenUrl}. The Maven URL
      * should have a path that points to the property or to the node where the content is stored in the
-     * {@link #getContentProperty() content property}.
+     * {@link #CONTENT_PROPERTY_NAME content property}.
      * 
      * @param mavenUrl the Maven URL to the content; may not be null
      * @return the input stream to the content, or null if there is no existing content
@@ -389,15 +407,20 @@
             }
             return result;
         } catch (LoginException err) {
-            throw new MavenRepositoryException(MavenI18n.unableToOpenSessiontoRepositoryWhenReadingNode.text(mavenUrl, err.getMessage()), err);
+            throw new MavenRepositoryException(MavenI18n.unableToOpenSessiontoRepositoryWhenReadingNode.text(mavenUrl,
+                                                                                                             err.getMessage()),
+                                               err);
         } catch (NoSuchWorkspaceException err) {
-            throw new MavenRepositoryException(MavenI18n.unableToFindWorkspaceWhenReadingNode.text(this.getWorkspaceName(), mavenUrl, err.getMessage()), err);
+            throw new MavenRepositoryException(MavenI18n.unableToFindWorkspaceWhenReadingNode.text(this.getWorkspaceName(),
+                                                                                                   mavenUrl,
+                                                                                                   err.getMessage()), err);
         } catch (RepositoryException err) {
             throw new MavenRepositoryException(MavenI18n.errorReadingNode.text(mavenUrl, err.getMessage()), err);
         }
     }
 
-    public void setContent( MavenUrl mavenUrl, InputStream content ) throws IOException {
+    public void setContent( MavenUrl mavenUrl,
+                            InputStream content ) throws IOException {
         Session session = null;
         try {
             // Create a new session, find the actual node, create a temporary file to which the content will be written,
@@ -411,7 +434,9 @@
         } catch (LoginException err) {
             throw new IOException(MavenI18n.unableToOpenSessiontoRepositoryWhenWritingNode.text(mavenUrl, err.getMessage()));
         } catch (NoSuchWorkspaceException err) {
-            throw new IOException(MavenI18n.unableToFindWorkspaceWhenWritingNode.text(this.getWorkspaceName(), mavenUrl, err.getMessage()));
+            throw new IOException(MavenI18n.unableToFindWorkspaceWhenWritingNode.text(this.getWorkspaceName(),
+                                                                                      mavenUrl,
+                                                                                      err.getMessage()));
         } catch (RepositoryException err) {
             throw new IOException(MavenI18n.errorWritingNode.text(mavenUrl, err.getMessage()));
         } finally {
@@ -426,7 +451,8 @@
         private final InputStream stream;
         private final Session session;
 
-        protected MavenInputStream( final Session session, final InputStream stream ) {
+        protected MavenInputStream( final Session session,
+                                    final InputStream stream ) {
             this.session = session;
             this.stream = stream;
         }
@@ -458,7 +484,8 @@
         private final File file;
         private final MavenUrl mavenUrl;
 
-        protected MavenOutputStream( final MavenUrl mavenUrl, final File file ) throws FileNotFoundException {
+        protected MavenOutputStream( final MavenUrl mavenUrl,
+                                     final File file ) throws FileNotFoundException {
             this.mavenUrl = mavenUrl;
             this.file = file;
             this.stream = new BufferedOutputStream(new FileOutputStream(this.file));
@@ -487,7 +514,9 @@
          * {@inheritDoc}
          */
         @Override
-        public void write( byte[] b, int off, int len ) throws IOException {
+        public void write( byte[] b,
+                           int off,
+                           int len ) throws IOException {
             if (stream == null) throw new IOException(MavenI18n.unableToWriteToClosedStream.text());
             stream.write(b, off, len);
         }
@@ -512,12 +541,18 @@
                         try {
                             inputStream.close();
                         } catch (IOException ioe) {
-                            Logger.getLogger(this.getClass()).error(ioe, MavenI18n.errorClosingTempFileStreamAfterWritingContent, mavenUrl, ioe.getMessage());
+                            Logger.getLogger(this.getClass()).error(ioe,
+                                                                    MavenI18n.errorClosingTempFileStreamAfterWritingContent,
+                                                                    mavenUrl,
+                                                                    ioe.getMessage());
                         } finally {
                             try {
                                 file.delete();
                             } catch (SecurityException se) {
-                                Logger.getLogger(this.getClass()).error(se, MavenI18n.errorDeletingTempFileStreamAfterWritingContent, mavenUrl, se.getMessage());
+                                Logger.getLogger(this.getClass()).error(se,
+                                                                        MavenI18n.errorDeletingTempFileStreamAfterWritingContent,
+                                                                        mavenUrl,
+                                                                        se.getMessage());
                             } finally {
                                 stream = null;
                             }
@@ -563,9 +598,7 @@
         private final MavenUrl mavenUrl;
 
         /**
-         * @param repository the repository that contains the content from/to which the URL connections will read/write
          * @param url the URL that is to be processed
-         * @param decoder the decoder that will unescape any characters in the URL
          */
         protected MavenUrlConnection( URL url ) {
             super(url);

Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/observation/ObservationService.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/observation/ObservationService.java	2008-06-12 20:10:35 UTC (rev 276)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/observation/ObservationService.java	2008-06-12 20:13:18 UTC (rev 277)
@@ -61,7 +61,8 @@
      */
     public static interface ProblemLog {
 
-        void error( String repositoryWorkspaceName, Throwable t );
+        void error( String repositoryWorkspaceName,
+                    Throwable t );
     }
 
     /**
@@ -74,7 +75,8 @@
         /**
          * {@inheritDoc}
          */
-        public void error( String repositoryWorkspaceName, Throwable t ) {
+        public void error( String repositoryWorkspaceName,
+                           Throwable t ) {
             getLogger().error(t, RepositoryI18n.errorProcessingEvents, repositoryWorkspaceName);
         }
     }
@@ -84,7 +86,8 @@
         /**
          * {@inheritDoc}
          */
-        public void error( String repositoryWorkspaceName, Throwable t ) {
+        public void error( String repositoryWorkspaceName,
+                           Throwable t ) {
         }
     }
 
@@ -113,7 +116,8 @@
         /**
          * {@inheritDoc}
          */
-        public boolean awaitTermination( long timeout, TimeUnit unit ) {
+        public boolean awaitTermination( long timeout,
+                                         TimeUnit unit ) {
             return true;
         }
 
@@ -273,23 +277,29 @@
      * </p>
      * 
      * @param repositoryWorkspaceName the name to be used with the session factory to obtain a session to the repository and
-     * workspace that is to be monitored
+     *        workspace that is to be monitored
      * @param absolutePath the absolute path of the node at or below which changes are to be monitored; may be null if all nodes
-     * in the workspace are to be monitored
+     *        in the workspace are to be monitored
      * @param eventTypes the bitmask of the {@link Event} types that are to be monitored
      * @param isDeep true if events below the node given by the <code>absolutePath</code> or by the <code>uuids</code> are to
-     * be processed, or false if only the events at the node
+     *        be processed, or false if only the events at the node
      * @param uuids array of UUIDs of nodes that are to be monitored; may be null or empty if the UUIDs are not known
      * @param nodeTypeNames array of node type names that are to be monitored; may be null or empty if the monitoring has no node
-     * type restrictions
+     *        type restrictions
      * @param noLocal true if the events originating in the supplied workspace are to be ignored, or false if they are also to be
-     * processed.
+     *        processed.
      * @return the listener that was created and registered to perform the monitoring
      * @throws RepositoryException if there is a problem registering the listener
      */
-    public WorkspaceListener monitor( String repositoryWorkspaceName, String absolutePath, int eventTypes, boolean isDeep, String[] uuids, String[] nodeTypeNames, boolean noLocal )
-        throws RepositoryException {
-        WorkspaceListener listener = new WorkspaceListener(repositoryWorkspaceName, eventTypes, absolutePath, isDeep, uuids, nodeTypeNames, noLocal);
+    public WorkspaceListener monitor( String repositoryWorkspaceName,
+                                      String absolutePath,
+                                      int eventTypes,
+                                      boolean isDeep,
+                                      String[] uuids,
+                                      String[] nodeTypeNames,
+                                      boolean noLocal ) throws RepositoryException {
+        WorkspaceListener listener = new WorkspaceListener(repositoryWorkspaceName, eventTypes, absolutePath, isDeep, uuids,
+                                                           nodeTypeNames, noLocal);
         listener.register();
         this.workspaceListeners.add(listener);
         return listener;
@@ -310,16 +320,24 @@
      * </p>
      * 
      * @param repositoryWorkspaceName the name to be used with the session factory to obtain a session to the repository and
-     * workspace that is to be monitored
+     *        workspace that is to be monitored
      * @param absolutePath the absolute path of the node at or below which changes are to be monitored; may be null if all nodes
-     * in the workspace are to be monitored
+     *        in the workspace are to be monitored
      * @param nodeTypeNames the names of the node types that are to be monitored; may be null or empty if the monitoring has no
-     * node type restrictions
+     *        node type restrictions
      * @return the listener that was created and registered to perform the monitoring
      * @throws RepositoryException if there is a problem registering the listener
      */
-    public WorkspaceListener monitor( String repositoryWorkspaceName, String absolutePath, String... nodeTypeNames ) throws RepositoryException {
-        return monitor(repositoryWorkspaceName, absolutePath, WorkspaceListener.DEFAULT_EVENT_TYPES, WorkspaceListener.DEFAULT_IS_DEEP, null, nodeTypeNames, WorkspaceListener.DEFAULT_NO_LOCAL);
+    public WorkspaceListener monitor( String repositoryWorkspaceName,
+                                      String absolutePath,
+                                      String... nodeTypeNames ) throws RepositoryException {
+        return monitor(repositoryWorkspaceName,
+                       absolutePath,
+                       WorkspaceListener.DEFAULT_EVENT_TYPES,
+                       WorkspaceListener.DEFAULT_IS_DEEP,
+                       null,
+                       nodeTypeNames,
+                       WorkspaceListener.DEFAULT_NO_LOCAL);
     }
 
     /**
@@ -336,15 +354,23 @@
      * </p>
      * 
      * @param repositoryWorkspaceName the name to be used with the session factory to obtain a session to the repository and
-     * workspace that is to be monitored
+     *        workspace that is to be monitored
      * @param eventTypes the bitmask of the {@link Event} types that are to be monitored
      * @param nodeTypeNames the names of the node types that are to be monitored; may be null or empty if the monitoring has no
-     * node type restrictions
+     *        node type restrictions
      * @return the listener that was created and registered to perform the monitoring
      * @throws RepositoryException if there is a problem registering the listener
      */
-    public WorkspaceListener monitor( String repositoryWorkspaceName, int eventTypes, String... nodeTypeNames ) throws RepositoryException {
-        return monitor(repositoryWorkspaceName, WorkspaceListener.DEFAULT_ABSOLUTE_PATH, eventTypes, WorkspaceListener.DEFAULT_IS_DEEP, null, nodeTypeNames, WorkspaceListener.DEFAULT_NO_LOCAL);
+    public WorkspaceListener monitor( String repositoryWorkspaceName,
+                                      int eventTypes,
+                                      String... nodeTypeNames ) throws RepositoryException {
+        return monitor(repositoryWorkspaceName,
+                       WorkspaceListener.DEFAULT_ABSOLUTE_PATH,
+                       eventTypes,
+                       WorkspaceListener.DEFAULT_IS_DEEP,
+                       null,
+                       nodeTypeNames,
+                       WorkspaceListener.DEFAULT_NO_LOCAL);
     }
 
     protected void unregisterListener( WorkspaceListener listener ) {
@@ -360,10 +386,11 @@
      * and filters.
      * </p>
      * 
-     * @param events
+     * @param eventIterator
      * @param listener
      */
-    protected void processEvents( EventIterator eventIterator, WorkspaceListener listener ) {
+    protected void processEvents( EventIterator eventIterator,
+                                  WorkspaceListener listener ) {
         if (eventIterator == null) return;
         List<Event> events = new ArrayList<Event>();
         // Copy the events ...
@@ -418,7 +445,8 @@
         private final int size;
         private int position = 0;
 
-        protected DelegatingEventIterator( Iterator<Event> events, int size ) {
+        protected DelegatingEventIterator( Iterator<Event> events,
+                                           int size ) {
             this.events = events;
             this.size = size;
         }
@@ -487,7 +515,8 @@
 
         public static final boolean DEFAULT_IS_DEEP = true;
         public static final boolean DEFAULT_NO_LOCAL = false;
-        public static final int DEFAULT_EVENT_TYPES = Event.NODE_ADDED | /* Event.NODE_REMOVED| */Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED /* |Event.PROPERTY_REMOVED */;
+        public static final int DEFAULT_EVENT_TYPES = Event.NODE_ADDED | /* Event.NODE_REMOVED| */Event.PROPERTY_ADDED
+                                                      | Event.PROPERTY_CHANGED /* |Event.PROPERTY_REMOVED */;
         public static final String DEFAULT_ABSOLUTE_PATH = "/";
 
         private final String repositoryWorkspaceName;
@@ -500,7 +529,13 @@
         @GuardedBy( "this" )
         private transient Session session;
 
-        protected WorkspaceListener( String repositoryWorkspaceName, int eventTypes, String absPath, boolean isDeep, String[] uuids, String[] nodeTypeNames, boolean noLocal ) {
+        protected WorkspaceListener( String repositoryWorkspaceName,
+                                     int eventTypes,
+                                     String absPath,
+                                     boolean isDeep,
+                                     String[] uuids,
+                                     String[] nodeTypeNames,
+                                     boolean noLocal ) {
             this.repositoryWorkspaceName = repositoryWorkspaceName;
             this.eventTypes = eventTypes;
             this.deep = isDeep;
@@ -591,7 +626,13 @@
             this.session = ObservationService.this.getSessionFactory().createSession(this.repositoryWorkspaceName);
             String[] uuids = this.uuids.isEmpty() ? null : this.uuids.toArray(new String[this.uuids.size()]);
             String[] nodeTypeNames = this.nodeTypeNames.isEmpty() ? null : this.nodeTypeNames.toArray(new String[this.nodeTypeNames.size()]);
-            this.session.getWorkspace().getObservationManager().addEventListener(this, eventTypes, absolutePath, deep, uuids, nodeTypeNames, noLocal);
+            this.session.getWorkspace().getObservationManager().addEventListener(this,
+                                                                                 eventTypes,
+                                                                                 absolutePath,
+                                                                                 deep,
+                                                                                 uuids,
+                                                                                 nodeTypeNames,
+                                                                                 noLocal);
             return this;
         }
 

Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/services/AbstractServiceAdministrator.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/services/AbstractServiceAdministrator.java	2008-06-12 20:10:35 UTC (rev 276)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/services/AbstractServiceAdministrator.java	2008-06-12 20:13:18 UTC (rev 277)
@@ -39,7 +39,8 @@
     private volatile State state;
     private final I18n serviceName;
 
-    protected AbstractServiceAdministrator( I18n serviceName, State initialState ) {
+    protected AbstractServiceAdministrator( I18n serviceName,
+                                            State initialState ) {
         assert initialState != null;
         assert serviceName != null;
         this.state = initialState;
@@ -88,7 +89,7 @@
      * @param state the desired state in string form
      * @return this object for method chaining purposes
      * @throws IllegalArgumentException if the specified state string is null or does not match one of the predefined
-     * {@link ServiceAdministrator.State predefined enumerated values}
+     *         {@link ServiceAdministrator.State predefined enumerated values}
      * @see #setState(State)
      * @see #start()
      * @see #pause()
@@ -129,8 +130,8 @@
 
     /**
      * Implementation of the functionality to switch to the started state. This method is only called if the state from which the
-     * service is transitioning is appropriate ({@link State#PAUSED}). This method does nothing by default, and should be
-     * overridden if needed.
+     * service is transitioning is appropriate ({@link ServiceAdministrator.State#PAUSED}). This method does nothing by default,
+     * and should be overridden if needed.
      * 
      * @param fromState the state from which this service is transitioning; never null
      * @throws IllegalStateException if the service is such that it cannot be transitioned from the supplied state
@@ -166,8 +167,8 @@
 
     /**
      * Implementation of the functionality to switch to the paused state. This method is only called if the state from which the
-     * service is transitioning is appropriate ({@link State#STARTED}). This method does nothing by default, and should be
-     * overridden if needed.
+     * service is transitioning is appropriate ({@link ServiceAdministrator.State#STARTED}). This method does nothing by
+     * default, and should be overridden if needed.
      * 
      * @param fromState the state from which this service is transitioning; never null
      * @throws IllegalStateException if the service is such that it cannot be transitioned from the supplied state
@@ -203,8 +204,8 @@
 
     /**
      * Implementation of the functionality to switch to the shutdown state. This method is only called if the state from which the
-     * service is transitioning is appropriate ({@link State#STARTED} or {@link State#PAUSED}). This method does nothing by
-     * default, and should be overridden if needed.
+     * service is transitioning is appropriate ({@link ServiceAdministrator.State#STARTED} or
+     * {@link ServiceAdministrator.State#PAUSED}). This method does nothing by default, and should be overridden if needed.
      * 
      * @param fromState the state from which this service is transitioning; never null
      * @throws IllegalStateException if the service is such that it cannot be transitioned from the supplied state

Modified: trunk/dna-repository/src/test/java/org/jboss/dna/repository/rules/RuleServiceTest.java
===================================================================
--- trunk/dna-repository/src/test/java/org/jboss/dna/repository/rules/RuleServiceTest.java	2008-06-12 20:10:35 UTC (rev 276)
+++ trunk/dna-repository/src/test/java/org/jboss/dna/repository/rules/RuleServiceTest.java	2008-06-12 20:13:18 UTC (rev 277)
@@ -214,9 +214,6 @@
         executeRuleSet(validRuleSet.getName());
     }
 
-    /**
-     * @param validRuleSet
-     */
     protected void executeRuleSet( String ruleSetName ) {
         // Create some simple fact objects ...
         RuleInput info = new RuleInput();




More information about the dna-commits mailing list