final ClassOrInterfaceTypeDetails proxy = gwtTypeService
.lookupProxyFromRequest(cid);
if (proxy != null) {
final JavaType typeName = PhysicalTypeIdentifier
.getJavaType(proxy.getDeclaredByMetadataId());
final LogicalPath typePath = PhysicalTypeIdentifier
.getPath(proxy.getDeclaredByMetadataId());
downstreamDependency = GwtLocatorMetadata.createIdentifier(
typeName, typePath);
processed = true;
}
}
if (!processed
&& cid.getAnnotation(RooJavaType.ROO_GWT_PROXY) == null) {
boolean found = false;
for (final ClassOrInterfaceTypeDetails proxyCid : typeLocationService
.findClassesOrInterfaceDetailsWithAnnotation(RooJavaType.ROO_GWT_PROXY)) {
final AnnotationMetadata annotationMetadata = GwtUtils
.getFirstAnnotation(proxyCid,
GwtUtils.ROO_PROXY_REQUEST_ANNOTATIONS);
if (annotationMetadata != null) {
final AnnotationAttributeValue<?> attributeValue = annotationMetadata
.getAttribute("value");
if (attributeValue != null) {
final String mirrorName = GwtUtils
.getStringValue(attributeValue);
if (mirrorName != null
&& cid.getName()
.getFullyQualifiedTypeName()
.equals(attributeValue.getValue())) {
found = true;
final JavaType typeName = PhysicalTypeIdentifier
.getJavaType(proxyCid
.getDeclaredByMetadataId());
final LogicalPath typePath = PhysicalTypeIdentifier
.getPath(proxyCid
.getDeclaredByMetadataId());
downstreamDependency = GwtLocatorMetadata
.createIdentifier(typeName, typePath);
break;
}
}
}
}
if (!found) {
return;
}
}
else if (!processed) {
// A physical Java type has changed, and determine what the
// corresponding local metadata identification string would have
// been
final JavaType typeName = PhysicalTypeIdentifier
.getJavaType(upstreamDependency);
final LogicalPath typePath = PhysicalTypeIdentifier
.getPath(upstreamDependency);
downstreamDependency = GwtLocatorMetadata.createIdentifier(
typeName, typePath);
}