source: trunk/lang/java/jRpUtils.cc @ 4503

Last change on this file since 4503 was 3177, checked in by mmc, 8 years ago

Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.

File size: 1.1 KB
Line 
1/*
2 * ======================================================================
3 *  AUTHOR:  Ben Rafferty, Purdue University
4 *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
5 *
6 *  See the file "license.terms" for information on usage and
7 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 * ======================================================================
9 */
10
11/*
12 * This file defines the native functions which are called by the java Utils
13 * class methods, and in turn call the corresponding rappture RpUtils methods.
14 */
15
16#include "jRpUtils.h"
17#include "rappture.h"
18
19// progress
20JNIEXPORT void JNICALL Java_rappture_Utils_jRpUtilsProgress
21  (JNIEnv *env, jclass cls, jint percent, jstring javaText){
22  const char* nativeText = env->GetStringUTFChars(javaText, 0);
23  int err = Rappture::Utils::progress(percent, nativeText);
24  jclass ex;
25  if (err){
26    ex = env->FindClass("java/lang/RuntimeException");
27    if (ex){
28      env->ThrowNew(ex, "rappture.Utils.progress failed.");
29    }
30    env->DeleteLocalRef(ex);
31  }
32  env->ReleaseStringUTFChars(javaText, nativeText);
33  return;
34}
35
Note: See TracBrowser for help on using the repository browser.