You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2004/09/08 06:40:07 UTC

cvs commit: jakarta-commons/jelly/jelly-tags/avalon/src/java/org/apache/commons/jelly/avalon JellyServiceImpl.java

dion        2004/09/07 21:40:07

  Modified:    jelly/jelly-tags/avalon/src/java/org/apache/commons/jelly/avalon
                        JellyServiceImpl.java
  Log:
  detab
  
  Revision  Changes    Path
  1.4       +31 -31    jakarta-commons/jelly/jelly-tags/avalon/src/java/org/apache/commons/jelly/avalon/JellyServiceImpl.java
  
  Index: JellyServiceImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/avalon/src/java/org/apache/commons/jelly/avalon/JellyServiceImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JellyServiceImpl.java	25 Feb 2004 01:28:22 -0000	1.3
  +++ JellyServiceImpl.java	8 Sep 2004 04:40:07 -0000	1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -41,22 +41,22 @@
    * 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 $Revision$
    */
   public class JellyServiceImpl implements JellyService, Configurable {
  -    
  +
       private boolean m_configured = false;
       private Map m_scripts = new HashMap();
   
  -	/**
  -	 * Constructor for JellyService.
  -	 */
  -	public JellyServiceImpl() {
  -		super();
  -	}
  -    
  +    /**
  +     * Constructor for JellyService.
  +     */
  +    public JellyServiceImpl() {
  +        super();
  +    }
  +
       /**
        * @see org.apache.commons.jelly.avalon.JellyService.runNamedScript(String, Map)
        */
  @@ -129,14 +129,14 @@
           return runScript(url, params, createXMLOutput());
       }
   
  -    
  +
       // Configurable interface
       //-------------------------------------------------------------------------
  -    
  -	    
  +
  +
       /**
        * <p>Configures the Jelly Service with named scripts.</p>
  -     * 
  +     *
        * <p>
        * The configuration looks like:
        * </p>
  @@ -152,22 +152,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();
  -            
  +            String name = config.getChild( "name" ).getValue();
  +
               // Try to load and compile the script
               try {
                   String scriptName = config.getChild( "url" ).getValue();
  @@ -179,25 +179,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 ) {
  @@ -209,7 +209,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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org