Bug 534922 - (RHQ-1671) TabDisplayCheckTag unnecessarily creates ResourceUIBean objects when it really just needs the resource facets
TabDisplayCheckTag unnecessarily creates ResourceUIBean objects when it reall...
Product: RHQ Project
Classification: Other
Component: No Component (Show other bugs)
All All
low Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
: Improvement
Depends On:
  Show dependency treegraph
Reported: 2009-02-26 15:34 EST by Charles Crouch
Modified: 2015-02-01 18:25 EST (History)
1 user (show)

See Also:
Fixed In Version: 1.2
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Charles Crouch 2009-02-26 15:34:00 EST
Right now TabDisplayCheckTag.getResourceFacets() does

ResourceUIBean resourceUIBean = new ResourceUIBean(resource, subject);
resourceFacets = resourceUIBean.getFacets(resource, subject);

new ResourceUIBean(resource, subject) ends up doing
 Query query = entityManager.createNamedQuery(ResourceError.QUERY_FIND_BY_RESOURCE_ID_AND_ERROR_TYPE);

which is an neccessary query which TabDisplayCheckTag shouldnt care about.

So the alternative would be to put a static method on ResourceUIBean that returned just what TabDisplayCheckTag needed

//ResourceUIBean resourceUIBean = new ResourceUIBean(resource, subject);
resourceFacets = ResourceUIBean.getFacets(resource, subject);

Then on ResourceUIBean you would have

    public static ResourceFacets getFacets(Resource resource, Subject subject) {
        ResourceTypeManagerLocal resourceTypeManager = LookupUtil.getResourceTypeManager();
        ResourceFacets facets;
        try {
            facets = resourceTypeManager.getResourceFacets(subject, resource.getResourceType().getId());
        } catch (ResourceTypeNotFoundException e) {
            throw new RuntimeException(e);

        return facets;
Comment 1 Joseph Marques 2009-02-27 09:20:03 EST
this is no longer an issue since we don't have any references to the old struts tabs anymore.  all resource / group / autogroup / autocluster tabs are JSF today.  thus, TabDisplayCheckTag will never be called.
Comment 2 Red Hat Bugzilla 2009-11-10 15:37:57 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1671

Note You need to log in before you can comment on or make changes to this bug.