modules/jdk.packager/src/main/native/library/common/Platform.h
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
* This file is available and licensed under the following license:
*
* Redistribution and use in source and binary forms, with or without
@@ -142,10 +142,11 @@
#define APP_NAME_KEY _T("APP_NAME_KEY")
#define CONFIG_SPLASH_KEY _T("CONFIG_SPLASH_KEY")
#define CONFIG_APP_ID_KEY _T("CONFIG_APP_ID_KEY")
#define CONFIG_APP_MEMORY _T("CONFIG_APP_MEMORY")
#define CONFIG_APP_DEBUG _T("CONFIG_APP_DEBUG")
+#define CONFIG_APPLICATION_INSTANCE _T("CONFIG_APPLICATION_INSTANCE")
#define JVM_RUNTIME_KEY _T("JVM_RUNTIME_KEY")
#define PACKAGER_APP_DATA_DIR _T("CONFIG_APP_IDENTIFIER")
@@ -384,17 +385,19 @@
class Platform {
private:
AppCDSState FAppCDSState;
protected:
- Platform(void) {
- FAppCDSState = cdsUninitialized;
+ TProcessID singleInstanceProcessId;
+
+ Platform(void): FAppCDSState(cdsUninitialized), singleInstanceProcessId(0) {
}
public:
AppCDSState GetAppCDSState() { return FAppCDSState; }
void SetAppCDSState(AppCDSState Value) { FAppCDSState = Value; }
+ TProcessID GetSingleInstanceProcessId() { return singleInstanceProcessId; }
static Platform& GetInstance();
virtual ~Platform(void) {}
@@ -442,10 +445,12 @@
// Caller must free result.
virtual Process* CreateProcess() = 0;
virtual bool IsMainThread() = 0;
+ virtual bool CheckForSingleInstance(TString Name) = 0;
+ virtual void reactivateAnotherInstance() = 0;
// Returns megabytes.
virtual TPlatformNumber GetMemorySize() = 0;
virtual std::map<TString, TString> GetKeys() = 0;