You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Greg Truty <gt...@us.ibm.com> on 2001/10/24 19:50:36 UTC
EJBProvider and suggestions
Folks,
As I was walking through some of the configProvider stuff, I was playing
around w/the EJBProvider (as it's the only provider that EJBs are handled
with) a bit to validate a few things and I have a couple of suggestions.
Since JSR 109, WSDD, resolver, etc... all affect this, I didn't want to
spend too much time on this but felt that if this was copied as an example
of how to invoke upon an EJB, then we should try and make the EJB side of
things as flexible as possible.
1) There are 4 properties that are required that don't have to be.
jndiUrl, jndiContextClass, jndiUser, and jndiPassword. In many appserver
environments (as well as some non-appserver environments), a
jndi.properties file is provided which actually allows a default setting of
some of these items. Therefore, there is no need to require jndiUrl and
jndiContextClass. Having the methods does give the flexibility (if
desired), of overriding the default settings. Wrt. jndiUser and
jndiPassword, it's also not necessary to access the InitialContext class
w/a userid and password. Again, if it's desired, they can be set.
Therefore, I suggest that we make the setting of the items on the
properties object only if they are set (and use the defaults - which are
provided in a jndi.properties file or set via a command-line option). In
the case where they aren't set, an appropriate AxisFault exception is
created stating what the problem is.
I have attached a modified version of this. (See attached file:
EJBProvider.java)
2) For the RPCProvider and EJBProvider, they each use a different option
for the same thing (methods that are allowed to be called from a web
service). In the RPCProvider, methodName is used. In the EJBProvider,
allowedMethods is used. The code in RPCProvider actually uses a variable
called allowedMethodName for parsing (but maps it to methodName). There
are two ways to resolve this (the easy way and the hard way). The easy way
is to change the EJBProvider to use methodName. The hard way would be to
change everything else to allowedMethods. Personally, I like the hard way
(allowedMethods) since it's meaning can be inferred directly w/o trying to
figure out what methodName means and why you can have multiple versions of
them. I went and looked at what needed to be changed (actually did the
changes), and it affects all of the samples, JWSProcesser,
server-config.xml, JavaProvider.java, SimpleAxisServer.java and the user
guide. That fixes the functional-tests (and there's a couple more other
ones affected that aren't run as part of the functional-tests).
I know that SOAP 2.2 supported this functionality, and there have been some
discussions over the usefulness of this capability (limiting the methods)
in some of the JAX discussions and whether or not it's better to declare
this in some descriptor file or suggest that people define a separate
interface for this which is the subset of the items wishing to be exposed.
This leads me to the next point...
3) methodName (or allowedMethods) isn't really sufficient for defining the
permissions. It does not handle the case where a method is overloaded
w/different parameters. Therefore, there is no way to unambiguously
indicate WHICH method is really the one desired w/o including some
definition of the parameters within the method signature.
I actually have a opinion here but before I investigate it, I would like to
know what other people think about this option/function.
4) I have converted the StockQuote sample to an EJB and don't mind dropping
it but we probably have to do some ant magic to get it to compile since it
obviously will have dependencies on the javax.ejb classes. I attached it
for anyone who would like to see/play with it.
(See attached file: StockQuote.jar)
Regards...Greg
Greg Truty
gtruty@us.ibm.com