[
https://issues.jboss.org/browse/AS7-3488?page=com.atlassian.jira.plugin.s...
]
Richard Achmatowicz commented on AS7-3488:
------------------------------------------
I've made changes to CacheContainerAdd:
- in populatModel(), don't make default-cache a required attribute:
{noformat}
target.get(ModelKeys.DEFAULT_CACHE).set(source.get(ModelKeys.DEFAULT_CACHE));
{noformat}
- in performRuntime(), get the value of the default cache as follows:
{noformat}
String defaultCache = DEFAULT_CACHE.resolveModelAttribute(context, model).asString();
{noformat}
Testing with the CLI:
{noformat}
[nrla@lenovo bin]$ ./jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or
'help' for the list of supported commands.
[disconnected /] connect
[standalone@localhost:9999 /] /subsystem=infinispan/cache-container=fred:add()
{
"outcome" => "failed",
"failure-description" => "JBAS014746: default-cache may not be
null",
"rolled-back" => true
}
[standalone@localhost:9999 /] batch
[standalone@localhost:9999 / #] /subsystem=infinispan/cache-container=fred:add()
#1 /subsystem=infinispan/cache-container=fred:add()
[standalone@localhost:9999 / #]
/subsystem=infinispan/cache-container=fred:write-attribute(name=default-cache,value=wilma)
#2
/subsystem=infinispan/cache-container=fred:write-attribute(name=default-cache,value=wilma)
[standalone@localhost:9999 / #] list-batch
#1 /subsystem=infinispan/cache-container=fred:add()
#2
/subsystem=infinispan/cache-container=fred:write-attribute(name=default-cache,value=wilma)
[standalone@localhost:9999 / #] run-batch
The batch executed successfully.
{noformat}
So, if we execute the operation in isolation with no default-cache, it fails; if we
execute it in the context of a batch and supply the default-cache at some point in the
batch, if passes.
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