morgand     2002/10/08 10:28:21

  Modified:    latka/src/java/org/apache/commons/latka/jelly
                        JellyUtils.java RequestTag.java SuiteTag.java
  Log:
  interim check-in
  
  Revision  Changes    Path
  1.2       +10 -10    
jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/JellyUtils.java
  
  Index: JellyUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/JellyUtils.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JellyUtils.java   8 Oct 2002 17:16:35 -0000       1.1
  +++ JellyUtils.java   8 Oct 2002 17:28:21 -0000       1.2
  @@ -63,7 +63,7 @@
   
   import org.apache.commons.jelly.JellyContext;
   
  -import org.apache.commons.latka.event.LatkaEventListener;
  +import org.apache.commons.latka.event.LatkaEventInfo;
   
   /**
    *
  @@ -71,8 +71,8 @@
    */
   public class JellyUtils {
           
  -    protected static final String EVENT_LISTENER_VAR =
  -        "latkaEventListener";
  +    protected static final String EVENT_INFO_VAR =
  +        "latkaEventInfo";
   
       protected static JellyUtils _utils = new JellyUtils();
   
  @@ -85,15 +85,15 @@
       }
       
       /**
  -     * Return the LatkaEventListener for the context,
  +     * Return the LatkaEventInfo for the context,
        * or null if none has been set
        * 
        * @param context Context for the current Jelly script
  -     * @return LatkaEventListener for the context,
  +     * @return LatkaEventInfo for the context,
        *         or null if none has been set
        */
  -    public LatkaEventListener getLatkaEventListener(JellyContext context) {
  -        return (LatkaEventListener) context.getVariable(EVENT_LISTENER_VAR);
  +    public LatkaEventInfo getLatkaEventInfo(JellyContext context) {
  +        return (LatkaEventInfo) context.getVariable(EVENT_INFO_VAR);
       }
   
   }
  
  
  
  1.3       +21 -18    
jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/RequestTag.java
  
  Index: RequestTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/RequestTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RequestTag.java   8 Oct 2002 17:16:35 -0000       1.2
  +++ RequestTag.java   8 Oct 2002 17:28:21 -0000       1.3
  @@ -68,7 +68,7 @@
   import org.apache.commons.jelly.XMLOutput;
   
   import org.apache.commons.latka.LatkaException;
  -import org.apache.commons.latka.event.LatkaEventListener;
  +import org.apache.commons.latka.event.LatkaEventInfo;
   import org.apache.commons.latka.event.RequestErrorEvent;
   import org.apache.commons.latka.event.RequestSucceededEvent;
   import org.apache.commons.latka.http.Proxy;
  @@ -98,7 +98,6 @@
       
       protected Request  _request  = null;
       protected Response _response = null;
  -    protected LatkaEventListener _listener = null;
   
       protected static final Category _log = Category.getInstance(RequestTag.class);
   
  @@ -122,21 +121,25 @@
           
           // will throw an unrecoverable LatkaException if the request could not
           // be created, typically because of a malformed URL
  -        Response response = null;
  -        LatkaEventListener listener = 
  -            JellyUtils.getInstance().getLatkaEventListener(getContext());
  -        try {
  -            response = getResponse();
  -            listener.requestSucceeded(new RequestSucceededEvent(
  -                response.getRequest(), response));
  -        } catch (IOException e) {
  -            listener.requestError(new RequestErrorEvent(_request, null, e));
  +        if (_request == null) {
  +            LatkaEventInfo listener = 
  +                JellyUtils.getInstance().getLatkaEventInfo(getContext());
  +            try {
  +                Response response = getResponse();
  +                listener.requestSucceeded(new RequestSucceededEvent(
  +                    response.getRequest(), response));
  +                
  +                _log.warn("Eventually this debug needs to go.");
  +                if (_log.isDebugEnabled()) {
  +                  _log.debug(response.getResource());
  +                }
  +            
  +            } catch (IOException e) {
  +                listener.requestError(new RequestErrorEvent(_request, null, e));
  +            }
           }
   
  -        _log.warn("Eventually this debug needs to go.");
  -        if (_log.isDebugEnabled()) {
  -            _log.debug(response.getResource());
  -        }
  +
   
       }
   
  
  
  
  1.13      +4 -4      
jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/SuiteTag.java
  
  Index: SuiteTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/SuiteTag.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SuiteTag.java     8 Oct 2002 17:16:35 -0000       1.12
  +++ SuiteTag.java     8 Oct 2002 17:28:21 -0000       1.13
  @@ -93,7 +93,7 @@
        */
       public void doTag(XMLOutput xmlOutput) throws Exception {
           LatkaEventListener reporter = 
  -            JellyUtils.getInstance().getLatkaEventListener(getContext());
  +            JellyUtils.getInstance().getLatkaEventInfo(getContext());
           if (reporter == null) {
               throw new NullPointerException("An enclosing tag must set the 
LatkaEventListener.");
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to