[jboss-jira] [JBoss JIRA] (AS7-3488) Make default-cache attribute of cache-container "eventually required" rather than required.
Richard Achmatowicz (JIRA)
jira-events at lists.jboss.org
Sun Jan 29 13:27:48 EST 2012
[ https://issues.jboss.org/browse/AS7-3488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662617#comment-12662617 ]
Richard Achmatowicz commented on AS7-3488:
------------------------------------------
Paul and I discussed the issue and here is one possible solution.
The cache-container=*:add() operation executes in two parts: the MODEL stage followed by the RUNTIME stage. At the moment, the default-cache is a required attribute in both stages and it is flagged as such in its AttributeDefinition. If we leave the attribute definition as is, don't make it required in the MODEL stage, and make it required in the RUNTIME stage, then we have these outcomes:
- the default-cache attribute will still be marked required in the description for users to see
- if someone tries to execute a cache-container=*:add() command in isolation and does not pass a default-cache attribute, it will fail because the RUNTIME stage requires it
- if someone executes a cache-container=*:add() command in a batch of commands, and that batch contains a command to set the default-cache attribute, then the operation will not fail, as by the time the MODEL stage completes, the attribute will be set
This is a one line change and it would seem to provide a workaround for what you want.
One other point: the cache-container resource does not have a start operation - when we perform add, the cache container is configured, and installed as a service in ON_DEMAND mode. It is only when the an application requests use of the cache container that CacheContainerService.start() is called. The section of docs you referenced and which I wrote are out of date. My apologies.
> Make default-cache attribute of cache-container "eventually required" rather than required.
> -------------------------------------------------------------------------------------------
>
> Key: AS7-3488
> URL: https://issues.jboss.org/browse/AS7-3488
> Project: Application Server 7
> Issue Type: Feature Request
> Components: Domain Management
> Affects Versions: 7.1.0.CR1b
> Reporter: Richard Achmatowicz
> Assignee: Richard Achmatowicz
> Fix For: 7.1.0.Final
>
>
> Can we remove the restriction that default-cache must be set when you create the cache-container? That way, I can just make it so the UI
> forces them to set that value before calling the start operation. So under that covers, the console does this:
> {noformat}
> <!-- user creates a new cache container without specifying default-cache. -->
> /subsystem=infinispan/cache-container=X:add
> <!-- for top-level cache container attributes, user sets them via write-attribute -->
> /subsystem=infinispan/cache-container=X:write-attribute(name=jndi-name,value=W)
> <!-- for nested nested cache-container attributes, user access them as an addressable resource and sets them via write-attribute -->
> /subsystem=infinispan/cache-container=X/transport=TRANSPORT:write-attribute(name=stack, value=udp)
> /subsystem=infinispan/cache-container=X/transport=TRANSPORT:write-attribute(name=lock-timeout, value=100)
> <!-- When user is ready to start the cache-container, prompt for default-cache if not set. -->
> <!-- Then do these two as a batch -->
> /subsystem=infinispan/cache-container=X:write-attribute(name=default-cache, value=Y)
> /subsystem=infinispan/cache-container=X:start(mode=on-demand)
> {noformat}
> Any thoughts on this? The answer has great implications on the UI design.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list