I am trying build a CORBA IDL
interface, which can pass by
exceptions. I am using C++ on the server
and Java on the Client side.
When a user defined error occurs on
the server side I am trying build a
CORBA IDL interface, which can pass
by exceptions. I am using C++ on the server
and Java on the Client side.
When a user defined error occurs on
the server side, I throw an
errorclass, which is defined as an
exceptions in the IDL code. The error should be
caught on the client side.
At the moment an occurence of a user
defined
errorclass smashes down the server.
Are there any important things I
have
to consider while implementing the
exception on the server and/or
client
side ? (This interface works for a clientside Java
serverside
Java application)
I am using the SYBASE JAGUAR applicationserver with
integrated ORB.
My IDL code:
interface FxStrike : FxQuote
{
exception Adrian
{
string explanation;
};
double getStrike();
void setStrike (in double wS) raises (Adrian);
};//as a part of a package
The implementation Code on the serverside (C++):
#ifndef FxStrikeImpl_HPP
#define FxStrikeImpl_HPP
#include "test.hpp"
#include <fx/FxPricing/FxStrike.h>
class FxStrikeImpl
{
public:
CORBA::Double getStrike();
void setStrike
(CORBA::Double wS);
};
#endif
---------------------------------------------------
#include "FxStrikeImpl.hpp"
CORBA::Double FxStrikeImpl::getStrike()
{
CORBA::Double result;
result=1.33;
return result;
}
void FxStrikeImpl::setStrike
(CORBA::Double wS)
{
if (wS==1.23) throw
test::FxStrike::Adrian();//test: packagename
//using ::Adrian("Error") does not compile
...
}
For help I would be thankful
Adrian
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.