use of org.omg.CORBA.SystemException in project ACS by ACS-Community.
the class LogLevelSelectorPanel method applyChanges.
/**
* Apply the changes to the log levels, if any.
* <p>
* TODO: This method makes remote calls and should not be called in the event thread.
* However this would require more refactoring, because it currently also accesses swing components.
*
* @throws AcsJCORBAProblemEx In case of ORB / network failure or if remote process is unresponsive or unreachable.
*/
private void applyChanges() {
try {
for (LogLevelHelper logLvl : model.getLevels()) {
if (logLvl.modified()) {
// see reset of modification flag in the changesApplied call below
System.out.println("Applying new log levels to " + logLvl.getName() + ": <" + logLvl.isUsingDefault() + ", " + logLvl.getGlobalLevel() + ", " + logLvl.getLocalLevel() + ">");
logConf.set_logLevels(logLvl.getName(), logLvl.getLogLevels());
}
}
int localIndex = allLocalCB.getSelectedIndex();
LogTypeHelper local = LogTypeHelper.values()[localIndex];
final int localAcs = local.getAcsCoreLevel().value;
int globalIndex = allGlobalCB.getSelectedIndex();
LogTypeHelper global = LogTypeHelper.values()[globalIndex];
final int globalAcs = global.getAcsCoreLevel().value;
boolean useDefault = logConf.get_default_logLevels().useDefault;
LogLevels toset = new LogLevels(useDefault, (short) globalAcs, (short) localAcs);
logConf.set_default_logLevels(toset);
model.changesApplied();
updateMinLevels();
applyBtn.setEnabled(false);
} catch (SystemException ex) {
// AcsJCORBAProblemEx ex2 = new AcsJCORBAProblemEx(ex);
String msg = "Failed to set log levels for '" + getName() + "' because of Corba errors. Giving up, also for other loggers of the same process.";
logger.log(Level.WARNING, msg, ex);
JOptionPane.showMessageDialog(null, msg + " \nCheck the logs for details.", "Error", JOptionPane.ERROR_MESSAGE);
} catch (Exception ex) {
// AcsJUnexpectedExceptionEx ex2 = new AcsJUnexpectedExceptionEx(ex);
String msg = "Failed to set log levels for '" + getName() + "'. Giving up, also for other loggers of the same process.";
logger.log(Level.WARNING, msg, ex);
JOptionPane.showMessageDialog(null, msg + " \nCheck the logs for details.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
use of org.omg.CORBA.SystemException in project ACS by ACS-Community.
the class CharacteristicModelImpl method get_characteristic_by_name.
/*********************** [ CharacteristicModel ] ***********************/
/**
* @see alma.ACS.CharacteristicModelOperations#get_characteristic_by_name(java.lang.String)
*/
public Any get_characteristic_by_name(String name) throws NoSuchCharacteristic {
try {
String strVal = new String();
if (prefix == "")
strVal = dao.get_string(name);
else
strVal = dao.get_string(prefix + name);
//I needed the getAny() to create a new Any, since a constructor for
// Any (i.e: new Any() ), doesn't exist
Any value_p = m_container.getAdvancedContainerServices().getAny();
value_p.insert_string(strVal);
return value_p;
} catch (CDBFieldDoesNotExistEx fde) {
NoSuchCharacteristic nsc = new NoSuchCharacteristic();
nsc.characteristic_name = name;
nsc.component_name = modelName;
throw nsc;
} catch (SystemException se) {
throw se;
} catch (WrongCDBDataTypeEx wct) {
}
throw new NoSuchCharacteristic();
}
use of org.omg.CORBA.SystemException in project jdk8u_jdk by JetBrains.
the class _HelloInterface_Stub method sayHelloWithTest3.
public Test3 sayHelloWithTest3(Test3 arg0) throws java.rmi.RemoteException {
if (!Util.isLocal(this)) {
try {
org.omg.CORBA_2_3.portable.InputStream in = null;
try {
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) _request("sayHelloWithTest3", true);
out.write_value(arg0, Test3.class);
in = (org.omg.CORBA_2_3.portable.InputStream) _invoke(out);
return (Test3) in.read_value(Test3.class);
} catch (ApplicationException ex) {
in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
String $_id = in.read_string();
throw new UnexpectedException($_id);
} catch (RemarshalException ex) {
return sayHelloWithTest3(arg0);
} finally {
_releaseReply(in);
}
} catch (SystemException ex) {
throw Util.mapSystemException(ex);
}
} else {
ServantObject so = _servant_preinvoke("sayHelloWithTest3", HelloInterface.class);
if (so == null) {
return sayHelloWithTest3(arg0);
}
try {
Test3 arg0Copy = (Test3) Util.copyObject(arg0, _orb());
Test3 result = ((HelloInterface) so.servant).sayHelloWithTest3(arg0Copy);
return (Test3) Util.copyObject(result, _orb());
} catch (Throwable ex) {
Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
throw Util.wrapException(exCopy);
} finally {
_servant_postinvoke(so);
}
}
}
use of org.omg.CORBA.SystemException in project jdk8u_jdk by JetBrains.
the class _HelloInterface_Stub method sayHelloWithHashMap2.
public String sayHelloWithHashMap2(HashMap arg0) throws java.rmi.RemoteException {
if (!Util.isLocal(this)) {
try {
org.omg.CORBA_2_3.portable.InputStream in = null;
try {
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) _request("sayHelloWithHashMap2", true);
out.write_value(arg0, HashMap.class);
in = (org.omg.CORBA_2_3.portable.InputStream) _invoke(out);
return (String) in.read_value(String.class);
} catch (ApplicationException ex) {
in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
String $_id = in.read_string();
throw new UnexpectedException($_id);
} catch (RemarshalException ex) {
return sayHelloWithHashMap2(arg0);
} finally {
_releaseReply(in);
}
} catch (SystemException ex) {
throw Util.mapSystemException(ex);
}
} else {
ServantObject so = _servant_preinvoke("sayHelloWithHashMap2", HelloInterface.class);
if (so == null) {
return sayHelloWithHashMap2(arg0);
}
try {
HashMap arg0Copy = (HashMap) Util.copyObject(arg0, _orb());
return ((HelloInterface) so.servant).sayHelloWithHashMap2(arg0Copy);
} catch (Throwable ex) {
Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
throw Util.wrapException(exCopy);
} finally {
_servant_postinvoke(so);
}
}
}
use of org.omg.CORBA.SystemException in project jdk8u_jdk by JetBrains.
the class _HelloInterface_Stub method sayHello.
public String sayHello(String arg0) throws java.rmi.RemoteException {
if (!Util.isLocal(this)) {
try {
org.omg.CORBA_2_3.portable.InputStream in = null;
try {
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) _request("sayHello", true);
out.write_value(arg0, String.class);
in = (org.omg.CORBA_2_3.portable.InputStream) _invoke(out);
return (String) in.read_value(String.class);
} catch (ApplicationException ex) {
in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
String $_id = in.read_string();
throw new UnexpectedException($_id);
} catch (RemarshalException ex) {
return sayHello(arg0);
} finally {
_releaseReply(in);
}
} catch (SystemException ex) {
throw Util.mapSystemException(ex);
}
} else {
ServantObject so = _servant_preinvoke("sayHello", HelloInterface.class);
if (so == null) {
return sayHello(arg0);
}
try {
return ((HelloInterface) so.servant).sayHello(arg0);
} catch (Throwable ex) {
Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
throw Util.wrapException(exCopy);
} finally {
_servant_postinvoke(so);
}
}
}
Aggregations