1
14
15 package com.liferay.portal.deploy.auto;
16
17 import com.liferay.portal.deploy.DeployUtil;
18 import com.liferay.portal.kernel.deploy.auto.AutoDeployException;
19 import com.liferay.portal.kernel.log.Log;
20 import com.liferay.portal.kernel.log.LogFactoryUtil;
21 import com.liferay.portal.kernel.util.PropsKeys;
22 import com.liferay.portal.kernel.util.ServerDetector;
23 import com.liferay.portal.kernel.util.StringPool;
24 import com.liferay.portal.tools.deploy.ExtDeployer;
25 import com.liferay.portal.util.PrefsPropsUtil;
26 import com.liferay.portal.util.PropsValues;
27
28 import java.util.ArrayList;
29 import java.util.List;
30
31
36 public class ExtAutoDeployer extends ExtDeployer implements AutoDeployer {
37
38 public ExtAutoDeployer() {
39 try {
40 baseDir = PrefsPropsUtil.getString(
41 PropsKeys.AUTO_DEPLOY_DEPLOY_DIR,
42 PropsValues.AUTO_DEPLOY_DEPLOY_DIR);
43 destDir = DeployUtil.getAutoDeployDestDir();
44 appServerType = ServerDetector.getServerId();
45 unpackWar = PrefsPropsUtil.getBoolean(
46 PropsKeys.AUTO_DEPLOY_UNPACK_WAR,
47 PropsValues.AUTO_DEPLOY_UNPACK_WAR);
48 filePattern = StringPool.BLANK;
49 jbossPrefix = PrefsPropsUtil.getString(
50 PropsKeys.AUTO_DEPLOY_JBOSS_PREFIX,
51 PropsValues.AUTO_DEPLOY_JBOSS_PREFIX);
52 tomcatLibDir = PrefsPropsUtil.getString(
53 PropsKeys.AUTO_DEPLOY_TOMCAT_LIB_DIR,
54 PropsValues.AUTO_DEPLOY_TOMCAT_LIB_DIR);
55
56 List<String> jars = new ArrayList<String>();
57
58 addRequiredJar(jars, "util-java.jar");
59
60 this.jars = jars;
61
62 checkArguments();
63 }
64 catch (Exception e) {
65 _log.error(e);
66 }
67 }
68
69 public void autoDeploy(String file) throws AutoDeployException {
70 List<String> wars = new ArrayList<String>();
71
72 wars.add(file);
73
74 this.wars = wars;
75
76 try {
77 deploy();
78 }
79 catch (Exception e) {
80 throw new AutoDeployException(e);
81 }
82 }
83
84 private static Log _log = LogFactoryUtil.getLog(ExtAutoDeployer.class);
85
86 }