Refactor EJBClient.java

This commit is contained in:
pivovarit 2016-12-18 10:00:11 +01:00
parent 1b59823654
commit 38eef2d1c0
1 changed files with 1 additions and 2 deletions

View File

@ -45,8 +45,7 @@ public class EJBClient {
final String distinctName = "";
final String beanName = "HelloWorld";
final String viewClassName = HelloWorld.class.getName();
final String toLookup = "ejb:" + appName + "/" + moduleName
+ "/" + distinctName + "/" + beanName + "!" + viewClassName;
final String toLookup = String.format("ejb:%s/%s/%s/%s!%s", appName, moduleName, distinctName, beanName, viewClassName);
return (HelloWorld) context.lookup(toLookup);
}