public synchronized void addComponent(ComponentEvent event)
    {
        try
        {
            if(log.isDebugEnabled())log.debug("Component added "+event);
            Object o=event.getComponent();
            
            ModelMBean mbean=ModelMBeanImpl.mbeanFor(o);
            if (mbean==null)
                log.warn("No MBean for "+o);
            else
            {
                ObjectName oName=null;
                if (mbean instanceof ModelMBeanImpl)
                {
                    ((ModelMBeanImpl)mbean).setBaseObjectName(getObjectName().toString());
                    oName=
                        getMBeanServer().registerMBean(mbean,null).getObjectName();
                }
                else
                {
                    oName=uniqueObjectName(getMBeanServer(),
                                           o,
                                           getObjectName().toString());
                    oName=getMBeanServer().registerMBean(mbean,oName)
                        .getObjectName();
                }
                Holder holder = new Holder(oName,mbean);
                _mbeanMap.put(o,holder);
            }
        }
        catch(Exception e)
        {
            log.warn(LogSupport.EXCEPTION,e);
        }
    }
public synchronized void addComponent ( ComponentEvent event ) { try { if ( log . isDebugEnabled ( ) ) log . debug ( "Component added " + event ) ; Object o = event . getComponent ( ) ; ModelMBean mbean = ModelMBeanImpl . mbeanFor ( o ) ; if ( mbean == null ) log . warn ( "No MBean for " + o ) ; else { ObjectName oName = null ; if ( mbean instanceof ModelMBeanImpl ) { ( ( ModelMBeanImpl ) mbean ) . setBaseObjectName ( getObjectName ( ) . toString ( ) ) ; oName = getMBeanServer ( ) . registerMBean ( mbean , null ) . getObjectName ( ) ; } else { oName = uniqueObjectName ( getMBeanServer ( ) , o , getObjectName ( ) . toString ( ) ) ; oName = getMBeanServer ( ) . registerMBean ( mbean , oName ) . getObjectName ( ) ; } Holder holder = new Holder ( oName , mbean ) ; _mbeanMap . put ( o , holder ) ; } } catch ( Exception e ) { log . warn ( LogSupport . EXCEPTION , e ) ; } }
/* ------------------------------------------------------------