source: branches/uq/lang/java/jRpUtils.cc @ 5679

Last change on this file since 5679 was 5679, checked in by ldelgass, 9 years ago

Full merge 1.3 branch to uq branch to sync. Fixed partial subdirectory merge
by removing mergeinfo from lang/python/Rappture directory.

  • Property svn:eol-style set to native
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.