#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "jvmti.h"

#include "jbossAgent.h"



void throwException(JNIEnv * env,char * clazz, char * message)
{
  jclass exceptionClass = env->FindClass(clazz);
  if (exceptionClass==NULL) 
  {
     exceptionClass = env->FindClass("java/lang/RuntimeException");
     if (exceptionClass==NULL) 
     {
        fprintf (stderr,"Couldn't throw exception %s - %s\n",clazz,message);
     }
  }
  
  env->ThrowNew(exceptionClass,message);
  
}
