// JNDI name in jboss-client.xml or display-name in application-client.xml, or client jar simple name
String applicationClientName = "refs-client";
String name = new Date().toString();
String args[] = { name };
ClientLauncher launcher = new ClientLauncher();
Properties env = getENCProps(applicationClientName);
launcher.launch(mainClassName, applicationClientName, args, env);
// Need to use the client class obtained from the launcher
Class<?> clientClass = ClientLauncher.getTheMainClass();
Class<?> empty[] = {};
{