The CNMI Emulator class and the AsyncMessageProcessor class perform about the
same action: reading messages from the modem when required to do so.
I propose to modify the code of the CNMI EMulator. The class no longer reads
the messages from the modem but signals the AsyncMessageProcessor that it
should check for new messages
Here is the modified code for the process method of the Cnmi Emulator. I
included my additions between // WIm Stevens
The original code has been commented out
public void process() throws Exception
{
Logger.getInstance().logDebug("CNMI emulator cycle.", null, getGateway().getGatewayId());
if ((isConnected()) && (getGateway().getStatus() == GatewayStatuses.STARTED))
{
// Wim Stevens
getAsyncMessageProcessor().setProcess();
/*
synchronized (getSYNCInboundReader())
{
this.msgList = new ArrayList<InboundMessage>();
getGateway().readMessages(this.msgList, MessageClasses.ALL);
for (InboundMessage msg : this.msgList)
{
switch (msg.getType())
{
case INBOUND:
case STATUSREPORT:
Service.getInstance().getNotifyQueueManager().getNotifyQueue().add(new InboundMessageNotification(getGateway(), msg.getType(), msg));
break;
}
}
this.msgList.clear();
}
*/
// End Wim Stevens
}
}
Original issue reported on code.google.com by wim.stev...@gmail.com on 20 Mar 2012 at 10:30
Original issue reported on code.google.com by
wim.stev...@gmail.com
on 20 Mar 2012 at 10:30