View Javadoc

1   // Autogenerated Jamon proxy
2   // /home/stack/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
3   
4   package org.apache.hadoop.hbase.tmpl.regionserver;
5   
6   // 24, 9
7   import java.util.*;
8   // 25, 9
9   import org.apache.hadoop.hbase.regionserver.HRegionServer;
10  // 26, 9
11  import org.apache.hadoop.hbase.util.Bytes;
12  // 27, 9
13  import org.apache.hadoop.hbase.HRegionInfo;
14  // 28, 9
15  import org.apache.hadoop.hbase.ServerName;
16  // 29, 9
17  import org.apache.hadoop.hbase.HBaseConfiguration;
18  // 30, 9
19  import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
20  // 31, 9
21  import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
22  // 32, 9
23  import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad;
24  
25  @org.jamon.annotations.Template(
26    signature = "453B1D06C1C069660F1255077D1DC0CE",
27    requiredArguments = {
28      @org.jamon.annotations.Argument(name = "regionServer", type = "HRegionServer"),
29      @org.jamon.annotations.Argument(name = "onlineRegions", type = "List<HRegionInfo>")})
30  public class RegionListTmpl
31    extends org.jamon.AbstractTemplateProxy
32  {
33    
34    public RegionListTmpl(org.jamon.TemplateManager p_manager)
35    {
36       super(p_manager);
37    }
38    
39    public RegionListTmpl()
40    {
41       super("/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl");
42    }
43    
44    protected interface Intf
45      extends org.jamon.AbstractTemplateProxy.Intf{
46      
47      void renderNoFlush(final java.io.Writer jamonWriter) throws java.io.IOException;
48      
49    }
50    public static class ImplData
51      extends org.jamon.AbstractTemplateProxy.ImplData
52    {
53      // 20, 9
54      public void setRegionServer(HRegionServer regionServer)
55      {
56        // 20, 9
57        m_regionServer = regionServer;
58      }
59      public HRegionServer getRegionServer()
60      {
61        return m_regionServer;
62      }
63      private HRegionServer m_regionServer;
64      // 21, 9
65      public void setOnlineRegions(List<HRegionInfo> onlineRegions)
66      {
67        // 21, 9
68        m_onlineRegions = onlineRegions;
69      }
70      public List<HRegionInfo> getOnlineRegions()
71      {
72        return m_onlineRegions;
73      }
74      private List<HRegionInfo> m_onlineRegions;
75    }
76    @Override
77    protected ImplData makeImplData()
78    {
79      return new ImplData();
80    }
81    @Override @SuppressWarnings("unchecked") public ImplData getImplData()
82    {
83      return (ImplData) super.getImplData();
84    }
85    
86    
87    @Override
88    public org.jamon.AbstractTemplateImpl constructImpl(Class<? extends org.jamon.AbstractTemplateImpl> p_class){
89      try
90      {
91        return p_class
92          .getConstructor(new Class [] { org.jamon.TemplateManager.class, ImplData.class })
93          .newInstance(new Object [] { getTemplateManager(), getImplData()});
94      }
95      catch (RuntimeException e)
96      {
97        throw e;
98      }
99      catch (Exception e)
100     {
101       throw new RuntimeException(e);
102     }
103   }
104   
105   @Override
106   protected org.jamon.AbstractTemplateImpl constructImpl(){
107     return new RegionListTmplImpl(getTemplateManager(), getImplData());
108   }
109   public org.jamon.Renderer makeRenderer(final HRegionServer regionServer, final List<HRegionInfo> onlineRegions)
110   {
111     return new org.jamon.AbstractRenderer() {
112       @Override
113       public void renderTo(final java.io.Writer jamonWriter)
114         throws java.io.IOException
115       {
116         render(jamonWriter, regionServer, onlineRegions);
117       }
118     };
119   }
120   
121   public void render(final java.io.Writer jamonWriter, final HRegionServer regionServer, final List<HRegionInfo> onlineRegions)
122     throws java.io.IOException
123   {
124     renderNoFlush(jamonWriter, regionServer, onlineRegions);
125     jamonWriter.flush();
126   }
127   public void renderNoFlush(final java.io.Writer jamonWriter, final HRegionServer regionServer, final List<HRegionInfo> onlineRegions)
128     throws java.io.IOException
129   {
130     ImplData implData = getImplData();
131     implData.setRegionServer(regionServer);
132     implData.setOnlineRegions(onlineRegions);
133     Intf instance = (Intf) getTemplateManager().constructImpl(this);
134     instance.renderNoFlush(jamonWriter);
135     reset();
136   }
137   
138   
139 }