Bug 534922 (RHQ-1671) - TabDisplayCheckTag unnecessarily creates ResourceUIBean objects when it really just needs the resource facets
Summary: TabDisplayCheckTag unnecessarily creates ResourceUIBean objects when it reall...
Keywords:
Status: CLOSED NOTABUG
Alias: RHQ-1671
Product: RHQ Project
Classification: Other
Component: No Component
Version: unspecified
Hardware: All
OS: All
low
medium
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact:
URL: http://jira.rhq-project.org/browse/RH...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-26 20:34 UTC by Charles Crouch
Modified: 2015-02-01 23:25 UTC (History)
1 user (show)

Fixed In Version: 1.2
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Charles Crouch 2009-02-26 20:34:00 UTC
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 14:20:03 UTC
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 20:37:57 UTC
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.