private synchronized void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { // todo: for multithreaded usage this block needs to be synchronized in . defaultReadObject ( ) ; initialize ( ) ; // only deserialize child if not using a peer if ( this . equals ( getPeer ( ) ) ) { readChildren ( in ) ; } int listenerCount = in . readInt ( ) ; for ( int i = 0 ; i < listenerCount ; i ++ ) { addBeanContextMembershipListener ( ( BeanContextMembershipListener ) in . readObject ( ) ) ; } // end synchronized block }
Deserialize this an instance of this class including any children and BeanContextMembershipListeners which were present during serialization and were serializable .