| 1 | 
 //---PACKAGE DECLARATION--- | 
 
 
 
 
 
 | 2 | 
 package uk.ac.ukc.iscream.rootfilter; | 
 
 
 
 
 
 | 3 | 
  | 
 
 
 
 
 
 | 4 | 
 //---IMPORTS--- | 
 
 
 
 
 
 | 5 | 
 import uk.ac.ukc.iscream.core.*; | 
 
 
 
 
 
 | 6 | 
 import uk.ac.ukc.iscream.filter.*; | 
 
 
 
 
 
 | 7 | 
 import uk.ac.ukc.iscream.clientinterface.*; | 
 
 
 
 
 
 | 8 | 
 import uk.ac.ukc.iscream.util.*; | 
 
 
 
 
 
 | 9 | 
  | 
 
 
 
 
 
 | 10 | 
 /** | 
 
 
 
 
 
 | 11 | 
  * A root filter servant has an array | 
 
 
 
 
 
 | 12 | 
  * of client interfaces where data should be | 
 
 
 
 
 
 | 13 | 
  * piped. | 
 
 
 
 
 
 | 14 | 
  * | 
 
 
 
 
 
 | 15 | 
  * @author  $Author: ajm4 $ | 
 
 
 
 
 
 | 16 | 
  * @version $Id: RootFilterServant.java,v 1.10 2000/12/04 18:12:13 ajm4 Exp $ | 
 
 
 
 
 
 | 17 | 
  */ | 
 
 
 
 
 
 | 18 | 
 class RootFilterServant extends FilterPOA { | 
 
 
 
 
 
 | 19 | 
  | 
 
 
 
 
 
 | 20 | 
 //---FINAL ATTRIBUTES--- | 
 
 
 
 
 
 | 21 | 
  | 
 
 
 
 
 
 | 22 | 
     /** | 
 
 
 
 
 
 | 23 | 
      * The current CVS revision of this class | 
 
 
 
 
 
 | 24 | 
      */ | 
 
 
 
 
 
 | 25 | 
     public final String REVISION = "$Revision: 1.10 $"; | 
 
 
 
 
 
 | 26 | 
      | 
 
 
 
 
 
 | 27 | 
 //---STATIC METHODS--- | 
 
 
 
 
 
 | 28 | 
  | 
 
 
 
 
 
 | 29 | 
 //---CONSTRUCTORS--- | 
 
 
 
 
 
 | 30 | 
  | 
 
 
 
 
 
 | 31 | 
     /** | 
 
 
 
 
 
 | 32 | 
      * Creates a new RootFilter. | 
 
 
 
 
 
 | 33 | 
      * | 
 
 
 
 
 
 | 34 | 
      * @param logger a Logger to use | 
 
 
 
 
 
 | 35 | 
      */ | 
 
 
 
 
 
 | 36 | 
     public RootFilterServant(ClientInterface[] clientInterfaces) { | 
 
 
 
 
 
 | 37 | 
         _clientInterfaces = clientInterfaces; | 
 
 
 
 
 
 | 38 | 
         _logger.write(toString(), Logger.SYSINIT, "created"); | 
 
 
 
 
 
 | 39 | 
     } | 
 
 
 
 
 
 | 40 | 
   | 
 
 
 
 
 
 | 41 | 
 //---PUBLIC METHODS--- | 
 
 
 
 
 
 | 42 | 
  | 
 
 
 
 
 
 | 43 | 
     /** | 
 
 
 
 
 
 | 44 | 
      * Method to receive a string over corba. | 
 
 
 
 
 
 | 45 | 
      * | 
 
 
 
 
 
 | 46 | 
      * @param xml the String of XML to print out | 
 
 
 
 
 
 | 47 | 
      */ | 
 
 
 
 
 
 | 48 | 
     public void receiveXML(String xml) { | 
 
 
 
 
 
 | 49 | 
         for (int x = 0; x < _clientInterfaces.length; x++) { | 
 
 
 
 
 
 | 50 | 
             RootFilterThread t = new RootFilterThread(_clientInterfaces[x], xml); | 
 
 
 
 
 
 | 51 | 
             t.start(); | 
 
 
 
 
 
 | 52 | 
         } | 
 
 
 
 
 
 | 53 | 
     } | 
 
 
 
 
 
 | 54 | 
      | 
 
 
 
 
 
 | 55 | 
     /** | 
 
 
 
 
 
 | 56 | 
      * Overrides the {@link java.lang.Object#toString() Object.toString()} | 
 
 
 
 
 
 | 57 | 
      * method to provide clean logging (every class should have this). | 
 
 
 
 
 
 | 58 | 
      * | 
 
 
 
 
 
 | 59 | 
      * This uses the uk.ac.ukc.iscream.util.NameFormat class | 
 
 
 
 
 
 | 60 | 
      * to format the toString() | 
 
 
 
 
 
 | 61 | 
      * | 
 
 
 
 
 
 | 62 | 
      * @return the name of this class and its CVS revision | 
 
 
 
 
 
 | 63 | 
      */ | 
 
 
 
 
 
 | 64 | 
     public String toString() { | 
 
 
 
 
 
 | 65 | 
         return FormatName.getName( | 
 
 
 
 
 
 | 66 | 
             _name, | 
 
 
 
 
 
 | 67 | 
             getClass().getName(), | 
 
 
 
 
 
 | 68 | 
             REVISION); | 
 
 
 
 
 
 | 69 | 
     } | 
 
 
 
 
 
 | 70 | 
  | 
 
 
 
 
 
 | 71 | 
 //---PRIVATE METHODS--- | 
 
 
 
 
 
 | 72 | 
  | 
 
 
 
 
 
 | 73 | 
 //---ACCESSOR/MUTATOR METHODS--- | 
 
 
 
 
 
 | 74 | 
  | 
 
 
 
 
 
 | 75 | 
     public String getUDPPort() { | 
 
 
 
 
 
 | 76 | 
         return null; | 
 
 
 
 
 
 | 77 | 
     } | 
 
 
 
 
 
 | 78 | 
      | 
 
 
 
 
 
 | 79 | 
     public String getTCPPort() { | 
 
 
 
 
 
 | 80 | 
         return null; | 
 
 
 
 
 
 | 81 | 
     } | 
 
 
 
 
 
 | 82 | 
      | 
 
 
 
 
 
 | 83 | 
     public String getHostName() { | 
 
 
 
 
 
 | 84 | 
         return null; | 
 
 
 
 
 
 | 85 | 
     } | 
 
 
 
 
 
 | 86 | 
  | 
 
 
 
 
 
 | 87 | 
 //---ATTRIBUTES--- | 
 
 
 
 
 
 | 88 | 
  | 
 
 
 
 
 
 | 89 | 
     /** | 
 
 
 
 
 
 | 90 | 
      * This is the friendly identifier of the | 
 
 
 
 
 
 | 91 | 
      * component this class is running in. | 
 
 
 
 
 
 | 92 | 
      * eg, a Filter may be called "filter1", | 
 
 
 
 
 
 | 93 | 
      * If this class does not have an owning | 
 
 
 
 
 
 | 94 | 
      * component,  a name from the configuration | 
 
 
 
 
 
 | 95 | 
      * can be placed here.  This name could also | 
 
 
 
 
 
 | 96 | 
      * be changed to null for utility classes. | 
 
 
 
 
 
 | 97 | 
      */ | 
 
 
 
 
 
 | 98 | 
     private String _name = RootFilter.NAME; | 
 
 
 
 
 
 | 99 | 
  | 
 
 
 
 
 
 | 100 | 
     /** | 
 
 
 
 
 
 | 101 | 
      * This holds a reference to the | 
 
 
 
 
 
 | 102 | 
      * system logger that is being used. | 
 
 
 
 
 
 | 103 | 
      */ | 
 
 
 
 
 
 | 104 | 
     private Logger _logger = ReferenceManager.getInstance().getLogger(); | 
 
 
 
 
 
 | 105 | 
      | 
 
 
 
 
 
 | 106 | 
     /** | 
 
 
 
 
 
 | 107 | 
      * An array of client interface that incoming | 
 
 
 
 
 
 | 108 | 
      * data should be passed to | 
 
 
 
 
 
 | 109 | 
      */    | 
 
 
 
 
 
 | 110 | 
     private ClientInterface[] _clientInterfaces; | 
 
 
 
 
 
 | 111 | 
      | 
 
 
 
 
 
 | 112 | 
 //---STATIC ATTRIBUTES--- | 
 
 
 
 
 
 | 113 | 
  | 
 
 
 
 
 
 | 114 | 
 } |