1
14
15 package com.liferay.portal.kernel.util;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19
20
25 public abstract class BasePortalLifecycle implements PortalLifecycle {
26
27 public void portalDestroy() {
28 if (!_calledPortalDestroy) {
29 PortalLifecycleUtil.removeDestroy(this);
30
31 try {
32 doPortalDestroy();
33 }
34 catch (Exception e) {
35 _log.error(e, e);
36 }
37
38 _calledPortalDestroy = true;
39 }
40 }
41
42 public void portalInit() {
43 try {
44 doPortalInit();
45 }
46 catch (Exception e) {
47 _log.error(e, e);
48 }
49 }
50
51 public void registerPortalLifecycle() {
52 PortalLifecycleUtil.register(this);
53 }
54
55 public void registerPortalLifecycle(int method) {
56 PortalLifecycleUtil.register(this, method);
57 }
58
59 protected abstract void doPortalDestroy() throws Exception;
60
61 protected abstract void doPortalInit() throws Exception;
62
63 private static Log _log = LogFactoryUtil.getLog(BasePortalLifecycle.class);
64
65 private boolean _calledPortalDestroy;
66
67 }