1 /*******************************************************************************
2 * Copyright (c) 2016 hangum.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the GNU Lesser Public License v2.1
5 * which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
9 * hangum - initial API and implementation
10 ******************************************************************************/
11 package com
.hangum
.tadpole
.engine
.initialize
;
15 import org
.apache
.commons
.lang
.StringUtils
;
16 import org
.apache
.log4j
.Logger
;
17 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
19 import com
.hangum
.tadpole
.commons
.util
.ApplicationArgumentUtils
;
20 import com
.hangum
.tadpole
.engine
.license
.LicenseExtensionHandler
;
23 * Application license initialize
28 public class ApplicationLicenseInitialize
{
29 private static final Logger logger
= Logger
.getLogger(ApplicationLicenseInitialize
.class);
30 public static String TDB_License_FILE
= ApplicationArgumentUtils
.getResourcesDir() + "TadpoleHub.lic";
32 public static void load() {
33 LicenseExtensionHandler linceseHandler
= new LicenseExtensionHandler();
35 String strLicenseInfo
= ApplicationArgumentUtils
.initDBServer();
36 if(!StringUtils
.isEmpty(strLicenseInfo
)) {
37 logger
.info("******** [0] Start enterprise version ");
38 linceseHandler
.license(strLicenseInfo
);
40 File fileExist
= new File(TDB_License_FILE
);
41 if(fileExist
.isFile()) {
42 logger
.info("******** [1] Start enterprise version ");
43 linceseHandler
.license(fileExist
);
46 } catch(Exception e
) {
47 logger
.error("System initialize exception", e
);
48 MessageDialog
.openError(null, "Error", "License validation exception\n" + e
.getMessage());
61 public static void liveChange(String strLicense
) throws Exception
{
62 LicenseExtensionHandler linceseHandler
= new LicenseExtensionHandler();
63 linceseHandler
.liveChange(strLicense
);