X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics%2Fsrc%2Forg%2Fsimantics%2FSimantics.java;h=9a1a354f17131b35e1fbfd7bfcc0565645b95616;hb=53062e8f34c2d2a910e4e81835c81ebafef1a374;hp=9529628eaee3bab8dc38bec39cd1ee15a6db3e7f;hpb=a59995774f0856353ef4203538540388b019c4c4;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics/src/org/simantics/Simantics.java b/bundles/org.simantics/src/org/simantics/Simantics.java index 9529628ea..9a1a354f1 100644 --- a/bundles/org.simantics/src/org/simantics/Simantics.java +++ b/bundles/org.simantics/src/org/simantics/Simantics.java @@ -27,6 +27,7 @@ import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.Session; import org.simantics.db.WriteGraph; +import org.simantics.db.common.Indexing; import org.simantics.db.common.procedure.adapter.ProcedureAdapter; import org.simantics.db.exception.DatabaseException; import org.simantics.db.exception.RuntimeDatabaseException; @@ -125,6 +126,16 @@ public class Simantics { ontologyPolicy = OntologyRecoveryPolicy.ReinstallDatabase; } + if (args.contains(SimanticsArguments.DISABLE_INDEX)) { + Indexing.setDefaultDependenciesIndexingEnabled(false); + } + + String databaseDriverId = defaultDatabaseDriverId; + if (args.contains(SimanticsArguments.DATABASE_ID)) { + databaseDriverId = args.get(SimanticsArguments.DATABASE_ID); + Simantics.setDefaultDatabaseDriver(databaseDriverId); + } + int localPort = 0; if (args.contains(SimanticsArguments.LOCAL_SERVER_PORT)) { try { @@ -144,7 +155,7 @@ public class Simantics { // } // } - return startUpHeadless(progress, workspacePolicy, ontologyPolicy, localPort /*, remoteDatabase*/); + return startUpHeadless(progress, workspacePolicy, ontologyPolicy, localPort, databaseDriverId /*, remoteDatabase*/); } /** @@ -156,7 +167,7 @@ public class Simantics { * @return * @throws PlatformException */ - public static ISessionContext startUpHeadless(IProgressMonitor progress, RecoveryPolicy workspacePolicy, OntologyRecoveryPolicy ontologyPolicy, int localPort) throws PlatformException { + public static ISessionContext startUpHeadless(IProgressMonitor progress, RecoveryPolicy workspacePolicy, OntologyRecoveryPolicy ontologyPolicy, int localPort, String databaseDriverId) throws PlatformException { if (SimanticsPlatform.INSTANCE.sessionContext != null) { throw new RuntimeDatabaseException("Simantics is already up and running."); } @@ -169,7 +180,7 @@ public class Simantics { if (progress == null) progress = new NullProgressMonitor(); - return SimanticsPlatform.INSTANCE.startUp(defaultDatabaseDriverId, progress, workspacePolicy, ontologyPolicy, true, new ConsoleUserAgent()); + return SimanticsPlatform.INSTANCE.startUp(databaseDriverId, progress, workspacePolicy, ontologyPolicy, true, new ConsoleUserAgent()); } /**