use of org.bimserver.shared.LocalDevelopmentResourceFetcher in project BIMserver by opensourceBIM.
the class MemoryLeakTester method start.
public void start(int id, String address, int port, int pbport, Path[] pluginDirectories) {
BimServerConfig config = new BimServerConfig();
config.setHomeDir(Paths.get("home" + id));
config.setResourceFetcher(new LocalDevelopmentResourceFetcher(Paths.get("../")));
config.setStartEmbeddedWebServer(true);
config.setClassPath(System.getProperty("java.class.path"));
config.setStartCommandLine(false);
config.setLocalDev(true);
config.setPort(port);
bimServer = new BimServer(config);
bimServer.getVersionChecker().getLocalVersion().setDate(new Date());
try {
LocalDevPluginLoader.loadPlugins(bimServer.getPluginManager(), pluginDirectories);
bimServer.start();
if (bimServer.getServerInfo().getServerState() == ServerState.NOT_SETUP) {
AdminInterface adminInterface = bimServer.getServiceFactory().get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL).get(AdminInterface.class);
adminInterface.setup("http://localhost:" + port, "Administrator", "admin@bimserver.org", "admin", null, null, null);
SettingsInterface settingsInterface = bimServer.getServiceFactory().get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL).get(SettingsInterface.class);
settingsInterface.setCacheOutputFiles(false);
}
bimServer.stop();
bimServer = null;
Thread.sleep(1000000);
} catch (PluginException e) {
LOGGER.error("", e);
} catch (ServiceException e) {
LOGGER.error("", e);
} catch (DatabaseInitException e) {
LOGGER.error("", e);
} catch (BimserverDatabaseException e) {
LOGGER.error("", e);
} catch (DatabaseRestartRequiredException e) {
LOGGER.error("", e);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Aggregations