POA logic
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   christian_Leinweber
Posted On:   Thursday, June 19, 2003 06:29 AM

hi I have the following problem: Threre are one idl like this: module konten { module KontenInterface { interface Konto { float getKontoStand( ); boolean bucheVonKonto(in float betrag ); void bucheAufKonto(in float betrag ); string getType( ); string getInhaber( ); long getKontoNummer( ); long getPin( ); }; interface GiroKonto : Konto { float getDispo(); }; }; }; module banken { typedef sequence kontoarr; interface Bank { long getBlz( ); string getBankName( );    More>>

hi



I have the following problem:


Threre are one idl like this:


			
module konten
{
module KontenInterface
{
interface Konto
{
float getKontoStand( );
boolean bucheVonKonto(in float betrag );
void bucheAufKonto(in float betrag );
string getType( );
string getInhaber( );
long getKontoNummer( );
long getPin( );
};

interface GiroKonto : Konto
{
float getDispo();
};
};
};

module banken
{
typedef sequence kontoarr;

interface Bank
{
long getBlz( );
string getBankName( );
konten::KontenInterface::Konto getKonto(in long kontonummer );
void createGiroKonto(in string inhaber,in long kontonummer,in float dispo,in long pin );
void createSparbuch(in string inhaber ,in long kontonummer, in long pin );
void bucheAufKonto(in float betrag,in long kontonummer );
kontoarr getKonten( );
};
};





OK than I have in the java Class Bank (inherits from BankPOA) the folowing:


konten.KontenInterface.Konto[] konten = new konten.KontenInterface.Konto[100];


and a method:


public void createGiroKonto(String inhaber, int kontonummer, float dispo, int pin)

{

konten[anzahlKonto] = new konten.GiroKonto(inhaber, kontonummer, pin, dispo);

anzahlKonto++;

}



the Class GiroKonto Inherits from Konto(and this inherits from KontoPOA) and implements GiroKontoOperations.



So but when i call the createGiroKonto-Method then i get an ArrayStoreException. Because the Class GiroKonto isnt compatible with the Interface Konto. But how can i solve this problem i dont know how i can make this compatible!

can anybody help me?
bye
christian (from Germany with bad english :-))    <<Less

Re: POA logic

Posted By:   Anonymous  
Posted On:   Friday, June 27, 2003 01:14 AM

replace the following line


konten[anzahlKonto] = new konten.GiroKonto(inhaber, kontonummer, pin, dispo);


with


konten[anzahlKonto] = (new konten.GiroKonto(inhaber, kontonummer, pin, dispo))._this(orb);


here orb is the ORB instance


hope this helps
About | Sitemap | Contact