/** * Don't create a new object each time. * @return */ public BaseMessage getMessageObject() { if (m_message == null) { Map<String,Object> properties = new Hashtable<String,Object>(); m_message = new MapMessage(new BaseMessageHeader(BACKUP_QUEUE_NAME, BACKUP_QUEUE_TYPE, this, null), properties); } return m_message; } /**
/** * Don't create a new object each time. * @return */ public BaseMessage getMessageObject() { if (m_message == null) { Map<String,Object> properties = new Hashtable<String,Object>(); m_message = new MapMessage(new BaseMessageHeader(BACKUP_QUEUE_NAME, BACKUP_QUEUE_TYPE, this, null), properties); } return m_message; } /**
/** * Don't create a new object each time. * @return */ public BaseMessage getMessageObject() { if (m_message == null) { Map<String,Object> properties = new Hashtable<String,Object>(); m_message = new MapMessage(new BaseMessageHeader(BACKUP_QUEUE_NAME, BACKUP_QUEUE_TYPE, this, null), properties); } return m_message; } /**
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); if ((iChangeType == DBConstants.AFTER_ADD_TYPE) || (iChangeType == DBConstants.AFTER_UPDATE_TYPE)) if (!getField(AnnivMaster.kProperties).isNull()) { // This will cause the JobScheduler to reschedule the jobs (now that they have changed) BaseMessageManager messageManager = ((Application)getTask().getApplication()).getMessageManager(); Map<String,Object> properties = new Hashtable<String,Object>(); properties.put(DBParams.PROCESS, JobSchedulerReference.JOB_PROCESS_NAME); if (messageManager != null) messageManager.sendMessage(new MapMessage(new BaseMessageHeader(CalendarEntry.JOB_QUEUE_NAME, MessageConstants.INTRANET_QUEUE, this, null), properties)); } return iErrorCode; } });
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); if ((iChangeType == DBConstants.AFTER_ADD_TYPE) || (iChangeType == DBConstants.AFTER_UPDATE_TYPE)) if (getSharedRecordTypeKey().getValue() == CalendarEntry.APPOINTMENT_ID) if (!getField(CalendarEntry.kProperties).isNull()) { // This will cause the JobScheduler to reschedule the jobs (now that they have changed) BaseMessageManager messageManager = ((Application)getTask().getApplication()).getMessageManager(); Map<String,Object> properties = new Hashtable<String,Object>(); properties.put(DBParams.PROCESS, JobSchedulerReference.JOB_PROCESS_NAME); if (messageManager != null) messageManager.sendMessage(new MapMessage(new BaseMessageHeader(JOB_QUEUE_NAME, MessageConstants.INTRANET_QUEUE, this, null), properties)); } return iErrorCode; } });
if (MESSAGE.equalsIgnoreCase(strName)) BaseMessageHeader messageHeader = new BaseMessageHeader("chat", "intranet", null, null); Map<String,Object> map = new Hashtable<String,Object>(); map.put("message", strParam);
properties.put(DBParams.PROCESS, MessageTimeoutProcess.class.getName()); if (messageManager != null) messageManager.sendMessage(new MapMessage(new BaseMessageHeader(MessageTimeoutProcess.TIMEOUT_QUEUE_NAME, MessageConstants.INTRANET_QUEUE, this, null), properties));
/** * RegisterProcessForMessage Method. */ public void registerProcessForMessage(BaseMessageFilter messageFilter, String strProcessClass, Map<String,Object> properties) { new TrxMessageListener(messageFilter, (Application)this.getTask().getApplication(), strProcessClass, properties); // This listener was added to the filter ((MessageInfoApplication)this.getTask().getApplication()).getThickMessageManager().addMessageFilter(messageFilter); // Note: No need to worry about cleanup... Freeing the message manager will free all these listeners. if (properties != null) if (properties.get(MessageInfoApplication.AUTOSTART) != null) ((MessageInfoApplication)this.getTask().getApplication()).getThickMessageManager().sendMessage(new MapMessage(new BaseMessageHeader(messageFilter.getQueueName(), messageFilter.getQueueType(), this, null), properties)); }
properties.remove(MessageInfoApplication.AUTOSTART); properties.put(DBParams.PROCESS, strProcessClass); BaseMessage messageInitial = new MapMessage(new BaseMessageHeader(message.getMessageHeader().getQueueName(), message.getMessageHeader().getQueueType(), this, null), properties); env.getMessageManager(m_application, true).sendMessage(messageInitial); // Resend it! (Don't consume it!)
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) { Task task = getTask(); Application application = (Application)task.getApplication(); String strQueueName = getProperty(MessageConstants.QUEUE_NAME); MessageManager messageManager = application.getMessageManager(); Map<String,Object> propHeader = new Hashtable<String,Object>(); Map<String,Object> propMessage = new Hashtable<String,Object>(); Record record = getParentScreen().getMainRecord(); if ((record.getEditMode() == DBConstants.EDIT_CURRENT) || (record.getEditMode() == DBConstants.EDIT_IN_PROGRESS)) { String bookmark = null; try { bookmark = record.getHandle(DBConstants.OBJECT_ID_HANDLE).toString(); } catch (DBException ex) { ex.printStackTrace(); } propMessage.put(RecordMessageConstants.TABLE_NAME, record.getTableNames(false)); propMessage.put(DBConstants.STRING_OBJECT_ID_HANDLE, bookmark); BaseMessageHeader messageHeader = new BaseMessageHeader(strQueueName, MessageConstants.INTRANET_QUEUE, this, propHeader); BaseMessage message = new MapMessage(messageHeader, propMessage); messageManager.sendMessage(message); } return super.doCommand(strCommand, sourceSField, iCommandOptions); } };
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) { Task task = getTask(); Application application = (Application)task.getApplication(); String strQueueName = getProperty(MessageConstants.QUEUE_NAME); MessageManager messageManager = application.getMessageManager(); Map<String,Object> propHeader = new Hashtable<String,Object>(); Map<String,Object> propMessage = new Hashtable<String,Object>(); Record record = getParentScreen().getMainRecord(); if ((record.getEditMode() == DBConstants.EDIT_CURRENT) || (record.getEditMode() == DBConstants.EDIT_IN_PROGRESS)) { String bookmark = null; try { bookmark = record.getHandle(DBConstants.OBJECT_ID_HANDLE).toString(); } catch (DBException ex) { ex.printStackTrace(); } propMessage.put(RecordMessageConstants.TABLE_NAME, record.getTableNames(false)); propMessage.put(DBConstants.STRING_OBJECT_ID_HANDLE, bookmark); BaseMessageHeader messageHeader = new BaseMessageHeader(strQueueName, MessageConstants.INTRANET_QUEUE, this, propHeader); BaseMessage message = new MapMessage(messageHeader, propMessage); messageManager.sendMessage(message); } return super.doCommand(strCommand, sourceSField, iCommandOptions); } };
properties.remove(MessageApplication.AUTOSTART); properties.put(DBParams.PROCESS, strProcessClass); BaseMessage messageInitial = new MapMessage(new BaseMessageHeader(message.getMessageHeader().getQueueName(), message.getMessageHeader().getQueueType(), this, null), properties); env.getMessageManager(m_application, true).sendMessage(messageInitial); // Resend it! (Don't consume it!)
properties.put(DBParams.PROCESS, MessageTimeoutProcess.class.getName()); if (messageManager != null) messageManager.sendMessage(new MapMessage(new BaseMessageHeader(MessageTimeoutProcess.TIMEOUT_QUEUE_NAME, MessageConstants.INTRANET_QUEUE, this, null), properties));
BaseMessageReceiver messageReceiver = (BaseMessageReceiver)messageManager.getMessageQueue(MessageConstants.RECORD_QUEUE_NAME, MessageConstants.INTRANET_QUEUE).getMessageReceiver(); MessageReceiverFilterList messageFilters = messageReceiver.getMessageFilterList(); BaseMessageHeader messageHeaderFilter = new BaseMessageHeader(MessageConstants.RECORD_QUEUE_NAME, MessageConstants.INTRANET_QUEUE, null, null);