FileDocCategorySizeDatePackage
OldTypesBase.javaAPI DocGlassfish v2 API5547Fri May 04 22:23:42 BST 2007com.sun.enterprise.management.support

OldTypesBase

public abstract class OldTypesBase extends Object implements OldTypeToJ2EETypeMapper
Maps an AMX j2eeType to/from and "old" (8.0) type. See {@link com.sun.appserv.management.base.XTypes}

Fields Summary
final Map
mOldTypeToJ2EETypeMap
final Map
mJ2EETypeToOldTypeMap
public static final String
OLD_TYPE_PROP
Constructors Summary
OldTypesBase()

		mOldTypeToJ2EETypeMap	= new HashMap<String,String>();
		mJ2EETypeToOldTypeMap	= new HashMap<String,String>();
		initMap();
	
Methods Summary
voidadd(java.lang.String j2eeType, java.lang.String oldType)

		mOldTypeToJ2EETypeMap.put( oldType, j2eeType );
		mJ2EETypeToOldTypeMap.put( j2eeType, oldType );
	
abstract voidinitMap()
These are delegates that require a config name only, no other keys other than category=config

public java.lang.Stringj2eeTypeToOldType(java.lang.String j2eeType)

		return mJ2EETypeToOldTypeMap.get( j2eeType );
	
public java.lang.StringoldObjectNameToJ2EEType(javax.management.ObjectName oldObjectName)
Determine the j2eeType associated with the ObjectName for an "old" config MBean

param
oldObjectName

		final String	oldType	= oldObjectName.getKeyProperty( OLD_TYPE_PROP );
		if ( oldType == null )
		{
			System.err.println( "no j2eeType for: " + oldObjectName );
			throw new IllegalArgumentException( oldObjectName.toString() );
		}
		
		String	j2eeType	= null;
	
	/*
		if ( oldType.equals( "ssl" ) )
		{
			// ambiguous without parent
			if ( oldObjectName.getKeyProperty( "ssl-client-config" ) != null )
			{
				j2eeType	= XTypes.IIOP_SSL_CLIENT_CONFIG;
			}
			else
			{
				j2eeType	= XTypes.SSL_CONFIG;
			}
		}
		else
	*/
		{
			j2eeType = mOldTypeToJ2EETypeMap.get( oldType );
			if ( j2eeType == null )
			{
				throw new IllegalArgumentException( oldType );
			}
		}
		
		assert( j2eeType != null );
		return( j2eeType );
	
public java.util.MapoldPropsToNewProps(java.util.Map oldProps)

		final Map<String,String> newProps = new HashMap<String,String>();
		for( final String oldProp : oldProps.keySet() )
		{
			final String newProp	=mOldTypeToJ2EETypeMap.get( oldProp );
			if ( newProp != null )
			{
				newProps.put( newProp, oldProps.get( oldProp ) );
			}
		}
		return newProps;
	
public java.lang.StringoldTypeToJ2EEType(java.lang.String oldType, javax.management.ObjectName oldObjectName)
Determine the j2eeType associated with the ObjectName for an "old" config MBean

param
oldObjectName

		String j2eeType	= null;
		
		if ( oldType.equals( oldObjectName.getKeyProperty( OLD_TYPE_PROP ) ) )
		{
			j2eeType	= oldObjectNameToJ2EEType( oldObjectName );
		}
		else
		{
			j2eeType	= mOldTypeToJ2EETypeMap.get( oldType );
		}
		return( j2eeType );
	
public java.lang.StringoldTypeToJ2EEType(javax.management.ObjectName objectName)
By default, the mapping is done using only the OLD_TYPE_PROP field.

	
			          	 
		 
	    
	
		return oldTypeToJ2EEType( objectName.getKeyProperty( OLD_TYPE_PROP ) );
	
public java.lang.StringoldTypeToJ2EEType(java.lang.String oldType)

		return mOldTypeToJ2EETypeMap.get(oldType);