axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Ruby" <ru...@us.ibm.com>
Subject RE: cvs commit: xml-axis/java/src/org/apache/axis/server AxisServer.java
Date Sat, 16 Jun 2001 00:00:26 GMT
Rob Jellinghaus wrote:
>
> Why not just
>
>    public static synchronized AxisServer getSingleton () {

That's the right answer for that parf of the problem.  But if you really
want servers to be shared between tasks, you will want access to instance
data to be synchronized (example: registerTypeMapping).

I'm also confused/concerned about the init call in *both* getSingleton and
start.  And not only does init need to be syncrhonized, but also start.

And you put enough synchronized calls in there, and ultimately the
performance penalty will mount up...

This isn't as hard as perhaps I am making it sound, but we do need to stop
and think occasionally about whether we want these objects to be shared,
pooled, or disposable.

In the case of AxisServer in the context of a servlet, I think shared *is*
the right answer.  You do want services which are registered in one thread
to be found by other threads.

- Sam Ruby


Mime
View raw message