[jboss-jira] [JBoss JIRA] Commented: (JBAS-6219) ManagementView.getTemplate() should return a new copy of the DeploymentTemplateInfo on every call
Ian Springer (JIRA)
jira-events at lists.jboss.org
Tue Nov 25 13:30:36 EST 2008
[ https://jira.jboss.org/jira/browse/JBAS-6219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12439721#action_12439721 ]
Ian Springer commented on JBAS-6219:
------------------------------------
Scott, to see that I'm talking about, turn on DEBUG logging for org.rhq.plugins.jbossas5, then create two new Queues via Embedded Jopr (to do this, go to the "Platform > JBossAS Servers > JBoss App Server:default > Resources > JMS Destinations > Queues" node, then click the [Add a new Resource] button. You should see output in the log similar to the following:
// This is the 1st call to createResource(), creating a queue named "jojo"
12:09:29,533 DEBUG [ApplicationServerComponent] BEFORE CREATE:
Properties for DeploymentTemplateInfo [QueueTemplate]:
name=JNDIName, mappedName=null, viewUse=NONE, required=false, type=SimpleMetaType, value= <<<null>>>
name=name, mappedName=null, viewUse=NONE, required=true, type=SimpleMetaType, value= <<<null>>>
12:09:29,705 DEBUG [ConversionUtils] Converting property PropertySimple[id=0, name=JNDIName, value=jojo, override=false]
with definition SimpleProperty[JNDIName] (Type: STRING) to MetaValue with type SimpleMetaType:java.lang.String...
12:09:29,736 DEBUG [ApplicationServerComponent] AFTER CREATE:
Properties for DeploymentTemplateInfo [QueueTemplate]:
name=JNDIName, mappedName=null, viewUse=NONE, required=false, value= SimpleMetaType:java.lang.String:jojo
name=name, mappedName=null, viewUse=NONE, required=true, type=SimpleMetaType, value= <<<null>>>
...
...
...
// This is the 2nd call to createResource(), creating a queue named "gugu"
12:10:38,115 DEBUG [ApplicationServerComponent] BEFORE CREATE:
Properties for DeploymentTemplateInfo [QueueTemplate]:
name=JNDIName, mappedName=null, viewUse=NONE, required=false, value= SimpleMetaType:java.lang.String:jojo
name=name, mappedName=null, viewUse=NONE, required=true, type=SimpleMetaType, value= <<<null>>>
12:10:38,115 DEBUG [ConversionUtils] convertConfigurationToManagedProperties: ManagedProperty.getValue() returned: Simpl
eValueSupport for property: JNDIName
12:10:38,115 DEBUG [ApplicationServerComponent] AFTER CREATE:
Properties for DeploymentTemplateInfo [QueueTemplate]:
name=JNDIName, mappedName=null, viewUse=NONE, required=false, value= SimpleMetaType:java.lang.String:gugu
name=name, mappedName=null, viewUse=NONE, required=true, type=SimpleMetaType, value= <<<null>>>
These log messages are printed by ApplicationServerComponent.createResource(). What they are dumping is managementView.getTemplate(templateName).getProperties().
As you can see in the 2nd call to createResource(), the template property "JNDIName" still has a value of "jojo". This is a remnant from the 1st call. Every time I call managementView.getTemplate(), I should get a fresh template (or alternatively, managementView.getTemplate().getProperties() could always return a fresh copy of the properties).
I tried adding a call to managementView.loadProfile() at the beginning of createResource() to refresh the view, but that didn't help.
> ManagementView.getTemplate() should return a new copy of the DeploymentTemplateInfo on every call
> -------------------------------------------------------------------------------------------------
>
> Key: JBAS-6219
> URL: https://jira.jboss.org/jira/browse/JBAS-6219
> Project: JBoss Application Server
> Issue Type: Sub-task
> Security Level: Public(Everyone can see)
> Components: ProfileService
> Reporter: Ian Springer
> Assignee: Ian Springer
>
> In our create-resource code, we do the following:
> DeploymentTemplateInfo template = managementView.getTemplate(templateName);
> Map<String, ManagedProperty> managedProperties = template.getProperties();
> // Update managedProperties according to the properties the user entered in the EmbJopr UI.
> managementView.applyTemplate(ManagedDeployment.DeploymentPhase.APPLICATION, resourceName, template);
> managementView.process();
> This all works fine the first time through. The problem is the next time we execute the above code using the same templateName, getTemplate(() returns the same DeploymentTemplateInfo from the previous call (with the updates we made to its managedProperties). Instead, it should return a new "fresh" DeploymentTemplateInfo object that contains only the properties from the original template.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list