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