- Map of <j2eeType>=<Map of <name>=<ObjectName>
*/
Map<String,?> result = null;
if ( m.keySet().size() != 0 )
{
final ProxyFactory proxyFactory = getProxyFactory();
final Object firstValue = m.values().iterator().next();
if ( firstValue instanceof ObjectName )
{
// it's <name>=<ObjectName>
final Map<String,ObjectName> onm = TypeCast.asMap( m );
final Map<String,AMX> proxyMap = proxyFactory.toProxyMap( onm );
result = proxyMap;
}
else if ( firstValue instanceof Map )
{
final Map<String,Map<String,ObjectName>> objectNameMaps = TypeCast.asMap( m );
final Map<String,Map<String,AMX>> proxyMaps = new HashMap<String,Map<String,AMX>>();
for ( final String j2eeType : objectNameMaps.keySet() )
{
final Map<String,ObjectName> objectNameMap = objectNameMaps.get( j2eeType );
final Map<String,AMX> proxyMap = proxyFactory.toProxyMap( objectNameMap );
proxyMaps.put( j2eeType, proxyMap );
}
result = proxyMaps;
}