FileDocCategorySizeDatePackage
AnyValueAccessor.javaAPI DocGlassfish v2 API4068Fri May 04 22:24:08 BST 2007com.sun.enterprise.admin.dottedname.valueaccessor

AnyValueAccessor

public class AnyValueAccessor extends ValueAccessorBase

Fields Summary
final ValueAccessor
mAttributeAccessor
Constructors Summary
public AnyValueAccessor(MBeanServerConnection conn)

		super( conn );
		
		mAttributeAccessor	= new AttributeValueAccessor( conn );
	
Methods Summary
public javax.management.AttributegetValue(javax.management.ObjectName objectName, java.lang.String valueName)

		Attribute	attr	= null;
		PropertyValueAccessorBase propertyAccessor= 
                 (new PrefixedValueSupport(getMBS()).getPrefixedValueAccessor(valueName));
		if ( propertyAccessor!=null )
		{
			attr	= propertyAccessor.getValue( objectName, 
                      propertyAccessor.extractPrefixedValueName(valueName) );
		}
		else
		{
			attr	= mAttributeAccessor.getValue( objectName, valueName );
		}
		
		return( attr );
	
public javax.management.AttributesetValue(javax.management.ObjectName objectName, javax.management.Attribute attr)

		Attribute	resultAttr	= null;
		
		final String	valueName	= attr.getName();
		PropertyValueAccessorBase propertyAccessor= 
                 (new PrefixedValueSupport(getMBS()).getPrefixedValueAccessor(valueName));
        if ( propertyAccessor!=null )
		{
			final String	propertyName = propertyAccessor.extractPrefixedValueName(valueName);
			final Attribute	newAttr	= new Attribute( propertyName, attr.getValue() );
			resultAttr	= propertyAccessor.setValue( objectName, newAttr );
		}
		else
		{
			resultAttr	= mAttributeAccessor.setValue( objectName, attr );
		}
		
		return( resultAttr );