}
String businessInterfaceClassname = businessInterface.getName();
// Check if the given interface is a correct interfaces
IBeanInfo beanInfo = getFactory().getBeanInfo();
List<String> localInterfaces = beanInfo.getLocalInterfaces();
List<String> remoteInterfaces = beanInfo.getRemoteInterfaces();
// Not a business interfaces
if (!localInterfaces.contains(businessInterfaceClassname) && !remoteInterfaces.contains(businessInterfaceClassname)) {
throw new IllegalStateException("The interface '" + businessInterface
+ "' is not a valid interface for this bean '" + beanInfo.getName() + "'. Valid Local Interfaces are '"
+ localInterfaces + "' and remote interfaces '" + remoteInterfaces + "'.");
}
// Now build a local or remote proxy
boolean localInterface = false;