runtime = GlassFishRuntime.bootstrap(bootstrapProperties);
GlassFish server = runtime.newGlassFish(glassFishProperties);
if (l.instance_root != null && !l.reuse_instance_location) {
// XXX Start the server to get the services
server.start();
EmbeddedSecurity es = server.getService(EmbeddedSecurity.class);
Habitat habitat = server.getService(Habitat.class);
// XXX Wait a little before stopping to avoid a deadlock
Thread.sleep(1000);
server.stop();
// If we are running from an existing install, copy over security files to the temp instance
if (es != null) {
es.copyConfigFiles(habitat, l.instance_root, l.domain_file);
}
}
// server is started in EJBContainerImpl constructor
container = new EJBContainerImpl(server);