if (intFilterID != null) // If registry ID is null. strReturn = intFilterID.toString(); Integer intRegistryFilterID = ((BaseMessageFilter)objReturn).getRegistryID(); if (intRegistryFilterID != null) // Always strReturn = intRegistryFilterID.toString();
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager(); if (messageManager != null) { Object source = this; BaseMessageFilter filter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, source, null); filter.addMessageListener(this); messageManager.addMessageFilter(filter); m_intRegistryID = filter.getRegistryID(); } } /**
/** * Add behaviors to this session. */ public void addListeners() { super.addListeners(); // BaseMessageFilter remoteFilter = new ServerSessionMessageFilter(messageFilter.getQueueName(), messageFilter.getQueueType(), null, this); //System.out.println("Remote filter " + remoteFilter); BaseMessageFilter filterForSession = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, null, null); MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager(); messageManager.addMessageFilter(filterForSession); filterForSession.addMessageListener(this); m_intRegistryID = filterForSession.getRegistryID(); } /**
filter.addMessageListener(this); messageManager.addMessageFilter(filter); m_intRegistryID = filter.getRegistryID();
filter.addMessageListener(this); messageManager.addMessageFilter(filter); m_intRegistryID = filter.getRegistryID();
/** * Add this message filter to this receive queue. * Also adds a message filter to the remote queue. * @param The message filter to add. * @return The message filter passed in. */ public void addMessageFilter(MessageFilter messageFilter) { super.addMessageFilter(messageFilter); try { // If at all possible, pass the queue's current session, so the filter is in the proper environment if (((BaseMessageFilter)messageFilter).isCreateRemoteFilter()) // Almost always true { // Create the remote version of this filter. RemoteSession remoteSession = (RemoteSession)((BaseMessageFilter)messageFilter).getRemoteSession(); BaseMessageFilter remoteFilter = m_receiveQueue.addRemoteMessageFilter((BaseMessageFilter)messageFilter, remoteSession); ((BaseMessageFilter)messageFilter).setRemoteFilterInfo(remoteFilter.getQueueName(), remoteFilter.getQueueType(), remoteFilter.getFilterID(), remoteFilter.getRegistryID()); } } catch (RemoteException ex) { ex.printStackTrace(); } } /**
/** * AddAvailabilityMessageListeners Method. */ public void addAvailabilityMessageListeners(Product recProduct, ProductScreenRecord screenRecord) { // Override this to add the listeners and message queues (remember to call super) // Create a private messageReceiver and listen for changes MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager(); Integer intRegistryID = null; if (messageManager != null) { Object source = this; BaseMessageFilter messageFilter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, source, null); messageManager.addMessageFilter(messageFilter); this.addProductAvailabilityMessageFilter(recProduct, messageFilter); recProduct.addListener(new FreeOnFreeHandler(messageFilter)); intRegistryID = messageFilter.getRegistryID(); recProduct.addListener(this.getProductAvailabilityHandler(screenRecord, intRegistryID)); } } /**
/** * AddAvailabilityMessageListeners Method. */ public void addAvailabilityMessageListeners(Product recProduct, ProductScreenRecord screenRecord) { // Override this to add the listeners and message queues (remember to call super) // Create a private messageReceiver and listen for changes MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager(); Integer intRegistryID = null; if (messageManager != null) { Object source = this; BaseMessageFilter messageFilter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, source, null); messageManager.addMessageFilter(messageFilter); this.addProductAvailabilityMessageFilter(recProduct, messageFilter); recProduct.addListener(new FreeOnFreeHandler(messageFilter)); intRegistryID = messageFilter.getRegistryID(); recProduct.addListener(this.getProductAvailabilityHandler(screenRecord, intRegistryID)); } } /**
messageFilter.setRegistryID(remoteFilter.getRegistryID()); return messageFilter; // All client needs if the name/type/and ID of the remote filter. (Don't pass the remoteFilter as it's class may not be accessable to thin).
/** * Add the listeners and message queues for rate lookups. * (todo - Don't set this up until they are required). */ public void addRateMessageListeners(Product recProduct, ProductScreenRecord screenRecord) { // Override this to add the listeners and message queues (remember to call super) this.getMainRecord().getField(Product.PRODUCT_COST).setSelected(true); // Now you can calc the USD amount (since you have this local amount) this.getMainRecord().getField(Product.PRODUCT_COST).addListener(new CalcProductAmountHome(this.getMainRecord().getField(Product.PRODUCT_COST_LOCAL))); this.getMainRecord().getField(Product.PP_COST).addListener(new CalcProductAmountHome(this.getMainRecord().getField(Product.PP_COST_LOCAL))); // Create a private messageReceiver and listen for changes MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager(); Integer intRegistryID = null; if (messageManager != null) { Object source = this; BaseMessageFilter messageFilter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, source, null); messageManager.addMessageFilter(messageFilter); this.addProductRateMessageFilter(recProduct, messageFilter); recProduct.addListener(new FreeOnFreeHandler(messageFilter)); intRegistryID = messageFilter.getRegistryID(); recProduct.addListener(this.getProductCostHandler(screenRecord, intRegistryID)); } } /**
/** * Add the listeners and message queues for rate lookups. * (todo - Don't set this up until they are required). */ public void addRateMessageListeners(Product recProduct, ProductScreenRecord screenRecord) { // Override this to add the listeners and message queues (remember to call super) this.getMainRecord().getField(Product.PRODUCT_COST).setSelected(true); // Now you can calc the USD amount (since you have this local amount) this.getMainRecord().getField(Product.PRODUCT_COST).addListener(new CalcProductAmountHome(this.getMainRecord().getField(Product.PRODUCT_COST_LOCAL))); this.getMainRecord().getField(Product.PP_COST).addListener(new CalcProductAmountHome(this.getMainRecord().getField(Product.PP_COST_LOCAL))); // Create a private messageReceiver and listen for changes MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager(); Integer intRegistryID = null; if (messageManager != null) { Object source = this; BaseMessageFilter messageFilter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, source, null); messageManager.addMessageFilter(messageFilter); this.addProductRateMessageFilter(recProduct, messageFilter); recProduct.addListener(new FreeOnFreeHandler(messageFilter)); intRegistryID = messageFilter.getRegistryID(); recProduct.addListener(this.getProductCostHandler(screenRecord, intRegistryID)); } } /**
/** * Add the listeners and message queues for rate lookups. */ public void addRateMessageListeners(Product recProduct, ProductScreenRecord screenRecord) { // Override this to add the listeners and message queues (remember to call super) this.getMainRecord().getField(Product.PRODUCT_COST).setSelected(true); // Now you can calc the USD amount (since you have this local amount) this.getMainRecord().getField(Product.PRODUCT_COST).addListener(new CalcProductAmountHome(this.getMainRecord().getField(Product.PRODUCT_COST_LOCAL))); this.getMainRecord().getField(Product.PP_COST).setSelected(true); // Now you can calc the USD amount (since you have this local amount) this.getMainRecord().getField(Product.PP_COST).addListener(new CalcProductAmountHome(this.getMainRecord().getField(Product.PP_COST_LOCAL))); // Create a private messageReceiver and listen for changes MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager(); Integer intRegistryID = null; if (messageManager != null) { Object source = this; BaseMessageFilter messageFilter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, source, null); messageManager.addMessageFilter(messageFilter); this.addProductRateMessageFilter(recProduct, messageFilter); recProduct.addListener(new FreeOnFreeHandler(messageFilter)); intRegistryID = messageFilter.getRegistryID(); recProduct.addListener(this.getProductCostHandler(screenRecord, intRegistryID)); } } /**
/** * Add the listeners and message queues for rate lookups. */ public void addRateMessageListeners(Product recProduct, ProductScreenRecord screenRecord) { // Override this to add the listeners and message queues (remember to call super) this.getMainRecord().getField(Product.PRODUCT_COST).setSelected(true); // Now you can calc the USD amount (since you have this local amount) this.getMainRecord().getField(Product.PRODUCT_COST).addListener(new CalcProductAmountHome(this.getMainRecord().getField(Product.PRODUCT_COST_LOCAL))); this.getMainRecord().getField(Product.PP_COST).setSelected(true); // Now you can calc the USD amount (since you have this local amount) this.getMainRecord().getField(Product.PP_COST).addListener(new CalcProductAmountHome(this.getMainRecord().getField(Product.PP_COST_LOCAL))); // Create a private messageReceiver and listen for changes MessageManager messageManager = ((Application)this.getTask().getApplication()).getMessageManager(); Integer intRegistryID = null; if (messageManager != null) { Object source = this; BaseMessageFilter messageFilter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, source, null); messageManager.addMessageFilter(messageFilter); this.addProductRateMessageFilter(recProduct, messageFilter); recProduct.addListener(new FreeOnFreeHandler(messageFilter)); intRegistryID = messageFilter.getRegistryID(); recProduct.addListener(this.getProductCostHandler(screenRecord, intRegistryID)); } } /**