Skip to content

Commit

Permalink
Fix JGroups DNS_PING infinispan#116
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson committed Oct 25, 2022
1 parent a0d2f4f commit 125925b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions server-runner/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
quarkus.banner.enabled=false
quarkus.naming.enable-jndi=true
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;
import javax.naming.spi.NamingManager;

import org.infinispan.server.context.ServerInitialContextFactory;
import org.infinispan.server.context.ServerInitialContextFactoryBuilder;
Expand Down Expand Up @@ -39,4 +40,15 @@ public InitialContextFactory createInitialContextFactory(Hashtable<?, ?> environ
throw new NamingException("Native Infinispan Server does not support " + className + " as an InitialContextFactory");
}
}
}
}

@TargetClass(NamingManager.class)
final class Target_NamingManager{
@Substitute
private static InitialContextFactory getFactory(String className) {
if ("com.sun.jndi.dns.DnsContextFactory".equals(className)) {
return new DnsContextFactory();
}
throw new IllegalArgumentException("Native Infinispan Server does not support " + className + " as an InitialContextFactory");
}
}

0 comments on commit 125925b

Please sign in to comment.