Methods Summary |
---|
private java.lang.Object | _getAttribute(java.lang.String name)
final Object value = mSource.getValue( name );
return( value );
|
private javax.management.MBeanAttributeInfo | createAttrInfo(java.lang.String attrName)
final MBeanAttributeInfo info = new MBeanAttributeInfo(
attrName,
mSource.getAttributeType( attrName ).getName(),
"",
true, false, false );
return( info );
|
private javax.management.MBeanAttributeInfo[] | createAttrInfos()
final ArrayList list = new ArrayList();
final Set attrNames = mSource.getAttributeNames();
final Iterator iter = attrNames.iterator();
while ( iter.hasNext() )
{
final String attrName = (String)iter.next();
try
{
final MBeanAttributeInfo info = createAttrInfo( attrName );
list.add( info );
}
catch( IllegalArgumentException e )
{
// don't add it, but continue
//System.out.println( "createAttrInfos: illegal Attribute name: " + attrNames[ i ]);
}
}
final MBeanAttributeInfo [] infos = new MBeanAttributeInfo [ list.size() ];
list.toArray( infos );
return( infos );
|
private javax.management.MBeanOperationInfo[] | createOperationInfos()
final MBeanOperationInfo [] infos = new MBeanOperationInfo[ 1 ];
try
{
final Method m = this.getClass().getDeclaredMethod( "refresh", null);
infos[ 0 ] = new MBeanOperationInfo(
"refresh all attributes for " + mSource.getScopedName(),
m );
}
catch( NoSuchMethodException e )
{
assert( false );
}
return( infos );
|
public java.lang.Object | getAttribute(java.lang.String name)
return( _getAttribute( name ) );
|
public javax.management.AttributeList | getAttributes(java.lang.String[] names)
final AttributeList list = new AttributeList();
for( int i = 0; i < names.length; ++i )
{
final Object value = _getAttribute( names[ i ] );
if ( value != null )
{
list.add( new Attribute( names[ i ], value ) );
}
}
return( list );
|
public synchronized javax.management.MBeanInfo | getMBeanInfo()
if ( mMBeanInfo == null )
{
final MBeanAttributeInfo [] attrInfo = createAttrInfos();
final MBeanOperationInfo [] operationInfo = createOperationInfos();
final MBeanConstructorInfo [] constructorInfo = new MBeanConstructorInfo[0];
final MBeanNotificationInfo [] notificationInfo = new MBeanNotificationInfo[0];
final MBeanInfo info = new MBeanInfo(
this.getClass().getName(),
mSource.getScopedName(),
attrInfo,
constructorInfo,
operationInfo,
notificationInfo );
mMBeanInfo = info;
}
return( mMBeanInfo );
|
private java.lang.Object | internalInvoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
Object result = null;
if ( actionName.equals( "refresh" ) )
{
refresh();
}
else
{
throw new OperationsException( "No such method: " + actionName );
}
return( result );
|
public java.lang.Object | invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
Object result = null;
try
{
result = internalInvoke( actionName, params, signature );
}
catch( MBeanException e )
{
throw e;
}
catch( ReflectionException e )
{
throw e;
}
catch( Exception e )
{
throw new MBeanException( e );
}
return( result );
|
public void | refresh()
mMgr.refresh( mSource.getScopedName() );
|
public void | setAttribute(javax.management.Attribute attr)
throw new java.lang.UnsupportedOperationException( "can't set kstat value" );
|
public javax.management.AttributeList | setAttributes(javax.management.AttributeList names)
throw new java.lang.UnsupportedOperationException( "can't set kstat value" );
|