Skip to content

Commit

Permalink
EJBCLIENT-417 Replace the deprecated ModuleIdentifier with string name (
Browse files Browse the repository at this point in the history
  • Loading branch information
chengfang committed May 31, 2022
1 parent 6c16c86 commit d620c9d
Showing 1 changed file with 3 additions and 12 deletions.
Expand Up @@ -33,7 +33,6 @@
import org.jboss.ejb._private.Logs;
import org.jboss.ejb.client.legacy.LegacyPropertiesConfiguration;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoadException;
import org.wildfly.client.config.ClientConfiguration;
import org.wildfly.client.config.ConfigXMLParseException;
Expand Down Expand Up @@ -248,7 +247,9 @@ private static <T> Class<? extends T> parseClassType(final ConfigurationXMLStrea
ClassLoader cl;
if (moduleName != null) {
try {
cl = ModuleLoadDelegate.loadModule(moduleName);
cl = Module.getModuleFromCallerModuleLoader(moduleName).getClassLoader();
} catch (ModuleLoadException e) {
throw new ConfigXMLParseException(e);
} catch (LinkageError e) {
throw Logs.MAIN.noJBossModules(streamReader);
}
Expand All @@ -270,16 +271,6 @@ private static <T> Class<? extends T> parseClassType(final ConfigurationXMLStrea
throw streamReader.unexpectedElement();
}

static final class ModuleLoadDelegate {
static ClassLoader loadModule(String moduleName) throws ConfigXMLParseException {
try {
return Module.getModuleFromCallerModuleLoader(ModuleIdentifier.fromString(moduleName)).getClassLoader();
} catch (ModuleLoadException e) {
throw new ConfigXMLParseException(e);
}
}
}

private static void parseConnectionsType(final ConfigurationXMLStreamReader streamReader, final EJBClientContext.Builder builder) throws ConfigXMLParseException {
if (streamReader.getAttributeCount() > 0) {
throw streamReader.unexpectedAttribute(0);
Expand Down

0 comments on commit d620c9d

Please sign in to comment.