package com.ctrip.hermes.engine;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import com.ctrip.hermes.consumer.Consumer;

@SuppressWarnings("rawtypes")
public class Subscriber {

	private String m_groupId;

	private String m_topicPattern;

	private Consumer m_consumer;

	public Subscriber(String topicPattern, String groupId, Consumer consumer) {
		m_topicPattern = topicPattern;
		m_groupId = groupId;
		m_consumer = consumer;
	}

	public String getGroupId() {
		return m_groupId;
	}

	public String getTopicPattern() {
		return m_topicPattern;
	}

	public Consumer getConsumer() {
		return m_consumer;
	}

	public Class<?> getMessageClass() {
		Type[] genericInterfaces = m_consumer.getClass().getGenericInterfaces();
		Type[] actualTypeArguments = ((ParameterizedType) genericInterfaces[0]).getActualTypeArguments();
		Class type = (Class) actualTypeArguments[0];
		return type;
	}

}

@@ -681,18 +681,16 @@
 Type
-%5B%5D
  generic
 Inte
@@ -685,25 +685,25 @@
  generic
-Interface
+SuperClas
 s = m_co
@@ -734,54 +734,53 @@
 eric
-Interfaces();%0A%09%09Type%5B%5D actualTypeArguments
+Superclass();%0A%09%09ParameterizedType paraType
  = 
-(
 (Par
@@ -806,22 +806,59 @@
 eric
-Interfaces%5B0%5D)
+SuperClass;%0A%09%09Type%5B%5D actualTypeArguments = paraType
 .get

Fix Subscriber.getMessageClass()