I'm trying to work with the Embeddable Glassfish app client container. The only resources I can find are the above mentioned javadocs which contain this tantalising code snippet
import org.glassfish.appclient.client.acc.AppClientContainer;
import org.glassfish.appclient.client.acc.config.TargetServer;
AppClientContainerBuilder builder = AppClientContainer.newBuilder(
new TargetServer("localhost", 3700));
AppClientContainer acc = builder.newContainer(new File("myAC.jar").toURI());
(or, alternatively)
AppClientContainer acc = builder.newContainer(MyClient.class);
then,
acc.startClient(clientArgs);
// The newContainer method returns as soon as the client's main method returns,
// even if the client has started another thread or is using the AWT event
// dispatcher thread
// At some later point, the program can synchronize with the app client in
// a user-specified way at which point it could invoke
acc.stop();
This looks pretty awesome, but I've tried to get this to run a couple of times with various different errors.
Has anybody got any experience using this, or could they point me in the direction of some resources that explain how to work with this?