@SuppressWarnings({ "unchecked", "rawtypes" })
	public Map<String,Map<Integer,KeyPairSearchTree<String>>> getContextMap(final String prefix, final Properties props, final Class<? extends KeyPairSearchTree> treeClass)
	{
		Map<String,Map<Integer,KeyPairSearchTree<String>>> map = null;
		final Map<String,String> pairs=getPrefixedPairs(props,prefix,'/');
		if(pairs != null)
		{
			map=new HashMap<String,Map<Integer,KeyPairSearchTree<String>>>();
			for(final Entry<String,String> p : pairs.entrySet())
			{
				final String key=p.getKey();
				final Triad<String,Integer,String> from=findHostPortContext(key);
				if(from == null) continue;
				Map<Integer,KeyPairSearchTree<String>> portMap=map.get(from.first);
				if(portMap == null)
				{
					portMap=new HashMap<Integer,KeyPairSearchTree<String>>();
					map.put(from.first, portMap);
				}
				KeyPairSearchTree<String> tree=portMap.get(from.second);
				if(tree == null)
				{
					try 
					{
						tree=treeClass.newInstance();
						portMap.put(from.second, tree);
					} 
					catch (Exception e) 
					{
						e.printStackTrace();
					}
				}
				if(tree != null)
				{
					tree.addEntry(from.third, p.getValue());
				}
			}
		}
		return map;
	}