processDataFromConnection_asXML(str_buf.toString());
processDataFromConnection_asHTML(str_buf);
    public void execute() {        if( first_time ){           FDSProxy fds = new FDSProxy();           NameService myNameServiceProvider = new ProxyMapAdapter( fds );           myConnectionManager = new ConnectionManager(                   new ConnectionLogger(),                   ConfigFileName,                   myNameServiceProvider);           myConnectionManager.connectAllAsynchronous();           first_time = false;        }        //        // visit all connections, HARVEST DATA, and recycle any which        // may have failed and or are down (ie. non keep-alive)        //        List data = myConnectionManager.cycleAllAsynchronousConnections(true);        System.out.println("[AggregatorPlugin] total data List size=" + data.size());        Iterator it = data.iterator();        while (it.hasNext() ) {            Object obj = it.next();            StringBuffer str_buf = null;            if( obj instanceof StringBuffer ) {                 str_buf = ((StringBuffer)obj);            }            /**            int substr_index =-1;            if( str.length() > 6 ) {               substr_index = str.substring(0,5).toLowerCase().indexOf(" <?xml");            }            if( substr_index > -1 )            {               System.out.println("Is XML");            **/            if( isHTML(str_buf) ) {                // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                // ASSUME HTML! - GO TO IT!                // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                processDataFromConnection_asHTML(str_buf);            }            else {                // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                // ASSUME XML - GO TO IT!                // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                processDataFromConnection_asXML(str_buf.toString());            }            /**               try{                    //ByteArrayInputStream bais = new ByteArrayInputStream(str.getBytes());                    //InputSource is = new InputSource(bais);                    StringReader sr = new StringReader(str.trim());                    InputSource is = new InputSource(sr);                    //System.err.println("str=" + str);                    //FileReader freader = new FileReader("task.xml");                    //InputSource is = new InputSource(freader);                    DOMParser domp = new DOMParser();                    domp.setErrorHandler(new ErrorHandler(){                          public void error(SAXParseException exception) {                             System.err.println("[ErrorHandler.error]: " + exception);                           }                           public void fatalError(SAXParseException exception) {                                 System.err.println("[ErrorHandler.fatalError]: " + exception);                           }                           public void warning(SAXParseException exception) {                                 System.err.println("[ErrorHandler.warning]: " + exception);                            }                        }                    );                    domp.parse(is);                    Document doc = domp.getDocument();                    System.out.println("Is XML");                    if( doc != null ) {                       PlanObject p = new PlanObject(doc);                       publishAdd(p);                    }                } catch ( SAXParseException sax) {                    //                    // if we see this, assume this is not valid XML                    //                    System.out.println("Not XML");                    System.out.println("\n[AggregatorPlugin] data=" + str + "\n");                } catch (Exception ex ){                    ex.printStackTrace();                }            **/                        /**            }else {                System.out.println("Not XML");                System.out.println("[AggregatorPlugin] data=" + str);            }            **/            System.out.println("[AggregatorPlugin] data len=" + str_buf.length());        }        /**        for(Enumeration e = mySubscription.getAddedList(); e.hasMoreElements();)        {        }        **/        this.wakeAfter(POLL_INTERVAL);    }