src/jdk.jpackage/share/native/libapplauncher/Package.h
author kcr
Thu, 10 Jan 2019 11:30:09 -0800
branchJDK-8200758-branch
changeset 57106 ea870b9ce89a
parent 57099 9a85a7a076ad
child 57316 2891b3ae222d
permissions -rw-r--r--
8216492: Update copyright of all new jpackage fils to 2019 Reviewed-by: herrick
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57064
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
     1
/*
57106
ea870b9ce89a 8216492: Update copyright of all new jpackage fils to 2019
kcr
parents: 57099
diff changeset
     2
 * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
57064
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
     4
 *
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    10
 *
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    15
 * accompanied this code).
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    16
 *
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    20
 *
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    23
 * questions.
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    24
 */
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    25
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    26
#ifndef PACKAGE_H
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    27
#define PACKAGE_H
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    28
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    29
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    30
#include "Platform.h"
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    31
#include "PlatformString.h"
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    32
#include "FilePath.h"
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    33
#include "PropertyFile.h"
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    34
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    35
#include <map>
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    36
#include <list>
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    37
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    38
class PackageBootFields {
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    39
public:
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    40
    enum MemoryState {msManual, msAuto};
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    41
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    42
public:
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    43
    OrderedMap<TString, TString> FJVMArgs;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    44
    std::list<TString> FArgs;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    45
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    46
    TString FPackageRootDirectory;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    47
    TString FPackageAppDirectory;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    48
    TString FPackageLauncherDirectory;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    49
    TString FAppDataDirectory;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    50
    TString FAppID;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    51
    TString FPackageAppDataDirectory;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    52
    TString FClassPath;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    53
    TString FModulePath;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    54
    TString FMainJar;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    55
    TString FMainModule;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    56
    TString FMainClassName;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    57
    TString FJVMRuntimeDirectory;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    58
    TString FJVMLibraryFileName;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    59
    TString FSplashScreenFileName;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    60
    bool FUseJavaPreferences;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    61
    TString FCommandName;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    62
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    63
    TString FAppCDSCacheFileName;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    64
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    65
    TPlatformNumber FMemorySize;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    66
    MemoryState FMemoryState;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    67
};
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    68
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    69
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    70
class Package {
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    71
private:
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    72
    Package(Package const&); // Don't Implement.
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    73
    void operator=(Package const&); // Don't implement
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    74
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    75
private:
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    76
    bool FInitialized;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    77
    PackageBootFields* FBootFields;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    78
    TString FAppCDSCacheDirectory;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    79
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    80
    DebugState FDebugging;
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    81
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    82
    Package(void);
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    83
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    84
    TString GetMainJar();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    85
    void ReadJVMArgs(ISectionalPropertyContainer* Config);
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    86
    void PromoteAppCDSState(ISectionalPropertyContainer* Config);
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    87
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    88
public:
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    89
    static Package& GetInstance();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    90
    ~Package(void);
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    91
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    92
    void Initialize();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    93
    void Clear();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    94
    void FreeBootFields();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    95
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    96
    void SetCommandLineArguments(int argc, TCHAR* argv[]);
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    97
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    98
    OrderedMap<TString, TString> GetJVMArgs();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
    99
    TString GetMainModule();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   100
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   101
    std::list<TString> GetArgs();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   102
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   103
    TString GetPackageRootDirectory();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   104
    TString GetPackageAppDirectory();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   105
    TString GetPackageLauncherDirectory();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   106
    TString GetAppDataDirectory();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   107
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   108
    TString GetAppCDSCacheDirectory();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   109
    TString GetAppCDSCacheFileName();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   110
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   111
    TString GetAppID();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   112
    TString GetPackageAppDataDirectory();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   113
    TString GetClassPath();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   114
    TString GetModulePath();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   115
    TString GetMainClassName();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   116
    TString GetJVMLibraryFileName();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   117
    TString GetJVMRuntimeDirectory();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   118
    TString GetSplashScreenFileName();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   119
    bool HasSplashScreen();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   120
    TString GetCommandName();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   121
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   122
    TPlatformNumber GetMemorySize();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   123
    PackageBootFields::MemoryState GetMemoryState();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   124
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   125
    DebugState Debugging();
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   126
};
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   127
a7fdadf67a92 8214899: rename papplauncher and it's library and move src to appropriate places
herrick
parents:
diff changeset
   128
#endif // PACKAGE_H