public final void readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException {
  int count=serializable;
  while (count-- > 0) {
    Object child=null;
    BeanContextSupport.BCSChild bscc=null;
    try {
      child=ois.readObject();
      bscc=(BeanContextSupport.BCSChild)ois.readObject();
    }
 catch (    IOException ioe) {
      continue;
    }
catch (    ClassNotFoundException cnfe) {
      continue;
    }
synchronized (child) {
      BeanContextChild bcc=null;
      try {
        bcc=(BeanContextChild)child;
      }
 catch (      ClassCastException cce) {
      }
      if (bcc != null) {
        try {
          bcc.setBeanContext(getBeanContextPeer());
          bcc.addPropertyChangeListener("beanContext",childPCL);
          bcc.addVetoableChangeListener("beanContext",childVCL);
        }
 catch (        PropertyVetoException pve) {
          continue;
        }
      }
      childDeserializedHook(child,bscc);
    }
  }
}

public final void readChildren ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { int count = serializable ; while ( count -- > 0 ) { Object child = null ; BeanContextSupport . BCSChild bscc = null ; try { child = ois . readObject ( ) ; bscc = ( BeanContextSupport . BCSChild ) ois . readObject ( ) ; } catch ( IOException ioe ) { continue ; } catch ( ClassNotFoundException cnfe ) { continue ; } synchronized ( child ) { BeanContextChild bcc = null ; try { bcc = ( BeanContextChild ) child ; } catch ( ClassCastException cce ) { } if ( bcc != null ) { try { bcc . setBeanContext ( getBeanContextPeer ( ) ) ; bcc . addPropertyChangeListener ( "beanContext" , childPCL ) ; bcc . addVetoableChangeListener ( "beanContext" , childVCL ) ; } catch ( PropertyVetoException pve ) { continue ; } } childDeserializedHook ( child , bscc ) ; } } }
when an instance of this class is used as a delegate for the implementation of the beancontext protocols ( and its subprotocols ) there exists a ' chicken and egg ' problem during deserialization
