Created
June 27, 2016 15:17
-
-
Save sebersole/c0b1f07b8b4f4037478cb120694804f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public synchronized void deRegisterChild(ServiceRegistryImplementor child) { | |
if ( childRegistries == null ) { | |
throw new IllegalStateException( "No child ServiceRegistry registrations found" ); | |
} | |
childRegistries.remove( child ); | |
if ( childRegistries.isEmpty() ) { | |
if ( !TransientServiceRegistry.class.isInstance( child ) ) { | |
autoClose(); | |
} | |
} | |
} | |
protected void autoClose() { | |
if ( autoCloseRegistry ) { | |
log.debug( | |
"Implicitly destroying ServiceRegistry on de-registration " + | |
"of all child ServiceRegistries" | |
); | |
destroy(); | |
} | |
else { | |
log.debug( | |
"Skipping implicitly destroying ServiceRegistry on de-registration " + | |
"of all child ServiceRegistries" | |
); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MetadataServiceRegistryImpl extends AbstractServiceRegistryImpl, TransientServiceRegistry { | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Marker interface for ServiceRegistry impls that | |
* should be excluded from consideration for their | |
* parent registry's "auto-close" checks. | |
*/ | |
public interface TransientServiceRegistry { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment