1 19 20 package org.apache.excalibur.instrument.manager.impl; 21 22 import org.apache.excalibur.instrument.manager.InstrumentDescriptor; 23 import org.apache.excalibur.instrument.manager.InstrumentableDescriptor; 24 import org.apache.excalibur.instrument.manager.NoSuchInstrumentException; 25 import org.apache.excalibur.instrument.manager.NoSuchInstrumentableException; 26 27 35 public class InstrumentableDescriptorImpl 36 implements InstrumentableDescriptor 37 { 38 39 private InstrumentableProxy m_instrumentableProxy; 40 41 44 49 InstrumentableDescriptorImpl( InstrumentableProxy instrumentableProxy ) 50 { 51 m_instrumentableProxy = instrumentableProxy; 52 } 53 54 57 63 public boolean isConfigured() 64 { 65 return m_instrumentableProxy.isConfigured(); 66 } 67 68 74 public boolean isRegistered() 75 { 76 return m_instrumentableProxy.isRegistered(); 77 } 78 79 87 public String getName() 88 { 89 return m_instrumentableProxy.getName(); 90 } 91 92 97 public String getDescription() 98 { 99 return m_instrumentableProxy.getDescription(); 100 } 101 102 108 public InstrumentableDescriptor getParentInstrumentableDescriptor() 109 { 110 InstrumentableProxy parent = m_instrumentableProxy.getParentInstrumentableProxy(); 111 if ( parent == null ) 112 { 113 return null; 114 } 115 else 116 { 117 return parent.getDescriptor(); 118 } 119 } 120 121 133 public InstrumentableDescriptor getChildInstrumentableDescriptor( 134 String childInstrumentableName ) 135 throws NoSuchInstrumentableException 136 { 137 InstrumentableProxy instrumentableProxy = 138 m_instrumentableProxy.getChildInstrumentableProxy( childInstrumentableName ); 139 if( instrumentableProxy == null ) 140 { 141 throw new NoSuchInstrumentableException( 142 "No child instrumentable can be found using name: " + childInstrumentableName ); 143 } 144 145 return instrumentableProxy.getDescriptor(); 146 } 147 148 155 public InstrumentableDescriptor[] getChildInstrumentableDescriptors() 156 { 157 return m_instrumentableProxy.getChildInstrumentableDescriptors(); 158 } 159 160 170 public InstrumentDescriptor getInstrumentDescriptor( String instrumentName ) 171 throws NoSuchInstrumentException 172 { 173 InstrumentProxy instrumentProxy = 174 m_instrumentableProxy.getInstrumentProxy( instrumentName ); 175 if( instrumentProxy == null ) 176 { 177 throw new NoSuchInstrumentException( 178 "No instrument can be found using name: " + instrumentName ); 179 } 180 181 return instrumentProxy.getDescriptor(); 182 } 183 184 191 public InstrumentDescriptor[] getInstrumentDescriptors() 192 { 193 return m_instrumentableProxy.getInstrumentDescriptors(); 194 } 195 196 205 public int getStateVersion() 206 { 207 return m_instrumentableProxy.getStateVersion(); 208 } 209 } 210 | Popular Tags |