Merge branch 'development' into development_on_RHEL6

Former-commit-id: f927209446 [formerly 608378b8e086a845f38e238eda127c7792f09b53]
Former-commit-id: 67136a50f2
This commit is contained in:
Steve Harris 2013-10-17 18:20:56 -05:00
commit a1544c7c74
5 changed files with 39 additions and 53 deletions

View file

@ -48,7 +48,8 @@ import com.raytheon.viz.ui.widgets.IApplyCancelAction;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 6, 2013 2180 mpduff Initial creation
* Aug 6, 2013 2180 mpduff Initial creation
* Oct 17, 2013 2455 skorolev Fixed a problem with Changes Applied window.
*
* </pre>
*
@ -201,6 +202,7 @@ public class BandwidthComposite extends Composite implements IApplyCancelAction
@Override
public boolean apply() {
if (saveConfiguration()) {
DataDeliveryUtils.showChangesWereAppliedMessage(getShell());
return true;
}

View file

@ -41,7 +41,7 @@ import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.common.monitor.scan.xml.ScanAlarmXML;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -59,6 +59,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Nov 22, 2010 lvenable Initial creation
* 24 Jul 2013 #2143 skorolev Changes for non-blocking dialogs.
* Aug 15, 2013 2143 mpduff Remove resize.
* Oct 17, 2013 2361 njensen Use JAXBManager for XML
*
* </pre>
*
* @author lvenable
@ -66,6 +68,10 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
*/
public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
ICommonDialogAction {
private static final SingleTypeJAXBManager<ScanAlarmXML> jaxb = SingleTypeJAXBManager
.createWithoutException(ScanAlarmXML.class);
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(SCANAlarmTimeLimitDlg.class);
@ -342,8 +348,7 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
String path = pm.getStaticFile(getFullPathAndFileName())
.getAbsolutePath();
dataXML = SerializationUtil.jaxbUnmarshalFromXmlFile(
ScanAlarmXML.class, path);
dataXML = jaxb.unmarshalFromXmlFile(path);
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"Scan Alarms not available (ScanAlarms.xml).", e);
@ -379,8 +384,7 @@ public class SCANAlarmTimeLimitDlg extends CaveSWTDialog implements
}
try {
SerializationUtil.jaxbMarshalToXmlFile(dataXML, locFile.getFile()
.getAbsolutePath());
jaxb.marshalToXmlFile(dataXML, locFile.getFile().getAbsolutePath());
locFile.save();
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,

View file

@ -19,7 +19,7 @@
# further licensing information.
##
export INIT_MEM=128 # in Meg
export MAX_MEM=1024 # in Meg
export MAX_MEM=512 # in Meg
export JMS_POOL_MIN=4
export JMS_POOL_MAX=16

View file

@ -448,7 +448,7 @@ PyObject* pyjmethod_call_internal(PyJmethod_Object *self,
JNIEnv *env = NULL;
int pos = 0;
jvalue *jargs = NULL;
int *jrelease; // added by njensen
int *jargTypes = NULL; // added by njensen
int foundArray = 0; /* if params includes pyjarray instance */
PyThreadState *_save;
@ -478,7 +478,7 @@ PyObject* pyjmethod_call_internal(PyJmethod_Object *self,
}
jargs = (jvalue *) PyMem_Malloc(sizeof(jvalue) * self->lenParameters);
jrelease = (int *) PyMem_Malloc(sizeof(int) * self->lenParameters);
jargTypes = (int *) PyMem_Malloc(sizeof(int) * self->lenParameters);
// ------------------------------ build jargs off python values
@ -494,14 +494,14 @@ PyObject* pyjmethod_call_internal(PyJmethod_Object *self,
param = PyTuple_GetItem(args, pos); /* borrowed */
if(PyErr_Occurred()) { /* borrowed */
PyMem_Free(jargs);
PyMem_Free(jrelease);
PyMem_Free(jargTypes);
return NULL;
}
pclazz = (*env)->GetObjectClass(env, paramType);
if(process_java_exception(env) || !pclazz) {
PyMem_Free(jargs);
PyMem_Free(jrelease);
PyMem_Free(jargTypes);
return NULL;
}
@ -511,38 +511,15 @@ PyObject* pyjmethod_call_internal(PyJmethod_Object *self,
if(paramTypeId == JARRAY_ID)
foundArray = 1;
// njensen set up the following ifs related to converting args
// we are creating primitive java arrays from numpy arrays,
// so as soon as we done passing the argument through we
// need to free it. jrelease exists to track which must be released.
jrelease[pos] = 0;
if(paramTypeId == JARRAY_ID && !pyjarray_check(param))
{
jvalue arg = convert_pynumpyarg_jvalue(env, param, paramType, paramTypeId, pos);
if(arg.l != NULL)
{
jargs[pos] = arg;
jrelease[pos] = 1;
}
if(PyErr_Occurred()) { /* borrowed */
PyMem_Free(jargs);
PyMem_Free(jrelease);
return NULL;
}
}
if(jrelease[pos] != 1)
{
jargs[pos] = convert_pyarg_jvalue(env,
jargTypes[pos] = paramTypeId;
jargs[pos] = convert_pyarg_jvalue(env,
param,
paramType,
paramTypeId,
pos);
}
if(PyErr_Occurred()) { /* borrowed */
PyMem_Free(jargs);
PyMem_Free(jrelease);
PyMem_Free(jargTypes);
return NULL;
}
@ -622,7 +599,7 @@ PyObject* pyjmethod_call_internal(PyJmethod_Object *self,
// added by njensen to keep memory down
if(obj != NULL)
(*env)->DeleteLocalRef(env, obj);
(*env)->DeleteLocalRef(env, obj);
break;
}
@ -656,7 +633,7 @@ PyObject* pyjmethod_call_internal(PyJmethod_Object *self,
// added by njensen to keep memory down
if(obj != NULL)
(*env)->DeleteLocalRef(env, obj);
(*env)->DeleteLocalRef(env, obj);
break;
}
@ -690,7 +667,8 @@ PyObject* pyjmethod_call_internal(PyJmethod_Object *self,
// added by njensen to keep memory down
if(obj != NULL)
(*env)->DeleteLocalRef(env, obj);
(*env)->DeleteLocalRef(env, obj);
break;
}
@ -958,14 +936,14 @@ PyObject* pyjmethod_call_internal(PyJmethod_Object *self,
// added by njensen to keep memory usage down
for(pos = 0; pos < self->lenParameters; pos++) {
if(jrelease[pos] == 1 && jargs[pos].l != NULL)
{
(*env)->DeleteLocalRef(env, jargs[pos].l);
}
if(jargs[pos].l != NULL && jargTypes[pos] != JARRAY_ID)
{
(*env)->DeleteLocalRef(env, jargs[pos].l);
}
}
PyMem_Free(jargs);
PyMem_Free(jrelease);
PyMem_Free(jargTypes);
if(PyErr_Occurred())
return NULL;
@ -978,7 +956,7 @@ PyObject* pyjmethod_call_internal(PyJmethod_Object *self,
pyjarray_pin((PyJarray_Object *) param);
}
}
if(result == NULL) {
Py_INCREF(Py_None);
return Py_None;

View file

@ -1385,22 +1385,23 @@ PyObject* convert_jobject(JNIEnv *env, jobject val, int typeid) {
}
// added by njensen, had to go separate from convert_pyarg_jvalue to delete
// the local references
// added by njensen, this converts a numpy array to a java primitive array
// Returns null if the python object is a pyjarray
// null and error indicator if the object can't be transformed to a java primitive array
// a java primitive array corresponding to the numpy array
jvalue convert_pynumpyarg_jvalue(JNIEnv *env,
PyObject *param,
jclass paramType,
int paramTypeId,
int pos) {
jvalue ret;
jarray arr;
jclass arrclazz;
jarray arr;
jclass arrclazz;
ret.l = NULL;
arr = NULL;
arr = NULL;
if(param != Py_None && !pyjarray_check(param)) {
// this pyarray -> jarray added by njensen
initUtil();
if(PyArray_Check(param))
@ -1506,7 +1507,8 @@ jvalue convert_pyarg_jvalue(JNIEnv *env,
;
else {
PyJarray_Object *ar;
// njensen shifted this code
// njensen changed this code to try and convert it from a numpy array,
// it will return null if the parameter is already a pyjarray
ret = convert_pynumpyarg_jvalue(env, param, paramType, paramTypeId, pos);
if(ret.l != NULL)
{