1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.services.wcm.portal;
18
19 import org.exoplatform.services.log.ExoLogger;
20 import org.exoplatform.services.log.Log;
21 import org.exoplatform.services.scheduler.BaseJob;
22 import org.exoplatform.services.scheduler.JobContext;
23 import org.exoplatform.services.wcm.javascript.XJavascriptService;
24 import org.exoplatform.services.wcm.skin.XSkinService;
25 import org.exoplatform.services.wcm.utils.WCMCoreUtils;
26
27
28
29
30
31
32
33 public class XScriptJob extends BaseJob {
34
35
36 private static final Log LOG = ExoLogger.getLogger(XScriptJob.class.getName());
37
38
39
40
41 public void execute(JobContext arg0) throws Exception {
42 XJavascriptService jsService = WCMCoreUtils.getService(XJavascriptService.class);
43 XSkinService skinService = WCMCoreUtils.getService(XSkinService.class);
44 if(jsService == null || skinService == null) return;
45 try {
46 jsService.start();
47 skinService.start();
48 } catch (Exception e) {
49 if (LOG.isErrorEnabled()) {
50 LOG.error("Error when execute Javascript service updater", e);
51 }
52 }
53 }
54 }