1 50 package org.apache.excalibur.instrument; 51 52 60 public abstract class AbstractInstrument 61 implements Instrument 62 { 63 64 private String m_name; 65 66 67 private InstrumentProxy m_proxy; 68 69 72 78 protected AbstractInstrument( String name ) 79 { 80 m_name = name; 81 } 82 83 86 94 public String getInstrumentName() 95 { 96 return m_name; 97 } 98 99 102 113 public void setInstrumentProxy( InstrumentProxy proxy ) 114 { 115 if( m_proxy != null ) 116 { 117 throw new IllegalStateException ( 118 "Once an InstrumentProxy has been set, it can not be changed." ); 119 } 120 m_proxy = proxy; 121 } 122 123 129 public boolean isActive() 130 { 131 return ( m_proxy != null ) && ( m_proxy.isActive() ); 132 } 133 134 140 protected InstrumentProxy getInstrumentProxy() 141 { 142 return m_proxy; 143 } 144 } 145 | Popular Tags |