Methods Summary |
---|
public void | addChildJ2EEType(java.lang.String j2eeType)
assert( ! j2eeType.equals( getJ2EEType() ) );
assert( ! mNonChildJ2EETypes.contains( j2eeType ) );
mChildJ2EETypes.add( j2eeType );
|
public void | addContaineeJ2EEType(java.lang.String j2eeType)
assert( ! j2eeType.equals( getJ2EEType() ) );
assert( ! mChildJ2EETypes.contains( j2eeType ) );
mNonChildJ2EETypes.add( j2eeType );
|
private static java.lang.Class | deriveImplClass(java.lang.Class mbeanInterface)
final String fullyQualifiedName = mbeanInterface.getName();
final String shortName = getBaseName( fullyQualifiedName );
Class implClass = null;
// optimize for speed, calling locateImplClass() is very expensive
// (4-5ms per class on a really fast machine)
if ( fullyQualifiedName.startsWith( "com.sun.appserv.management.config" ) )
{
implClass = locateImplClass( "com.sun.enterprise.management.config", shortName );
}
else if ( fullyQualifiedName.startsWith( "com.sun.appserv.management.monitor" ) )
{
implClass = locateImplClass( "com.sun.enterprise.management.monitor", shortName );
}
else if ( fullyQualifiedName.startsWith( "com.sun.appserv.management.j2ee" ) )
{
implClass = locateImplClass( "com.sun.enterprise.management.j2ee", shortName );
}
else if ( fullyQualifiedName.startsWith( "com.sun.appserv.management.base" ) )
{
implClass = locateImplClass( "com.sun.enterprise.management.support", shortName );
}
else if ( INTERFACE_TO_IMPL.containsKey( fullyQualifiedName ) )
{
implClass = ClassUtil.getClassFromName( INTERFACE_TO_IMPL.get( fullyQualifiedName ) );
}
else
{
// as of 30 Nov 2006, there were only 5 exceptions, handled by INTERFACE_TO_IMPL map
//System.out.println( "NEEDED: " + mbeanInterface );
}
if ( implClass == null )
{
for( int i = 0; i < IMPL_PACKAGES.length; ++i )
{
implClass = locateImplClass( IMPL_PACKAGES[ i ], shortName );
if ( implClass != null )
{
break;
}
}
}
if ( implClass == null )
{
throw new ClassNotFoundException(
"Expected to find implementation class " + shortName + IMPL );
}
return( implClass );
|
private static java.lang.Class | deriveInterface(java.lang.String j2eeType)
return( AllTypesMapper.getInstance().getInterfaceForType( j2eeType ) );
|
public boolean | equals(java.lang.Object o)
if ( o == this )
{
return( true );
}
else if ( ! (o instanceof TypeInfo ) )
{
return( false );
}
final TypeInfo rhs = (TypeInfo)o;
boolean equals = false;
if ( mTypeData.equals( rhs.mTypeData ) &&
mInterface == rhs.mInterface &&
mImplClass == rhs.mImplClass &&
mChildJ2EETypes.equals( rhs.mChildJ2EETypes ) &&
getLegalParentJ2EETypes().equals( rhs.getLegalParentJ2EETypes() )
)
{
equals = true;
}
return( equals );
|
private static java.lang.String | getBaseName(java.lang.String mbeanClassName)
final String classname = ClassUtil.stripPackageName( mbeanClassName );
final String baseName = classname;
return( baseName );
|
public java.util.Set | getChildJ2EETypes()
return( Collections.unmodifiableSet( mChildJ2EETypes ) );
|
public java.lang.String | getContainedByJ2EEType()
return( mTypeData.getContaineeByJ2EEType() );
|
public java.util.Set | getContaineeJ2EETypes()
final Set<String> all =
GSetUtil.newSet( mChildJ2EETypes, mNonChildJ2EETypes );
return( Collections.unmodifiableSet( all ) );
|
public java.lang.Class | getImplClass()
return( mImplClass );
|
public java.lang.Class | getInterface()
return( mInterface );
|
private static java.util.Map | getInterfaceToImplMap()Individual cases.
final Map<String,String> m = new HashMap<String,String>();
m.put( "com.sun.appserv.management.DomainRoot", "com.sun.enterprise.management.DomainRootImpl" );
m.put( "com.sun.appserv.management.ext.logging.Logging", "com.sun.enterprise.management.ext.logging.LoggingImpl" );
m.put( "com.sun.appserv.management.deploy.DeploymentMgr", "com.sun.enterprise.management.deploy.DeploymentMgrImpl" );
m.put( "com.sun.appserv.management.ext.lb.LoadBalancer", "com.sun.enterprise.management.ext.lb.LoadBalancerImpl" );
m.put( "com.sun.appserv.management.ext.wsmgmt.WebServiceMgr", "com.sun.enterprise.management.ext.wsmgmt.WebServiceMgrImpl" );
m.put( "com.sun.appserv.management.ext.update.UpdateStatus", "com.sun.enterprise.management.ext.update.UpdateStatusImpl" );
return Collections.unmodifiableMap( m );
|
public java.lang.String | getJ2EEType()
return( mTypeData.getJ2EEType() );
|
public java.util.Set | getLegalParentJ2EETypes()
return( mTypeData.getLegalParentJ2EETypes() );
|
public java.util.Set | getNonChildJ2EETypes()
return( Collections.unmodifiableSet( mNonChildJ2EETypes ) );
|
public java.lang.String | getParentJ2EEType()
final Set<String> legalParentJ2EETypes = getLegalParentJ2EETypes();
if ( legalParentJ2EETypes == null )
{
throw new IllegalArgumentException( "no legal parent types for: " + getJ2EEType() );
}
if ( legalParentJ2EETypes.size() != 1 )
{
throw new IllegalArgumentException( "expecting single parent for " +
getJ2EEType() + ", have: " + toString( legalParentJ2EETypes ) );
}
return( GSetUtil.getSingleton( legalParentJ2EETypes ) );
|
public int | hashCode()
return ObjectUtil.hashCode(
mTypeData, mInterface, mChildJ2EETypes, mNonChildJ2EETypes );
|
public boolean | isSubType()
return( mTypeData.isSubType() );
|
private static java.lang.Class | locateImplClass(java.lang.String packageName, java.lang.String baseName)
if ( ! packageName.startsWith( "com.sun.enterprise.management" ) )
{
throw new RuntimeException( "Illegal implementation package for AMX" );
}
final String implClassname = packageName + "." + baseName + IMPL;
Class implClass = null;
try
{
implClass = ClassUtil.getClassFromName( implClassname );
}
catch( ClassNotFoundException e )
{
// ignore, we'll return null
}
return( implClass );
|
public java.lang.String | toString()
final StringBuffer buf = new StringBuffer();
final String PR = "\n ";
buf.append( getJ2EEType() + ": " );
buf.append( PR + "parent type = " + SmartStringifier.toString( getLegalParentJ2EETypes() ) );
buf.append( PR + "child types = " + SmartStringifier.toString( mChildJ2EETypes ) );
buf.append( PR + "mbean = " + mInterface.getName() );
buf.append( PR + "impl = " + mImplClass.getName() );
buf.append( "\n" );
return( buf.toString() );
|
private static java.lang.String | toString(java.lang.Object o)
return( SmartStringifier.toString( o ) );
|