protected void configureMessage( final Message message, final AOObject obj, final Region region, final String action) { Map<String, Serializable> messageMap = null; if (message instanceof PropertyMessage) { messageMap = ((PropertyMessage) message).getPropertyMapRef(); } else if (message instanceof WorldManagerClient.TargetedPropertyMessage) { messageMap = ((WorldManagerClient.TargetedPropertyMessage) message).getPropertyMapRef(); } if (messageMap != null) { if (action != null) { messageMap.put("regionAction", action); } if (this.messageProperties != null) { messageMap.putAll(this.messageProperties); } } final String messageRegionProperties = (String) region.getProperty("messageRegionProperties"); if (messageRegionProperties != null && messageMap != null) { this.copyProperties(messageRegionProperties, region.getPropertyMapRef(), messageMap); } final String objectProperties = (String) region.getProperty("messageObjectProperties"); if (objectProperties != null && messageMap != null) { this.copyProperties(objectProperties, obj.getPropertyMap(), messageMap); } if (Log.loggingDebug && messageMap != null) { Log.debug("MessageRegionTrigger: properties=" + DebugUtils.mapToString(messageMap)); } }
protected Message makeMessage(final AOObject obj, final Region region) { MessageType type = null; final String typeName = (String) region.getProperty("messageType"); if (typeName != null && !typeName.equals("")) { type = MessageCatalog.getMessageType(typeName); if (type == null) { Log.error("MessageRegionTrigger: unknown messageType=" + typeName); return null; } } String messageClass = (String) region.getProperty("messageClass"); if (messageClass == null || messageClass.equals("")) { messageClass = "extension"; } final String extensionType = (String) region.getProperty("messageExtensionType"); Message message = null; if (messageClass.equals("extension")) { if (this.mode == 1) { final WorldManagerClient.TargetedExtensionMessage extMessage = new WorldManagerClient.TargetedExtensionMessage(obj.getOid(), obj.getOid()); if (extensionType != null) { extMessage.setExtensionType(extensionType); } message = extMessage; } else if (this.mode == 2) { final WorldManagerClient.ExtensionMessage extMessage2 = new WorldManagerClient.ExtensionMessage(obj.getOid()); if (extensionType != null) { extMessage2.setExtensionType(extensionType); } message = extMessage2; } } else if (messageClass.equals("property")) { if (this.mode == 1) { message = new WorldManagerClient.TargetedPropertyMessage(obj.getOid(), obj.getOid()); } else if (this.mode == 2) { message = new PropertyMessage(type, obj.getOid()); } } if (message != null && type != null) { message.setMsgType(type); } return message; }