public void purge ( ) { synchronized ( this ) { // Clear all references to VirtualHost objects for ( DynamicVirtualHost host : hostMap . values ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Purge host : " + host . hashCode ( ) + ", this : " + this ) ; } host . getHostConfiguration ( ) . setConfiguration ( null ) ; } hostMap . clear ( ) ; } //do not clear the transport map. //DS looks after the transport map via set/unset/updateVirtualHost //transportMap.clear(); }
Called when the webcontainer is deactivated . This will clean up all maps within the host manager to facilitate garbage collection and clean up .