public synchronized void setBeanContext(BeanContext bc)
            throws PropertyVetoException {

        // Do nothing if the old and new values are equal
        if ((this.beanContext == null) && (bc == null)) {
            return;
        }

        if ((this.beanContext != null) && this.beanContext.equals(bc)) {
            return;
        }

       
        

        
        // Children are not allowed to repeatedly veto this operation.
        // So, we set rejectedSetBCOnce flag to true if veto occurs
        // and never veto the change again
        if (!(this.rejectedSetBCOnce && this.lastVetoedContext == bc)) {
            this.lastVetoedContext = bc;
            this.rejectedSetBCOnce = true;
            // Validate the new BeanContext value and throw
            // PropertyVetoException if it was not successful
            if (!validatePendingSetBeanContext(bc)) {                
                throw new PropertyVetoException(Messages.getString("beans.0F"), //$NON-NLS-1$
                        new PropertyChangeEvent(this.beanContextChildPeer,
                                BEAN_CONTEXT, this.beanContext, bc));
            }
            fireVetoableChange(BEAN_CONTEXT, this.beanContext, bc);
        }
            
            this.rejectedSetBCOnce = false;
            
            releaseBeanContextResources();

            // We have to notify all listeners about "beanContext"
            // property change
            firePropertyChange(BEAN_CONTEXT, this.beanContext, bc);
            this.beanContext = bc;
            initializeBeanContextResources();
        //}
    }