protected Method getMethod(Object obj, String methodname, Class[] params)
	{
		Class<?> type = obj.getClass();

		while (type != null)
		{
			try
			{
				Method method = type.getDeclaredMethod(methodname, params);

				if (method != null)
				{
					return method;
				}
			}
			catch (Exception e)
			{
				// ignore
			}

			type = type.getSuperclass();
		}
		return null;
	}