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