private ObjectName[] getResource( String resType, String tgtName )
throws Exception
{
ArrayList result = new ArrayList();
final Target target = TargetBuilder.INSTANCE.createTarget(
VALID_LIST_TYPES, tgtName, getConfigContext());
ObjectName[] mbean = (ObjectName[])super.invoke( GET + ConfigMBeanHelper.convertTagName(resType), null, null);
/**
resource-ref business doesnot apply to jdbc-connection-pool,
connector-connection-pool & resource-adapter-config. So return
the pools as if the target were domain. &
If the target is domain, return all the resources of the specific
type.
*/
if (CONNECTOR_CONNECTION_POOL.equals(resType) ||
JDBC_CONNECTION_POOL.equals(resType) ||
RESOURCE_ADAPTER_CONFIG.equals(resType) ||
(target.getType() == TargetType.DOMAIN))
{
return mbean;
}
if (target.getType() == TargetType.SERVER ||
target.getType() == TargetType.CLUSTER ||
target.getType() == TargetType.DAS) {
//filter out only those resources referenced by the target
ResourceRef[] refs = target.getResourceRefs();
String objectProps = null;
for (int i = 0; i < mbean.length; i++) {
for (int j = 0; j < refs.length; j++) {
objectProps = mbean[i].getKeyPropertyListString();
if (objectProps.indexOf(refs[j].getRef()) > 0) {