if (retValue instanceof java.util.Collection) {
Object [] proxyInfos = ((java.util.Collection) retValue).toArray();
Vector proxies = new Vector();
for (int i = 0; i < proxyInfos.length; i++) {
ProxyInfo proxyInfo = (ProxyInfo) proxyInfos[i];
proxies.addElement(createProxy(proxyInfo.getPrimaryKey(), getMainInterface()));
}
return proxies;
} else if (retValue instanceof org.apache.openejb.util.ArrayEnumeration) {
org.apache.openejb.util.ArrayEnumeration enumeration = (org.apache.openejb.util.ArrayEnumeration) retValue;
for (int i = enumeration.size() - 1; i >= 0; --i) {
ProxyInfo proxyInfo = ((ProxyInfo) enumeration.get(i));
enumeration.set(i, createProxy(proxyInfo.getPrimaryKey(), getMainInterface()));
}
return enumeration;
} else if (retValue instanceof java.util.Enumeration) {
java.util.Enumeration enumeration = (java.util.Enumeration) retValue;
java.util.List proxies = new java.util.ArrayList();
while (enumeration.hasMoreElements()) {
ProxyInfo proxyInfo = ((ProxyInfo) enumeration.nextElement());
proxies.add(createProxy(proxyInfo.getPrimaryKey(), getMainInterface()));
}
return new org.apache.openejb.util.ArrayEnumeration(proxies);
} else {
org.apache.openejb.ProxyInfo proxyInfo = (org.apache.openejb.ProxyInfo) retValue;
return createProxy(proxyInfo.getPrimaryKey(), getMainInterface());
}
}