[jboss-jira] [JBoss JIRA] (WFCORE-3327) Confusion about the recording of the org.wildfly.remoting.endpoint capability and the resource that configures it
Brian Stansberry (JIRA)
issues at jboss.org
Tue Oct 3 17:47:00 EDT 2017
[ https://issues.jboss.org/browse/WFCORE-3327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471797#comment-13471797 ]
Brian Stansberry commented on WFCORE-3327:
------------------------------------------
[~aloubyansky] AIUI the undertow and ejb3 cases are not the same. In undertow and ejb3 we have a parent resource providing a capability that depends on capabilities provided by children. But those resources are real resources, meaning they actually provide real runtime services.
The /subsystem=remoting/configuration=endpoint resource is not a real resource. It doesn't provide any runtime service. It's just a chunk of configuration used by the true resource, it's parent. It's an oddly implemented variant of that kind of configuration chunk, because the server itself adds it if the user doesn't, which is a pattern I don't recall elsewhere.
I've been looking at this and I'm starting to think that there's a 3) that's simpler than 2). Don't add a complex attribute to /subsystem=remoting. Instead, just add the /subsystem=remoting/configuration=endpoint attributes to it as simple attributes. No need to wrap them as fields in a complex attribute. As with 2) for API compatibility purposes only leave /subsystem=remoting/configuration=endpoint as an alias to those attributes. The /subsystem=remoting 'worker' attribute then is a simple attribute of the resource that provides the capability, the same as 99% of all capability reference attributes.
It seems like the only purpose /subsystem=remoting/configuration=endpoint served was as a kind of resource tree counterpart to the 'endpoint' child element in the xml that wraps these attributes. But there are plenty of ways to get that xml representation without adding a child resource.
3) is harder to implement than 2) for a mixed domain, but oh well.
> Confusion about the recording of the org.wildfly.remoting.endpoint capability and the resource that configures it
> -----------------------------------------------------------------------------------------------------------------
>
> Key: WFCORE-3327
> URL: https://issues.jboss.org/browse/WFCORE-3327
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management, Remoting
> Affects Versions: 3.0.3.Final
> Reporter: Brian Stansberry
> Assignee: Brian Stansberry
> Fix For: 4.0.0.Beta1
>
>
> The org.wildfly.remoting.endpoint capability is reported by the /subsystem=remoting resource, but it is the /subsystem=remoting/configuration=endpoint that actually configures it. This is confusing for humans and difficult for tooling like the new provisioning tools.
> The configuration=endpoint child is essentially a singleton and internally it just provides configuration to its parent. Further, if the user does not configure this resource, a default one is added automatically. This child resources is really just a configuration chunk for its parent.
> In the end it is the parent resource that actually provides the capability, by installing a service. It reads its child resource to configure the capability.
> There are a couple possibilities here:
> 1) Simply move the declaration of the capability to the child resource. Per discussion with [~aloubyansky] is seems that solves the tool problem. It leaves the actual situation obscure though, because now a seemingly non-required child resource is the thing that provides a capability that actually will always be present.
> 2) Deprecate that child resource and add a complex attribute to the parent. The child resource continues to exist in the API for compatibility reasons, but simply modifies the attribute on the parent. The cap remains on the parent.
> Note that 2) may require some manipulation of how we handle undefined complex attributes; i.e. that when we resolve them, even if the root attribute is undefined, we need to resolve the fields, in case those have default values, with the resolved parent then including the default field values. That can be tricky though, e.g. in cases of things like the defaulted attribute having requires, or other fields in the complex attribute being required.
> This latter point is relevant because it would be a 'worker' field in a complex attribute that would actually declare the name of the needed io worker capability. That field would have a default value 'default'.
> Perhaps the declaration of the complex attribute itself (i.e. ObjectTypeAttributeDefinition) would need to indicate how things should be handled. That could just be the complex attribute itself has a default value, {"worker"=>"default"}. Or it could be a flag that enables looking at the fields for defaults if the top level attribute is undefined. Or maybe investigation will show this isn't a problem at all.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list