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
精彩评论