ColdFusion 9.0 Resources |
addEventSee alsogetMaxQueueSize, getMaxQueueSize, Responding to incoming messages in the Developing ColdFusion Applications Parameters
ReturnsTrue if the event was added to the gateway services queue for delivery, false, otherwise. Therefore, a true response does not indicate that the message was delivered. UsageThe event gateway must use this method to send incoming messages to the application for processing. ExampleThe following example from the ColdFusion SocketGateway code sends an event to all listener CFCs: for (int i = 0; i < listeners.length; i++) { String path = listeners[i]; CFEvent event = new CFEvent(gatewayID); Hashtable mydata = new Hashtable(); mydata.put("MESSAGE", theInput); event.setData(mydata); event.setGatewayType("SocketGateway"); event.setOriginatorID(theKey); event.setCfcMethod(cfcEntryPoint); event.setCfcTimeOut(10); if (path != null) event.setCfcPath(path); boolean sent = gatewayService.addEvent(event); if (!sent) log.error("SocketGateway(" + gatewayID + ") Unable to put message on event queue. Message not sent from " + gatewayID + ", thread " + theKey + ".Message was " + theInput); } |