package bankCorbaExtDelegate.cBank;
import [...]
public class CBank
extends CExtCorbaDelegateObject
implements bankCorbaExtDelegate.IBank {
[...]
public IAccount newAccount(String name) {
_accountRef myAccount;
if (name != null) {
this.setException(null);
try {
// call the remote method on the proxy object
myAccount =
((_bankRef)proxy_object).newAccount(name);
} catch (SystemException e) {
this.setException(new CException(
m_Module,
"CorbaConnectionException",
e.toString()));
return null;
} catch (reject r) {
this.setException(new CException(
m_Module, "reject", null));
return null;
}
// create and return the extension object linked to
// the new proxy object
return new CAccount(m_Module,myAccount);
}
else return null;
}
|
die Methode newAccount(.) delegiert den Aufruf an
den bank Proxy proxy_object, und erhält ein
account Proxy zurück. Dann erzeugt sie ein neues
CAccount Objekt und gibt das account Proxy an
den Konstruktor des CAccount Objektes weiter.
Falls eine Ausnahme auftreten sollte, wird mit der
Methode this.setException(.) eine Exception gesetzt,
die später von einem AppLogic abgefragt werden kann.
|
public void internalize(String state,
CBankManager mModule) {
m_Module = mModule;
if (state != null) {
try {
proxy_object = bank._narrow(
_CORBA.Orbix.string_to_object( state));
} catch (SystemException e) {
this.setException(new CException(m_Module,
"CorbaConnectionException",
e.toString()));
return;
}
}
else return;
}
|
das Proxy Objekt wird erzeugt, indem die übergebene
Zeichenkette state in ein CORBA Proxy Objekt umgewandelt
wird.
|