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...
Status: CLOSED NOTABUG
Product: RHQ Project
Classification: Other
Component: No Component (Show other bugs)
unspecified
All All
low Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
http://jira.rhq-project.org/browse/RH...
: Improvement
Depends On:
Blocks:
  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:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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.