Hi,


In order to get a reference to the Remote Interface, you have to use the 
  getEJBObject() in the SessionContext object given to the bean. That 
is, in your example it would look like this ( assuming that our bean 
stores its SessionContext in the "context" attribute ) :

public void dummyMethod2() {

  DummyClass d = new DummyClass();

  d.dummyMethod((DummyClass2)context.getEJBObject());

}

Hope this helps ;o)

Eric

Thomas Dandelot wrote:

>  
> 
> ----- Original Message -----
> *From:* Jean-Claude MEILLAND <mailto:[EMAIL PROTECTED]>
> 
> *To:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> 
> *Cc:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> 
> *Sent:* Friday, July 20, 2001 4:51 PM
> 
> *Subject:* What's the "this" pointer (representing the actual instance) 
> equivalent in EJB ???
> 
> 
> Hello,
> 
>  
> 
> Here is a little example :
> 
>  
> 
> public class DummyClass {
> 
>     public DummyClass(){}
> 
>     public void dummyMethod(DummyClass2 anotherClass) { // some code }
> 
> }
> 
>  
> 
> public class DummyClass2 {   
> 
>     public DummyClass2(){}
> 
>     public void dummyMethod2() {
> 
>         DummyClass d = new DummyClass();
> 
>         d.dummyMethod(this);
> 
>     }
> 
> }
> 
>  
> 
>  
> 
> HERE IS THE QUESTION ===> How do we manage "this" pointer in entity beans ?
> 
> With EJB :
> 
> public interface DummyClass extends EJBObject {
> 
>     public void dummyMethod2();
> 
> }
> 
>  
> 
> public class DummyClass2Bean implements EntityBean {   
> 
>     public DummyClass2(){}
> 
>     public void dummyMethod2() {
> 
>         DummyClass d = new DummyClass();
> 
>         d.dummyMethod(this); // "this" is a DummyClass2Bean and should 
> be a DummyClass2 (the remote interface)!!!???
> 
>     }
> 
> }
> 
>  
> 
> Hope you can help !
> 
>  
> 
> Thanxs !
> 
>  
> 
> PS : Please don't tell me the solution is to make a request to the 
> ejbserver in order to find the remote instance matching the bean by its 
> primary key !
> 
>> 
> 
> *      Jean-Claude MEILLAND*
>       Ing�nieur Informatique
> 
> *      **i**Smart Le Mercure A, 565 Rue Berthelot
>       13851 Aix en Provence cedex 3 FRANCE*
> 
> *  *    Mobile (+33/0) 6 87 19 29 89
>       *Telephone (+33/0) 4 42 90 02 81
>       Fax (+33/0) 4 42 24 45 78**
> 
>       mailto:[EMAIL PROTECTED]
> *      http://www.ismart.fr
> 
>  
> 



-- 
Eric Demorsy - [EMAIL PROTECTED]
Bizzgo : http://www.bizzgo.net
tel: 01 42 46 76 44
tel: 06 63 18 44 63

----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to