Methods Summary |
---|
protected final java.lang.String | _getDefaultValue(java.lang.String mappedName)
checkSupported( mappedName );
final String unmappedName = mAttributeNameMapper.derivedToOriginal( mappedName );
return( mDelegate.getDefaultValue( unmappedName ) );
|
private void | checkSupported(java.lang.String mappedName)
if ( ! supportsAttribute( mappedName ) )
{
debug( "Attribute " + mappedName + " is not supported, have: " +
CollectionUtil.toString( mAttributeNameMapper.getDerivedNames(), ", ") );
throw new AttributeNotFoundException( mappedName );
}
|
protected java.lang.String | derivedToOriginal(java.lang.String mappedName)Get the unmapped name for a mapped Attribute name. If the name has
not been mapped, it is returned unchanged.
return( mAttributeNameMapper.derivedToOriginal( mappedName ) );
|
private javax.management.Attribute | derivedToOriginal(javax.management.Attribute mappedAttr)Return the unmapped version of an mapped Attribute.
final String unmappedName = derivedToOriginal( mappedAttr.getName() );
return( new Attribute( unmappedName, mappedAttr.getValue() ) );
|
protected java.lang.String[] | derivedToOriginal(java.lang.String[] mappedNames)Call derivedToOriginal( name ) for each mapped name.
final String[] unmappedNames = new String[ mappedNames.length ];
for( int i = 0; i < unmappedNames.length; ++i )
{
unmappedNames[ i ] = derivedToOriginal( mappedNames[ i ] );
}
return( unmappedNames );
|
protected javax.management.AttributeList | derivedToOriginal(javax.management.AttributeList mappedAttrs)
// first, create a new list which uses the unmapped names
final int numAttrs = mappedAttrs.size();
final AttributeList unmappedAttrs = new AttributeList();
for( int i = 0; i < numAttrs; ++i )
{
unmappedAttrs.add( derivedToOriginal( (Attribute)mappedAttrs.get( i ) ) );
}
return( unmappedAttrs );
|
public java.lang.Object | getAttribute(java.lang.String mappedName)
checkSupported( mappedName );
final String unmappedName = mAttributeNameMapper.derivedToOriginal( mappedName );
return( mDelegate.getAttribute( unmappedName ) );
|
public java.lang.String[] | getAttributeNames()
final String[] names =
JMXUtil.getAttributeNames( getMBeanInfo().getAttributes() );
return( names );
|
public javax.management.AttributeList | getAttributes(java.lang.String[] mappedNames)
final AttributeList unmappedResults =
mDelegate.getAttributes( derivedToOriginal( mappedNames ) );
return( originalToDerived( unmappedResults ) );
|
public javax.management.MBeanInfo | getMBeanInfo()
return( getMappedMBeanInfo() );
|
protected javax.management.MBeanInfo | getMappedMBeanInfo()
return( mMappedMBeanInfo );
|
protected javax.management.MBeanInfo | getUnmappedMBeanInfo()
return( mUnmappedMBeanInfo );
|
protected javax.management.MBeanInfo | getUnmappedMBeanInfoFresh()
return( mDelegate.getMBeanInfo( ) );
|
public final java.lang.Object | invoke(java.lang.String operationName, java.lang.Object[] args, java.lang.String[] types)Just pass it along to the Delegate
final Object result = mDelegate.invoke( operationName, args, types );
return( result );
|
private javax.management.MBeanAttributeInfo | mapAttributeInfo(javax.management.MBeanAttributeInfo unmappedInfo)
String mappedName = originalToDerived( unmappedInfo.getName() );
if ( mappedName == null )
{
mappedName = unmappedInfo.getName();
}
final MBeanAttributeInfo mappedInfo =
new MBeanAttributeInfo(
mappedName,
unmappedInfo.getType(),
unmappedInfo.getDescription(),
unmappedInfo.isReadable(),
unmappedInfo.isWritable(),
unmappedInfo.isIs()
);
return( mappedInfo );
|
private javax.management.MBeanAttributeInfo[] | mapAttributeInfos(javax.management.MBeanAttributeInfo[] unmappedInfos)
final MBeanAttributeInfo[] mappedInfos =
new MBeanAttributeInfo[ unmappedInfos.length ];
for ( int i = 0; i < unmappedInfos.length; ++i )
{
final String attrName = unmappedInfos[ i ].getName();
assert( attrName != null );
mappedInfos[ i ] = mapAttributeInfo( unmappedInfos[ i ] );
assert( mappedInfos[ i ].getName() != null );
debug( "Mapped " + unmappedInfos[ i ].getName() + " to " + mappedInfos[i].getName() );
}
return( mappedInfos );
|
private javax.management.MBeanInfo | mapMBeanInfo(javax.management.MBeanInfo unmappedMBeanInfo)Create an MBeanInfo which contains the mapped names.
final MBeanAttributeInfo[] mappedAttributeInfos =
mapAttributeInfos( unmappedMBeanInfo.getAttributes() );
final MBeanInfo mappedInfo = new MBeanInfo(
unmappedMBeanInfo.getClassName(),
unmappedMBeanInfo.getDescription(),
mappedAttributeInfos,
unmappedMBeanInfo.getConstructors(),
unmappedMBeanInfo.getOperations(),
unmappedMBeanInfo.getNotifications()
);
return( mappedInfo );
|
private java.lang.String | originalToDerived(java.lang.String unmappedName)Get the mapped name for an unmapped name. If the name has
not been mapped, it is returned unchanged.
return( mAttributeNameMapper.originalToDerived( unmappedName ) );
|
private javax.management.Attribute | originalToDerived(javax.management.Attribute unmappedAttr)
final String mappedName = originalToDerived( unmappedAttr.getName() );
return( new Attribute( mappedName, unmappedAttr.getValue() ) );
|
protected javax.management.AttributeList | originalToDerived(javax.management.AttributeList unmappedAttrs)
// first, create a new list which uses the unmapped names
final int numAttrs = unmappedAttrs.size();
final AttributeList mappedAttrs = new AttributeList();
for( int i = 0; i < numAttrs; ++i )
{
mappedAttrs.add( originalToDerived( (Attribute)unmappedAttrs.get( i ) ) );
}
return( unmappedAttrs );
|
public void | setAttribute(javax.management.Attribute mappedAttr)
checkSupported( mappedAttr.getName() );
final Attribute unmappedAttr = derivedToOriginal( mappedAttr );
mDelegate.setAttribute( unmappedAttr );
|
public javax.management.AttributeList | setAttributes(javax.management.AttributeList mappedAttrs)
// first, create a new list which uses the unmapped names
final AttributeList unmappedAttrs = derivedToOriginal( mappedAttrs );
// get the Attributes using the unmapped names
final AttributeList unmappedResults =
mDelegate.setAttributes( unmappedAttrs );
return( originalToDerived( unmappedResults ) );
|
public boolean | supportsAttribute(java.lang.String mappedName)
return( mAttributeNameMapper.getDerivedNames().contains( mappedName ) );
|