Package org.apache.solr.core

Examples of org.apache.solr.core.SolrInfoMBean


   
    int checked = 0;
    for( Class clazz : classes ) {
      if( SolrInfoMBean.class.isAssignableFrom( clazz ) ) {
        try {
          SolrInfoMBean info = (SolrInfoMBean)clazz.newInstance();
         
          //System.out.println( info.getClass() );
          assertNotNull( info.getName() );
          assertNotNull( info.getDescription() );
          assertNotNull( info.getSource() );
          assertNotNull( info.getSourceId() );
          assertNotNull( info.getVersion() );
          assertNotNull( info.getCategory() );

          if( info instanceof LRUCache ) {
            continue;
          }
         
          assertNotNull( info.toString() );
          // increase code coverage...
          assertNotNull( info.getDocs() + "" );
          assertNotNull( info.getStatistics()+"" );
          checked++;
        }
        catch( InstantiationException ex ) {
          // expected...
          //System.out.println( "unable to initalize: "+clazz );
View Full Code Here


      SimpleOrderedMap<Object> category = new SimpleOrderedMap<Object>();
      list.add( cat.name(), category );
      Map<String, SolrInfoMBean> reg = SolrInfoRegistry.getRegistry();
      synchronized(reg) {
        for (Map.Entry<String,SolrInfoMBean> entry : reg.entrySet()) {
          SolrInfoMBean m = entry.getValue();
          if (m.getCategory() != cat) continue;
     
          String na = "Not Declared";
          SimpleOrderedMap<Object> info = new SimpleOrderedMap<Object>();
          category.add( entry.getKey(), info );
         
          info.add( "name",        (m.getName()       !=null ? m.getName()        : na) );
          info.add( "version",     (m.getVersion()    !=null ? m.getVersion()     : na) );
          info.add( "description", (m.getDescription()!=null ? m.getDescription() : na) );
         
          info.add( "sourceId",    (m.getSourceId()   !=null ? m.getSourceId()    : na) );
          info.add( "source",      (m.getSource()     !=null ? m.getSource()      : na) );
       
          URL[] urls = m.getDocs();
          if ((urls != null) && (urls.length > 0)) {
            ArrayList<String> docs = new ArrayList<String>(urls.length);
            for( URL u : urls ) {
              docs.add( u.toExternalForm() );
            }
            info.add( "docs", docs );
          }
       
          if( stats ) {
            info.add( "stats", m.getStatistics() );
          }
        }
      } 
    }
    return list;
View Full Code Here

TOP

Related Classes of org.apache.solr.core.SolrInfoMBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.