您的位置:程序门 -> java -> j2ee / ejb / jms



各位大哥大姐 ,求助!!1


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


各位大哥大姐 ,求助!!1
发表于:2007-06-01 15:26:37 楼主
我们用ejb做两个系统的通信,每个接口与别的系统的连接配置方式不同比如不同的url等等,怎么考虑把这种不同的接口方法写入一个xml中(配置文件),以后连接到别的系统的时候只需要改变xml文件配置即可。现在的考虑是写java找到对应的节点,然后到xml中找到这个节点的配置。请大家给个主意。现在有个例子,是把用java写成的连接配置,改成我上面说的方法,看看哪位能给写一下
/*以下方法是作用是:通过传递环境属性选择jndi驱动和服务器的网络位置,
          *并连接到连接到jndi树。
          *这是采用weblogic做ejb容器时,远程调用ejb的固定初始化模式,
          */
      /*private     static   initialcontext   getinitialcontext()   throws   exception   {
        //ejb容器的地址
              string   url   =   "t3://10.0.76.151:8080 ";
              string   user   =   null;
              string   password   =   null;
              properties   properties;        
              properties   =   new   properties();
              properties.put(context.initial_context_factory,
                                                  "weblogic.jndi.wlinitialcontextfactory ");
              properties.put(context.provider_url,   url);
              if   (user   !=   null)   {
              properties.put(context.security_principal,   user);
              properties.put(context.security_credentials,
              password   ==   null   ?   " "   :   password);
              }
              return   new   javax.naming.initialcontext(properties);
      }*/
发表于:2007-06-01 17:02:221楼 得分:0
java技术交流   qq群:3701756
发表于:2007-06-02 11:57:492楼 得分:0
关注


快速检索

最新资讯
热门点击