private synchronized void writeObject ( ObjectOutputStream oos ) throws IOException { if ( _control != null ) { // // If the implementation class is marked as transient/stateless, then reset the // reference to it prior to serialization. A new instance will be created by // ensureControl() upon first use after deserialization. // If the implementation class is not transient, then invoke the ImplInitializer // resetServices method to reset all contextual service references to null, as // contextual services should never be serializated and always reassociated on // deserialization. // ControlImplementation implAnnot = ( ControlImplementation ) _implClass . getAnnotation ( ControlImplementation . class ) ; assert implAnnot != null ; if ( implAnnot . isTransient ( ) ) { _control = null ; } else { getImplInitializer ( ) . resetServices ( this , _control ) ; _hasServices = false ; } } oos . defaultWriteObject ( ) ; }
Implementation of the Java serialization writeObject method