OfflineDottedNamesRegistry.javaAPI DocGlassfish v2 API4851Fri May 04 22:23:40 BST


public final class OfflineDottedNamesRegistry extends Object

Fields Summary
private Map
Maps from dotted name prefxi to ObjectName
private Map
Maps from ObjectName to all dotted name prefixes.
private Map
The legal attribute names
Constructors Summary
public OfflineDottedNamesRegistry()

	    mPrefixToObjectName   = new HashMap<String,ObjectName>();
	    mObjectNameToPrefix   = new HashMap<ObjectName,String>();
	    mLegalAttributes      = new HashMap<ObjectName,Set<String>>();
Methods Summary
public synchronized voidaddMapping( objectName, java.lang.String prefix, java.util.Set legalAttributes)
Add a mapping from an ObjectName to its dotted name prefixes.

objectName the ObjectName in question
prefix one or more prefixes associated with this ObjectName
legalAttributes the legal attributes, as found in the MBeanInfo of the ObjectName

	    if ( objectName == null || prefix == null )
	        throw new IllegalArgumentException( "null" );
	    if ( mObjectNameToPrefix.containsKey( objectName ) )
	        throw new IllegalArgumentException( "Already registered: " + objectName );
	    mObjectNameToPrefix.put( objectName, prefix );
	    mPrefixToObjectName.put( prefix, objectName );
	    mLegalAttributes.put( objectName, Collections.unmodifiableSet( legalAttributes ) );
public java.util.SetgetLegalAttributes( objectName)

	    return mLegalAttributes.get( objectName );
public prefix)

	    return mPrefixToObjectName.get( prefix );
public java.util.SetgetObjectNames()

	    final Set<ObjectName>   result  = new HashSet<ObjectName>();
	    result.addAll( mObjectNameToPrefix.keySet() );
	    return result;
public java.lang.StringgetPrefix( objectName)

	    return mObjectNameToPrefix.get( objectName );
public java.util.SetgetPrefixes()

	    final Set<String>   result  = new HashSet<String>();
	    result.addAll( mObjectNameToPrefix.values() );
	    return result;
public synchronized voidremoveMapping( objectName)

	    final String  prefix    = mObjectNameToPrefix.get( objectName );
	    if ( prefix != null )
	        mObjectNameToPrefix.remove( objectName );
	        mLegalAttributes.remove( objectName );
            mPrefixToObjectName.remove( prefix );