I can't speak for the specification writers, but one strategy would be
to write a connector. Wrap your JNI code in a Java interface, and bind
the implementation in JNDI. The EJB looks up your object
implementation and casts to the interface.
This is legal and secure because it depends upon the administrator
binding the connector into the JNDI namespace, not something a rogue
EJB could do all by itself.
eg.
InitialContext ctx = new InitialContext();
MyConnector jniThing = (MyConnector)ctx.lookup("jni/mc/carrots");
If I'm wrong here, there's plenty of experts on this list you can
put me right. :)
Malcolm
PS: By the way, there's a connectors submission in the pipeline.
On Wed, Sep 15, 1999 at 12:11:32PM -0400, Eric Yu wrote:
> In Sun's draft EJB developer's guide (and also probably specified somewhere
> in the EJB 1.1 spec), it lists among the Programming Restrictions:
>
> ----
> When coded properly, an enterprise bean will run in any EJB-compliant
> container. To be portable, an enterprise bean is restricted from performing
> certain operations:
>
> accessing files or directories with the java.io package
> managing or synchronizing threads
> using AWT functionality to display information or to accept information
> from a keyboard
> listening on a socket, accepting connections on a socket, or using a
> socket for multicast
> setting a socket factory used by ServerSocket, Socket, or the stream
> handler factory used by the URL class
> loading a native library
> ----
>
> The last one implies JNI from within an EJB is prohibited. What would be
> some strategies to access native libraries from an EJB?
>
> Thanks,
>
> Eric Yu
> Centerprise Services, Inc.
> (914) 701-7320 voice
> (914) 701-7391 fax
> mailto:[EMAIL PROTECTED]
>
> ===========================================================================
> 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".
===========================================================================
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".