Coverage Report - org.apache.commons.messagelet.model.SubscriptionDigester
 
Classes in this File Line Coverage Branch Coverage Complexity
SubscriptionDigester
0%
0/42
0%
0/2
2
 
 1  
 /*
 2  
  * Copyright (C) The Apache Software Foundation. All rights reserved.
 3  
  *
 4  
  * This software is published under the terms of the Apache Software License
 5  
  * version 1.1, a copy of which has been included with this distribution in
 6  
  * the LICENSE file.
 7  
  * 
 8  
  * $Id: SubscriptionDigester.java 155459 2005-02-26 13:24:44Z dirkv $
 9  
  */
 10  
 package org.apache.commons.messagelet.model;
 11  
 
 12  
 import org.apache.commons.digester.Digester;
 13  
 
 14  
 /** <p><code>MessengerDigester</code> is a digester of Messenger objects so 
 15  
   * that JMS Messengers can be created from an XML config file.</p>
 16  
   *
 17  
   * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
 18  
   * @version $Revision: 155459 $
 19  
   */
 20  
 public class SubscriptionDigester extends Digester {
 21  
 
 22  
     // default implementation classes
 23  0
     private String subscriptionsClass = "org.apache.commons.messagelet.model.SubscriptionList";
 24  0
     private String subscriptionClass = "org.apache.commons.messagelet.model.Subscription";
 25  0
     private String listenerClass = "org.apache.commons.messagelet.impl.MessageServletDispatcher";
 26  0
     private String bridgeClass = "org.apache.commons.messagelet.BridgeMDO";
 27  0
     private String distributeBridgeClass = "org.apache.commons.messagelet.DistributeBridgeMDO";
 28  0
     private String stopWatchClass = "org.apache.commons.messenger.tool.StopWatchMessageListener";
 29  0
     private String consumerThreadClass = "org.apache.commons.messagelet.ConsumerThread";
 30  
     
 31  0
     public SubscriptionDigester() {
 32  0
     }
 33  
     
 34  
     // Implementation methods
 35  
     //-------------------------------------------------------------------------    
 36  
 
 37  
     /** Configure the parsing rules that will be used to process 
 38  
      * the cache config file
 39  
      */
 40  
     protected void configure() {
 41  0
         if (configured) {
 42  0
             return;
 43  
         }
 44  
         else {
 45  0
             configured = true;
 46  
         }
 47  
         
 48  0
         String path = "subscriptions";
 49  
         
 50  0
         addObjectCreate( path, subscriptionsClass, "className" );
 51  0
         addSetProperties( path );
 52  
     
 53  0
         path = "subscriptions/subscription";
 54  0
         addObjectCreate( path, subscriptionClass, "className" );
 55  0
         addSetProperties( path );        
 56  0
         addSetNext( path, "addSubscription",
 57  
            "org.apache.commons.messagelet.model.Subscription"
 58  
         );        
 59  
 
 60  0
         addCallMethod( "subscriptions/subscription/servlet", "setServlet", 0);
 61  
         
 62  0
         path = "subscriptions/subscription/consumerThread";
 63  0
         addObjectCreate( path, consumerThreadClass, "className" );
 64  0
         addSetProperties( path );
 65  0
         addSetNext( path, "setConsumerThread",
 66  
            consumerThreadClass
 67  
         );
 68  
 
 69  0
         path = "subscriptions/subscription/listener";
 70  0
         addObjectCreate( path, listenerClass, "className" );
 71  0
         addSetProperties( path );
 72  0
         addSetNext( path, "setMessageListener",
 73  
            "javax.jms.MessageListener"
 74  
         );
 75  
 
 76  
 
 77  
         
 78  0
         path = "subscriptions/subscription/stopWatch";
 79  0
         addObjectCreate( path, stopWatchClass, "className" );
 80  0
         addSetProperties( path );
 81  0
         addSetNext( path, "setMessageListener",
 82  
            "javax.jms.MessageListener"
 83  
         );
 84  
 
 85  
         
 86  0
         path = "subscriptions/subscription/bridge";
 87  0
         addObjectCreate( path, bridgeClass, "className" );
 88  0
         addSetProperties( path );
 89  0
         addSetNext( path, "setMessageListener",
 90  
            "javax.jms.MessageListener"
 91  
         );
 92  
         
 93  0
         path = "subscriptions/subscription/distributeBridge";
 94  0
         addObjectCreate( path, distributeBridgeClass, "className" );
 95  0
         addSetProperties( path );
 96  0
         addSetNext( path, "setMessageListener",
 97  
            "javax.jms.MessageListener"
 98  
         );
 99  
         
 100  0
         addCallMethod("subscriptions/subscription/distributeBridge/subject", "addOutputSubject", 0);        
 101  0
     }
 102  
 }