[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Why is this so written?

gaohoward do-not-reply at jboss.com
Thu Mar 12 02:11:07 EDT 2009


In JBM 14 SimpleConnectionManager.cleanupForSessionID((String jmsSessionID),


  |          .....
  |        	ConnectionEndpoint conn = null;
  |          
  |        	for (Map.Entry<String, ConnectionEndpoint> entry: endpoints.entrySet())
  |        	{
  |        		if (entry.getKey().equals(jmsSessionID))
  |        		{   
  |        			conn = entry.getValue();
  |        			
  |        			break;
  |        		}
  |        	}
  |        ........
  | 

Why don't use


  |          .....
  |        	ConnectionEndpoint conn = null;
  |          
  |         conn = endpoints.get(jmsSessionID);
  |        ........
  | 

instead of the for loop?



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217277#4217277

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217277



More information about the jboss-dev-forums mailing list