我正在尝试使用Embeddable Glassfish 应用程序客户端容器。我能找到的唯一资源是上面提到的包含这个诱人代码片段的 javadocs
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());
(或者,或者)
AppClientContainer acc = builder.newContainer(MyClient.class);
然后,
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();
这看起来非常棒,但我试图让它运行几次,出现各种不同的错误。
有没有人有任何使用这个的经验,或者他们可以向我指出一些解释如何使用它的资源的方向?