}
}
private JavaClass findBeanByInterface(Collection metadata, Type type) {
JavaClass retVal = null;
LocalInterfacePlugin localPlugin = EjbRuntime.getLocalInterfacePlugin();
RemoteInterfacePlugin remotePlugin = EjbRuntime.getRemoteInterfacePlugin();
if (log.isDebugEnabled()) {
log.debug("Looking for bean with local|remote interface named " + type);
}
for (Iterator iter = metadata.iterator(); retVal == null && iter.hasNext();) {
JavaClass javaClass = (JavaClass) iter.next();
Type localType = localPlugin.getVirtualType(javaClass).getType();
Type remoteType = remotePlugin.getVirtualType(javaClass).getType();
if (localType.equals(type) || remoteType.equals(type)) {
if (log.isDebugEnabled()) {
log.debug("Match found for " + javaClass.getFullyQualifiedName());