开发者

How to deploy a Configuration to the JNDI tree of the Glass fish server

开发者 https://www.devze.com 2023-01-03 04:01 出处:网络
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

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.


It seems as if you are looking for custom jndi resources:

http://docs.oracle.com/cd/E26576_01/doc.312/e24930/jndi.htm#beanz

0

精彩评论

暂无评论...
验证码 换一张
取 消