我remotly调用EJB方法使用下面的代码:哪里是EJB方法运行
RemCallRemote rc = null;
String Text = "";
Properties props = new Properties();
//Filling the properties for connection to a remote server
props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
props.put(Context.PROVIDER_URL, "hostaddress:50004");
props.put(Context.SECURITY_PRINCIPAL, "LOGINNAME");
props.put(Context.SECURITY_CREDENTIALS, "*****");
props.put(Context.URL_PKG_PREFIXES, "com.sap.engine.services");
InitialContext ctx = new InitialContext(props);
//getting a reference to an interface
rc = (RemCallRemote)ctx.lookup("ejb:/appName=sap.com/RemoteCallEAR, jarName=RemoteCallEJB.jar, beanName=RemCall, interfaceName=RemCallRemote");
//calling an EJB method
Text = rc.Check();
的代码工作正常,但我的问题是:在哪里EJB方法运行?它是否始终在'hostaddress'机器上或其他地方运行?
您的回答非常丰富。谢谢。你是对的。 SAP服务器是多个Java应用程序服务器的集群。即使我使用特定的物理服务器名称(可以这样做)来调用EJB,也不保证EJB将在特定的物理服务器上运行。这由SAP Java管理服务决定。 – Skalozub