[
https://issues.redhat.com/browse/WFWIP-304?page=com.atlassian.jira.plugin...
]
Marek Kopecky commented on WFWIP-304:
-------------------------------------
{quote}
In WildFly, the Config object is released when a deployment is undeployed and it would
only affect ConfigSource/Converters that needs to deallocate any resources they hold
between the undeployment and a server shutdown.
As the MicroProfile Expansion Pack is meant to support only single deployment, this window
does not exist.
{quote}
[~jmesnil] Based on "Release Notes for MicroProfile Config 1.4", new 1.4 version
handles [this issue
265|https://github.com/eclipse/microprofile-config/issues/265]. This
issue suggests that users use getConfig() etc. in deployments etc.
Anyway, please consider use cases like this. Config object is release during end-point
call:
{code:java}
@Path("/resolver")
public class ResolverEndPoint {
@GET
public String doGet() {
// prepare response
StringBuilder response = new StringBuilder();
// get resolver
ConfigProviderResolver resolver = ConfigProviderResolver.instance();
// handle original config
Config config = resolver.getConfig();
response.append(config.getValue("test", String.class));
resolver.releaseConfig(config);
// prepare, register and release new config
ConfigBuilder builder = resolver.getBuilder();
Config specificConfig = builder.addDefaultSources().withSources(new
ResolverConfigSource()).build();
resolver.registerConfig(specificConfig, ResolverEndPoint.class.getClassLoader());
config = resolver.getConfig();
response.append(config.getValue("test", String.class));
resolver.releaseConfig(config);
// get default config
config = resolver.getConfig();
response.append(config.getValue("test", String.class));
return response.toString();
}
}
{code}
AutoClosable behaviour from MP Config spec is not implemented
-------------------------------------------------------------
Key: WFWIP-304
URL:
https://issues.redhat.com/browse/WFWIP-304
Project: WildFly WIP
Issue Type: Bug
Reporter: Marek Kopecky
Assignee: Jeff Mesnil
Priority: Blocker
Current implementation MP Config 1.4 doesn t implement AutoCloseable behaviour on
ConfigSource and Converter classes. Developers create [MP
issue|https://github.com/eclipse/microprofile-config/issues/136], because these
specification requirements seems confusing and unclear to them. [This
issue|https://github.com/eclipse/microprofile-config/issues/136] is not approved as a bug
from MP community.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)