1 19 20 package org.apache.excalibur.instrument.client.http; 21 22 import java.io.UnsupportedEncodingException ; 23 import java.net.URLEncoder ; 24 25 import org.apache.avalon.framework.configuration.Configuration; 26 import org.apache.avalon.framework.configuration.ConfigurationException; 27 import org.apache.avalon.framework.logger.AbstractLogEnabled; 28 29 import org.apache.excalibur.instrument.client.Data; 30 import org.apache.excalibur.instrument.client.ElementData; 31 32 38 abstract class AbstractHTTPElementData 39 extends AbstractHTTPData 40 implements ElementData 41 { 42 43 private AbstractHTTPData m_parent; 44 45 46 private String m_name; 47 48 49 private boolean m_configured; 50 51 54 57 protected static String lastNameToken( String name ) 58 { 59 int pos = name.lastIndexOf( '.' ); 60 if ( pos >= 0 ) 61 { 62 return name.substring( pos + 1 ); 63 } 64 else 65 { 66 return name; 67 } 68 } 69 70 73 80 protected AbstractHTTPElementData( HTTPInstrumentManagerConnection connection, 81 AbstractHTTPData parent, 82 String name ) 83 { 84 super( connection, lastNameToken( name ) ); 85 m_parent = parent; 86 m_name = name; 87 m_configured = false; 88 } 89 90 93 98 public Data getParent() 99 { 100 return m_parent; 101 } 102 103 108 public String getName() 109 { 110 return m_name; 111 } 112 113 118 public boolean isConfigured() 119 { 120 return m_configured; 121 } 122 123 126 133 protected void update( Configuration configuration ) 134 throws ConfigurationException 135 { 136 super.update( configuration ); 137 138 m_configured = configuration.getAttributeAsBoolean( "configured", false ); 139 } 140 } 141 | Popular Tags |