commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert McIntosh <rob...@bull-enterprises.com>
Subject [PATCH] [Jelly] JellyService
Date Mon, 27 Jan 2003 17:22:31 GMT
The package statement has been updated. It was o.a.c.jelly and it should 
be o.a.c.jelly.avalon

- Robert McIntosh

? patch.txt
Index: JellyService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-commons-sandbox/jelly/jelly-tags/avalon/src/java/org/apache/commons/jelly/avalon/JellyService.java,v
retrieving revision 1.1
diff -u -r1.1 JellyService.java
--- JellyService.java    22 Jan 2003 09:19:30 -0000    1.1
+++ JellyService.java    27 Jan 2003 17:06:19 -0000
@@ -60,7 +60,7 @@
  * JellyService.java,v 1.1 2003/01/22 09:19:30 jstrachan Exp
  */
 
-package org.apache.commons.jelly;
+package org.apache.commons.jelly.avalon;
 
 import java.util.Map;
 import java.util.HashMap;
@@ -86,12 +86,12 @@
  * An Avalon based service for executing Jelly scripts. The
  * service allows executing a script based on a name as well
  * as by a URL.
- *
+ *
  * @author <a href="mailto:robert@bull-enterprises.com">Robert McIntosh</a>
  * @version 1.1
  */
 public class JellyService implements Configurable {
-   
+
     private boolean m_configured = false;
     private Map m_scripts = new HashMap();
 
@@ -101,7 +101,7 @@
     public JellyService() {
         super();
     }
-   
+
     /**
      * Executes a named script with the supplied
      * Map of parameters.
@@ -185,7 +185,7 @@
     /**
      * Runs a script from the supplied url and sends the output of the 
script to
      * the supplied OutputStream.
-     *
+     *
      * @param url The URL of the script
      * @param params Parameters to be supplied to the script
      * @param out The OutputStream to send the output of the script to
@@ -211,14 +211,14 @@
         return runScript(url, params, createXMLOutput());
     }
 
-   
+
     // Configurable interface
     
//-------------------------------------------------------------------------
-   
-       
+
+
     /**
      * <p>Configures the Jelly Service with named scripts.</p>
-     *
+     *
      * <p>
      * The configuration looks like:
      * </p>
@@ -234,22 +234,22 @@
      *   Where each &lt;script&gt; element defines a seperate script. 
The validate attribute
      *   on the url tag is optional and defaults to false.
      * </p>
-     *
+     *
      * @param config The configuration
      * @exception ConfigurationException
      */
     public void configure( Configuration config ) throws 
ConfigurationException {
         if( m_configured )
             throw new ConfigurationException( "configure may only be 
executed once" );
-           
+
         if( !"jelly".equals( config.getName() ) )
-            throw new ConfigurationException( "Expected <jelly> but got 
" + config.getName() );  
-       
+            throw new ConfigurationException( "Expected <jelly> but got 
" + config.getName() );
+
         // Configure named scripts
         Configuration[] scripts = config.getChildren( "scripts" );
         for (int i = 0; i < scripts.length; i++) {
             String name = config.getChild( "name" ).getValue();
-           
+
             // Try to load and compile the script
             try {
                 String scriptName = config.getChild( "url" ).getValue();
@@ -261,25 +261,25 @@
                 }
                 else {
                     try {
-                        url = new URL( scriptName 
);                       
-                    }
+                        url = new URL( scriptName );
+                    }
                     catch( MalformedURLException mfue ) {
                       // Last try, via classloader
-                      url = getClass().getResource( scriptName 
);                     
-                    } 
+                      url = getClass().getResource( scriptName );
+                    }
                 }
-               
+
                 // All atempts failed...
                 if( url == null )
                     throw new ConfigurationException( "Could not find 
script [" + scriptName + "]" );
-               
+
                 // Get the script and store it
                 Jelly jelly = new Jelly();
                 jelly.setUrl( url );
                 boolean validate = config.getChild( "url" 
).getAttributeAsBoolean( "validate",  false );
                 jelly.setValidateXML( validate );
                 Script script = jelly.compileScript();
-               
+
                 m_scripts.put( name, script );
             }
             catch( Throwable t ) {
@@ -291,7 +291,7 @@
 
     // Implementation methods
     
//-------------------------------------------------------------------------
-   
+
     /**
      * Factory method to create a new JellyContext instance. Derived 
classes
      * could overload this method to provide a custom JellyContext 
instance.



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message