Problem:
EJBObject extends Remote, thus only making it possible for the server to
hand out stubs to RMI-objects. It is desirable to have the option of
sending a Serializable proxy implementing the bean interface instead, in
order to implement fault-management, load balancing, lazy-caching etc.
That would also make it possible to implement EJB over plain JRMP (which
is not an option currently due to the new design of 1.2-RMI).

Solution 1:
Change so that EJBObject does not extend Remote. This would allow for
the following:
// Written by bean developer
interface Account
  extends EJBObject
{
  long getBalance();
  ...
}

// Generated by container. Contains Account+EJBObject methods
interface AccountEJB
  extends Remote
{
  // Use explicit context transfer, but hidden from user
  long getBalance(IdentityImpl clientid, TxImpl currentTx);
  ...
  // EJBObject methods
  void remove(IdentityImpl clientid, TxImpl currentTx);
}

The objects sent from the server to the client are proxies implementing
Account (and thus also EJBObject) which delegates to stubs implementing
AccountEJB. The design of the AccountEJB-interface is vendor-specific.

Solution 2:
Change so that EJBObject does not extend Remote, and do not mandate that
the bean interface implements EJBObject. This would allow for the
following:
// Written by bean developer
interface Account
{
  long getBalance();
  ...
}

// Generated by container. Contains Account+EJBObject methods
interface AccountEJB
  extends Remote
{
  // Use explicit context transfer, but hidden from user
  long getBalance(IdentityImpl clientid, TxImpl currentTx);
  ...
  // EJBObject methods
  void remove(IdentityImpl clientid, TxImpl currentTx);
}

The objects sent from the server to the client are proxies implementing
Account and EJBObject which delegates to stubs implementing AccountEJB.
The design of the AccountEJB-interface is vendor-specific.
Sideeffect: beans can implement Account, thus ensuring consistency
between interface and impl.

Comments? This is an incompatible change to the existing interfaces, but
it has some very nice effects IMHO, including making it possible to
implement EJB over plain JDK-RMI(/w JRMP).

/Rickard

--
Rickard �berg

Computer Science student@LiTH
@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to