001
014
015 package com.liferay.portal.kernel.messaging;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.GetterUtil;
020
021
024 public class HotDeployMessageListener extends BaseMessageListener {
025
026 public HotDeployMessageListener(String servletContextName) {
027 _servletContextName = servletContextName;
028 }
029
030 @Override
031 protected void doReceive(Message message) throws Exception {
032 String servletContextName = GetterUtil.getString(
033 message.getString("servletContextName"));
034
035 if (!servletContextName.equals(_servletContextName)) {
036 return;
037 }
038
039 String command = GetterUtil.getString(message.getString("command"));
040
041 if (command.equals("deploy")) {
042 onDeploy();
043 }
044 else if (command.equals("undeploy")) {
045 onUndeploy();
046 }
047 }
048
049 protected void onDeploy() throws Exception {
050 }
051
052 protected void onUndeploy() throws Exception {
053 }
054
055 private static Log _log = LogFactoryUtil.getLog(
056 HotDeployMessageListener.class);
057
058 private String _servletContextName;
059
060 }