Methods Summary |
---|
protected DottedNameQuery | createQuery()
return( mQuery );
|
public javax.management.Attribute | doSet(java.lang.String pair)
final int delimIndex = pair.indexOf( ASSIGNMENT_DELIM );
final boolean delete = delimIndex < 0;
// if there is no value delimiter ('='), this means to delete the property
// this is only supported for properties however
final String dottedNameString = delete ? pair : pair.substring( 0, delimIndex );
final String valueString = delete ? null : pair.substring( delimIndex + 1, pair.length() );
final Attribute attr = doSet( dottedNameString, valueString );
return( attr );
|
public javax.management.Attribute | doSet(java.lang.String dottedNameString, java.lang.String value)
// NOTE: this name includes the value-name
final DottedName dn = getDottedName( dottedNameString );
if ( dn.isWildcardName() )
{
final String msg = DottedNameStrings.getString(
DottedNameStrings.WILDCARD_DISALLOWED_FOR_SET_KEY,
dottedNameString );
throw new IllegalArgumentException( msg );
}
ObjectName target = null;
final DottedNameForValue dnv = new DottedNameForValue( dn );
if ( isDottedNameForServerName( dnv.getPrefix(), dnv.getValueName() ) )
{
// YUCK special case "server.name" or otherwise the attribute will
// be set on the config
target = getRegistry().dottedNameToObjectName( dnv.getPrefix().toString() );
}
else
{
target = getTarget( dnv, getResolver( ) );
}
final Attribute inAttr = new Attribute( dnv.getValueName(), value );
Attribute resultAttr = mValueAccessor.setValue( target, inAttr );
// special meaning of result with null value is that it has been deleted (yuck)
// in this case, it is not added to the output list
if ( resultAttr != null && resultAttr.getValue() != null )
{
final String fullName = dnv.getPrefix() + "." + inAttr.getName();
resultAttr = new Attribute( fullName, resultAttr.getValue() );
}
return( resultAttr );
|
public java.lang.Object[] | dottedNameSet(java.lang.String[] nameValuePairs)
final int numItems = nameValuePairs.length;
// make a new array of sorted input pairs
// do this first, because resulting output may contain a mix of type--
// Attribute or Exception making it hard to sort properly.
final String [] sortedPairs = new String [ numItems ];
for( int i = 0; i < numItems; ++i )
{
sortedPairs[ i ] = nameValuePairs[ i ];
}
Arrays.sort( sortedPairs );
final Object [] results = new Object [ sortedPairs.length ];
for( int i = 0; i < numItems; ++i )
{
results[ i ] = dottedNameSet( sortedPairs[ i ] );
}
return( results );
|
protected java.lang.Object | dottedNameSet(java.lang.String nameValuePair)
Object result = null;
try
{
result = doSet( nameValuePair );
}
catch( Exception e )
{
// the result will be the exception itself
logException( e );
result = e;
}
assert( result != null );
return( result );
|
protected javax.management.Attribute | formAttribute(DottedName prefix, java.lang.String valueName, java.lang.Object value)
// default behavior
Attribute attr = super.formAttribute( prefix, valueName, value );
try
{
// Is it a special case for server.xxx which is into 'server' itself?
if ( isDottedNameForServerName( prefix, valueName ) )
{
// <server>.name value has been set to <config>.name value
// skip the aliasing and get the name from the server object
final ObjectName objectName = getRegistry().dottedNameToObjectName( prefix.getScope() );
final Attribute newAttr = mValueAccessor.getValue( objectName, valueName );
assert( newAttr != null );
attr = super.formAttribute( prefix, valueName, newAttr.getValue() );
}
}
catch( Exception e)
{
logException( e );
}
return( attr );
|
protected DottedNameResolver | getResolver()
return( mResolver );
|
protected boolean | isDottedNameForServerName(DottedName prefix, java.lang.String valueName)
return( valueName.equals( "name" ) &&
isServerName( prefix.getScope() ) && // these tests make sure it's just "<server>.name"
prefix.getParts().size() == 0 );
|
boolean | isServerName(java.lang.String name)
boolean isServerName = false;
isServerName = mServerInfo.getServerNames().contains( name );
return( isServerName );
|