{
final MBeanServerConnection conn = getMBeanServerConnection();
assert( containeeObjectName != null );
assert( conn.isRegistered( containeeObjectName ) );
final AMX containedProxy = getProxyFactory().getProxy( containeeObjectName, AMX.class);
if ( containedProxy instanceof DomainRoot )
{
// DomainRoot has no Container
return;
}
final ObjectName containerObjectName = (ObjectName)
conn.getAttribute( containeeObjectName, "ContainerObjectName" );
if ( ! conn.isRegistered( containerObjectName ) )
{
warning( "Container " + StringUtil.quote( containerObjectName ) +
" for " + StringUtil.quote( containeeObjectName ) +
" is not registered." );
return;
}
final AMX parentProxy = containedProxy.getContainer( );
if ( parentProxy instanceof Container )
{
if ( ! ( parentProxy instanceof Container ) )
{