如何将配置部署到 Glass Fish 服务器的 JNDI 树
我想将配置的 HashMap 部署到 Glass Fish 服务器的 JNDI 树。我正在将框架从 Weblogic 迁移到 GLassfish。以前是通过以下代码完成的。
环境在哪里 weblogic.jndi.Environment;
public void deployConfiguration(HashMap configuration)
throws GenericFrameworkException {
Context ictx = null;
String configParameter = null;
Environment env = new Environment();
env.setReplicateBindings(false);
// get the NOT replicating initial context of this server
ictx = ServiceLocator.getNotReplicatingInitialContext();
if (ictx != null) {
Set e = configuration.keySet();
Iterator iter = e.iterator();
while (iter.hasNext()) {
configParameter = (String) iter.next();
this.addParameter(
ictx,
Constants.JNDI_SUB_PATH,
configParameter,
configuration.get(configParameter));
}
}
}
任何人都可以建议如何在 Glassfish 中实现这一点
提前致谢。
I want to deploy a HashMap of configuration to the JNDI tree of Glass Fish server. I am migrating a framework from Weblogic to GLassfish. Previously it was done via the following code..
Where the Environment is weblogic.jndi.Environment;
public void deployConfiguration(HashMap configuration)
throws GenericFrameworkException {
Context ictx = null;
String configParameter = null;
Environment env = new Environment();
env.setReplicateBindings(false);
// get the NOT replicating initial context of this server
ictx = ServiceLocator.getNotReplicatingInitialContext();
if (ictx != null) {
Set e = configuration.keySet();
Iterator iter = e.iterator();
while (iter.hasNext()) {
configParameter = (String) iter.next();
this.addParameter(
ictx,
Constants.JNDI_SUB_PATH,
configParameter,
configuration.get(configParameter));
}
}
}
Can any one suggest how this can be achieved in Glassfish
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎您正在寻找自定义 jndi 资源:
http ://docs.oracle.com/cd/E26576_01/doc.312/e24930/jndi.htm#beanz
It seems as if you are looking for custom jndi resources:
http://docs.oracle.com/cd/E26576_01/doc.312/e24930/jndi.htm#beanz