将 JNDI 用于 WebSphere Application Server J2EE 瘦客户端应用程序
2009-10-23 00:00:00 来源:WEB开发网
import
java.rmi.RemoteException;
import
java.util.Hashtable;
import
javax.ejb.CreateException;
import
javax.naming.Context;
import
javax.naming.InitialContext;
import
com.ibm.simple.*;
import
com.ibm.simple.SimpleEJBHome;
public class
ExternalCaller
{
public static void
main(String[] args)
{
try
{
Context initialContext =
new InitialContext();
System.out.println(
"Calling EJB Externally");
String lookupString =
"cell/nodes/localhost/servers/server1/ejb/com/ibm/simple/SimpleEJBHome";
Object obj =
initialContext.lookup(lookupString);
SimpleEJBHome ejbHome =
(SimpleEJBHome) javax.rmi.PortableRemoteObject.narrow(obj,SimpleEJBHome.class);
SimpleEJB simpleEJB = ejbHome.create();
System.out.println(simpleEJB.echoMe(
"I worked!"));
}
catch
(Exception e)
{
e.printStackTrace();
}
}
}
- ››WebSphere Application Server 7.0 XML Feature P...
- ››WebSphere 反向投资者: 解决 WebSphere Applicati...
- ››WebSphere sMash 的创新应用,第 2 部分: 借助包装...
- ››Websphere MQ v6集群的负载均衡新功能
- ››WebSphere Process Server V6.0.2 集群,第 2 部分...
- ››WebSphere Process Server V6.0.2 集群,第 1 部分...
- ››WebSphere MQ性能调优浅谈
- ››WebSphere配置资源库管理
- ››WebSphere中的SSL/TLS:用法、配置和性能
- ››websphere ejb远程/本地调用总结
- ››WebSphere Application Server对SIP的支持
- ››WebSphere Process Server V6 体系结构概述
更多精彩
赞助商链接