/** * Log this transaction. * @param strLogData Data to log */ public synchronized void logTrx(Object objLogData) { BaseMessage message = this.getMessageObject(); message.putNative(MESSAGE_PARAM, objLogData); this.getMessageManager().sendMessage(message); } /**
/** * StartProcess Method. */ public void startProcess(String strProcessName, int iCount) { Map<String,Object> properties = new HashMap<String,Object>(); properties.put(DBParams.PROCESS, strProcessName); properties.put(DBParams.TABLE, this.getProperty(DBParams.TABLE)); properties.put("count", iCount); Application app = (Application)this.getTask().getApplication(); String strQueueName = MessageConstants.TRX_SEND_QUEUE; String strQueueType = MessageConstants.INTRANET_QUEUE; BaseMessage message = new MapMessage(new TrxMessageHeader(strQueueName, strQueueType, properties), properties); app.getMessageManager().sendMessage(message); }
/** * RunUpdater Method. */ public boolean runUpdater() { Map<String,Object> properties = new HashMap<String,Object>(); String strTableName = this.getMainRecord().getTableNames(false); properties.put(DBParams.PROCESS, HotelAvailProcess.class.getName()); properties.put(DBParams.TABLE, strTableName); Application app = (Application)this.getTask().getApplication(); String strQueueName = MessageConstants.TRX_SEND_QUEUE; String strQueueType = MessageConstants.INTRANET_QUEUE; BaseMessage message = new MapMessage(new TrxMessageHeader(strQueueName, strQueueType, properties), properties); app.getMessageManager().sendMessage(message); return true; }
/** * A record with this datasource handle changed, notify any behaviors that are checking. * NOTE: Be very careful as this code is running in an independent thread * (synchronize to the task before calling record calls). * NOTE: For now, you are only notified of the main record changes. * @param message The message to handle. * @return The error code. */ public int handleMessage(BaseMessage message) { System.out.println("---------------------------------------------------------- HotelSession/86"); if (message instanceof BaseMessage) { Double dblRate = (Double)message.get(BookingDetail.TOTAL_COST); if (message.get(HotelRateResponse.PRODUCT_RESPONSE_MESSAGE) instanceof HotelRateResponseMessageData) { dblRate = new Double(((HotelRateResponseMessageData)message.get(HotelRateResponse.PRODUCT_RESPONSE_MESSAGE)).getRoomCost(PaxCategory.DOUBLE_ID)); } MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager(); BaseMessageHeader messageFilter = message.getMessageHeader(); BaseMessageHeader messageHeader = new SessionMessageHeader(null, this); Map<String,Object> properties = new Hashtable<String,Object>(); properties.put("hotelCost", dblRate); BaseMessage messageTableUpdate = new MapMessage(messageHeader, properties); messageManager.sendMessage(messageTableUpdate); } return super.handleMessage(message); }
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.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!) env.getMessageManager(m_application, true).sendMessage(message); // 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); } };
app.getMessageManager().sendMessage(message);
app.getMessageManager().sendMessage(message);
app.getMessageManager().sendMessage(message);
app.getMessageManager().sendMessage(message);
messageManager.sendMessage(messageOut);
this.setupScreenStatus(recProduct, BaseStatus.REQUEST_SENT); if (messageManager != null) messageManager.sendMessage(message);
this.setupScreenStatus(recProduct, BaseStatus.REQUEST_SENT); if (messageManager != null) messageManager.sendMessage(message);
messageManager.sendMessage(m_message);
RecordMessageHeader messageHeader = new RecordMessageHeader(m_record, bookmark, source, iRecordMessageType, null); BaseMessage messageNew = new RecordMessage(messageHeader); ((Application)recordOwner.getTask().getApplication()).getMessageManager().sendMessage(messageNew);
messageManager.sendMessage(messageOut); messageManager.sendMessage(message); messageManager.sendMessage(message);
if (this.getTask().getApplication() instanceof Application) // Always if (((Application)this.getTask().getApplication()).getMessageManager() != null) ((Application)this.getTask().getApplication()).getMessageManager().sendMessage(message); // Have database notify everyone else