if (!MetaClassFactory.get(eventClassType).isAssignableFrom(field.getType())) {
throw new RuntimeException("@ConversationContext should be used with type Event");
}
MetaParameterizedType type = field.getType().getParameterizedType();
if (type == null) {
throw new RuntimeException("Event<?> must be parameterized");
}
MetaClass typeParm = (MetaClass) type.getTypeParameters()[0];
String toSubject = CDI.getSubjectNameByType(typeParm.getFullyQualifiedName());
Statement statement = Stmt.nestedCall(injectableInstance.getValueStatement())
.invoke("registerConversation", Stmt.invokeStatic(CDI.class, "createConversation", toSubject));
return statement;