}
}
protected static ModelControllerClient createClient(final String artifact, final String version, final String host, final int port) throws Exception {
final ChildFirstClassLoaderBuilder classLoaderBuilder = new ChildFirstClassLoaderBuilder(false);
classLoaderBuilder.addRecursiveMavenResourceURL(artifact + ":" + version, excludes);
classLoaderBuilder.addParentFirstClassPattern("org.jboss.as.controller.client.ModelControllerClientConfiguration");
classLoaderBuilder.addParentFirstClassPattern("org.jboss.as.controller.client.ModelControllerClient");
classLoaderBuilder.addParentFirstClassPattern("org.jboss.as.controller.client.OperationMessageHandler");
classLoaderBuilder.addParentFirstClassPattern("org.jboss.as.controller.client.Operation");
final ClassLoader classLoader = classLoaderBuilder.build();
final Class<?> factoryClass = classLoader.loadClass("org.jboss.as.controller.client.ModelControllerClient$Factory");
final Method factory = factoryClass.getMethod("create", String.class, int.class);
final Object client = factory.invoke(null, host, port);
final InvocationHandler invocationHandler = new InvocationHandler() {