You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Yuhichi Nakamura <NA...@jp.ibm.com> on 2000/12/20 10:42:08 UTC

[ASIS ISSUE1?} Single or two flows (RE: Requirements - 2000/12/11)

Are you talking about the subject matter?
In this case, I would like you to raise a issue, giving "[AXIS ISSUE1]
xxxx" style subject.

In the discussion, I do not see assumptions you have in your mind.  I may
ask:
    Is request/response comprised of two SOAP messages?
        The assumption should be yes, but I want you to make sure.
    Is this discussion only effective for request/response?
        As for one way messaging, we just do not need response flow.

I think you two assume that Header handler and Payload Hanlder (Pivot,
Dispatcher, etc.)
have a same API.  I do not agree with this point at this moment because
Header
hanlder acts on a single SOAP message, but Payload Hanlder acts on two SOAP
messages.
However, I am going to raise this issue with another subject.

Best regards,

Yuhichi Nakamura
IBM Research, Tokyo Research Laboratory
Tel: +81-46-215-4668
FAX: +81-46-215-7413


From: "Doug Davis" <du...@us.ibm.com> on 2000/12/20 08:40

Please respond to soap-dev@xml.apache.org

To:   soap-dev@xml.apache.org
cc:
Subject:  RE: Requirements - 2000/12/11



James,
  In your single message scenario you say the original message is always
available
from the message context, well, the problem is, what if the original
message isn't
in a nice form (ie. encrypted)?  Or worse what if the message gets prettied
up by
lots of input handlers - which version is available in the message context?
I'm not
advocating either solution (one vs two messages) just pointing out some of
the
problems we discussed in the F2F.
-Dug


James Snell <jm...@intesolv.com> on 12/19/2000 12:06:23 PM

Please respond to soap-dev@xml.apache.org

To:   "'soap-dev@xml.apache.org'" <so...@xml.apache.org>
cc:
Subject:  RE: Requirements - 2000/12/11



Steve,

I agree with your entire first paragraph.

As for the rest, let's see if we can't iron this out a bit more.

Let's take a Message (M) that we want to pass through a chain of handlers
(H1, H2, H3, and H4).  Now, we have several ways of doing this:

Your suggestions are:

  Create two Messages (M = Input Message = IM, Output Message = OM) and
pass
those through an input chain first:

        IM/OM -> H1 -> H2

  Once the messages reache the end of the input chain, they are redirected
down the output chain at the end of which IM is discarded and OM is
returned
to the calling client.

        IM/OM <- H4 <- H3

   Or, we have a single message (M) that is passed through the input chain:

        M -> H1 -> H2

   Returned down the output chain, and returned to the calling client.

        M <- H4 <- H3

My suggestion is this.

   We pass a single message down a single chain (no distinction between
input/output), each handler takes an input message, and generates and
output
message, which becomes the input message of the next handler in the chain.
The original message is still available by accessing the message
context/session.

        M -> H1 -> OM -> H2 -> OM -> H3 -> OM -> H4 -> OM -> ?

   The ? after H4 returns it's output message indicates the location to
where the final output message is delivered.  There are three options: A.
The output message can be delivered back to the calling client (RPC), B.
The
output message can be delivered to another server (Intermediary), C. The
output message can be discarded (One-way).

If you look at all three approaches, there are more similarities than
differences.  Your input/output architecture can be considered a "folded"
version of my single stack architecture.  The difference is that
input/output is geared more towards RPC style interactions whereas the
single stack may offer more benefits in the one-way and intermediary
interactions.  Additionally, we agree in all three architectures that the
original message must be accessible by all of the handlers.  I propose that
we make the original message available only through the message
context/session and hand to the handler only the current working message,
whether it is an input or output message.

The question should arise then, in the single stack, how do we know if a
message is inbound or outbound? That depends on who is putting together the
stack and why they need to know that information.  If it is for logging
purposes, simply add a logging handler at the beginning of the chain with
some custom parameters indicating an "INPUT" message, and add a logging
handler at the end of the chain with a custom parameter indicating an
"OUTPUT" message.

Thoughts?

- James



-----Original Message-----
From: Steve Graham [mailto:sggraham@us.ibm.com]
Sent: Tuesday, December 19, 2000 5:49 AM
To: soap-dev@xml.apache.org
Subject: RE: Requirements - 2000/12/11


James:
I like the pluggability of chainContainers, but only to the extent where
the API to the handlers is not affected.  If we have certain chain
containers that do two message flows, and others that only do single
message flow (AXIS ISSUE 1) then the programming model for the handlers
gets much more complicated.  I have to write a logging handler that accepts
single message API, I have to write another one (or an adapter) to
implement the two message API.  I then need to remember which one to put in
which kind of chainContainer.  It becomes a mess pretty quickly.  I agree
with James: we must choose wisely, but we must choose.

As far as the single message flow, I had never viewed the chain as a stack
in which the message is "pushed" through on input and then the stack poped
through on output (if I understood your comment correctly).  Rather, I had
imagined in the single message model, you could have input and output
chains (like you mentioned for two message), however the difference is that
in the two message chain:

R --> TL --> C --I M -->  ---->   ---->
                        H1     H2
               +-O M -->  ---->   ---->
                                           D
             ||--I M --  <----   <----
                        H4     H3
R --> TS --> C <--O M --  <----   <----

where R= requestor, TL = Transport Listener, C = canonicalizer, I M = input
message, O M = output message
H1, H2 are two handlers on the input chain, D = dispatcher or pivot point,
H3, H4 are handlers on the output chain,
TS = transport sender.

In this two message chain, the input and output message are available to
all the handlers.  On the inbound flow, the C creates the IM from the bits
retrieved by the TL and creates an empty output message.  On the outbound
flow, the I M is discarded and the output message is sent to the C for
serialization and prep to send over the wire by the TS.

The single message flow, does not imply a stack as you indicated.  In the
single message flow scenario a single message goes into the handler, its
output is fed into the input of the next handler in the chain, etc.  So the
scenario becomes:

R --> TL --> C --M --> H1  ----> H2 ---->
                                          D
R --> TS --> C <-- M-- H4 <---- H3  <----

So H1 <> H4 and H2 <> H3 necessarily.  However you can set up the WSDD to
cause H1 == H4 and H2 == H3 and therefore achieve the "stack" effect you
were looking for.

sgg
++++++++
Steve Graham
sggraham@us.ibm.com
(919)254-0615 (T/L 444)
<<Pithecanthropus Erectus>>
Emerging Internet Technologies
++++++++


"James Snell" <js...@lemoorenet.com> on 12/18/2000 11:56:13 PM

Please respond to soap-dev@xml.apache.org

To:   <so...@xml.apache.org>
cc:
Subject:  RE: Requirements - 2000/12/11



Yuhichi, this is how I perceive it.  This architecture could also
potentially solve our ISSUE#1 problem, which is, as you may recall, the
question as to have the system either pass a message in through a stack of
handlers then out through another stack of handlers (input/output) or
rather
to have a message pass through a single stack of handlers and pop out "on
the other side".  If the Chain Container is pluggable, and the Chain
Container controls message flow, then couldn't we have a chain container
that does either one?

Now, one thing I realize right off the bat is this: we've already talked
about several types of chain containers (pooling, nonpooling, input/output,
etc).  Managing each of these could get cumbersome so we should be sure to
choose wisely ;-)

- James

-----Original Message-----
From: Yuhichi Nakamura [mailto:NAKAMURY@jp.ibm.com]
Sent: Monday, December 18, 2000 8:03 PM
To: soap-dev@xml.apache.org
Subject: RE: Requirements - 2000/12/11



Steve and James,
It seems difficult for me to follow the discussion, but ...
In F2F, Sanjiva drew a behavior of the engine as follows:
  TransportListner--(invoke)-->Engine--(invoke)-->ChainContainer -->
(Sorry, I am not sure if I remember it correctly.)
According to me, Engine should be called Repository (or Contianer pool)
which manages multiple ChainContainers to forward incoming request
one of them.
Is the conclusion you had along this idea?  Otherwise, I am happy if you
(esp. Steve) map your idea to the engine behavior we drew.

Yes, even ChainContainers are pluggable, so you may invoke a
payload processor without ChainContainer if you do not need any
header processing.  Furthermore, to me, Repository (Engine in the
above figure) is also pluggable.  Therefore, if you do not need
lifetime management etc., you just invoke ChainContainer or
payload processor directly.
Thoughts?

Yuhichi Nakamura
IBM Research, Tokyo Research Laboratory
Tel: +81-46-215-4668
FAX: +81-46-215-7413


From: James Snell <jm...@intesolv.com> on 2000/12/19 05:54

Please respond to soap-dev@xml.apache.org

To:   "'soap-dev@xml.apache.org'" <so...@xml.apache.org>
cc:
Subject:  RE: Requirements - 2000/12/11



This makes a lot of sense.  Man... I am really bummed that I couldn't make
the f2f... sounds like it was really productive... ah well ;-)

- James

-----Original Message-----
From: Doug Davis [mailto:dug@us.ibm.com]
Sent: Monday, December 18, 2000 12:46 PM
To: soap-dev@xml.apache.org
Subject: RE: Requirements - 2000/12/11


James,
  One thing mentioned at the F2F was the notion that pretty much everything
(including chains and chain handlers) was derived from a handler which made
the entire system a pluggable system.
-Dug


James Snell <jm...@intesolv.com> on 12/18/2000 12:01:30 PM

Please respond to soap-dev@xml.apache.org

To:   "'soap-dev@xml.apache.org'" <so...@xml.apache.org>
cc:
Subject:  RE: Requirements - 2000/12/11



Steve:

Absolutely, I think the chain container is the best place for it.

You do bring up an interesting concept that might, or might not be, worth
looking into, and that is the concept of "pluggable chain containers".  Up
till this point we've been talking primarily about plugging in handlers
into
the chain, plugging in parsers, etc, but what about some pluggable
mechanism
for controlling the execution of the chain itself?  Is there any value
here?

- James

-----Original Message-----
From: Steve Graham [mailto:sggraham@us.ibm.com]
Sent: Monday, December 18, 2000 4:47 AM
To: soap-dev@xml.apache.org
Subject: RE: Requirements - 2000/12/11


James:
I agree with the approach to leave "single instance" vs "pooling" a
configurable characteristic of the chains.
Is it possible to move this behavior into the chain container itself?

The thinking is that the registry really shouldn't be involved with this
sort of decision.  It should stay simple, a lookup which returns a
chainable associated with a service identifier.  The chainContainer itself
would be able to implement the invoke() operation in flexible ways, one of
which is to invoke the "single instance", a different "kind" of
chainContainer could maintain a pool and delegate the invoke() to the next
available instance from the pool.

The WSDD, then would allow the deployer to specify "kind" of
chainContainer, with additional parms such as initial pool size, etc.
specific to the "pooling" chainContainer.

In this way, the architecture does not need to be modified in order to
support the tradeoff of "single instance" vs "pooling".

I agree on your notion of "lifecycle" (start/stop/halt/resume) for
services.

sgg

++++++++
Steve Graham
sggraham@us.ibm.com
(919)254-0615 (T/L 444)
<<Pithecanthropus Erectus>>
Emerging Internet Technologies
++++++++


James Snell <jm...@intesolv.com> on 12/15/2000 12:02:28 PM

Please respond to soap-dev@xml.apache.org

To:   "'soap-dev@xml.apache.org'" <so...@xml.apache.org>
cc:
Subject:  RE: Requirements - 2000/12/11



The approach that I imagined is this:

The WSDD would update some kind of services registry.  The registry can be
configured to do one of the following on a service by service basis:

1. Instantiate Handlers On Demand (When a message is received, the handler
is instantiated and invoked)

2. Instantiate A Handler Pool (When the service is initialized, the service
engine will create a pool of handler instances that will be drawn from.

To facilitate changes to the handler chain, every service will allow for
Start, Stop, Pause and Restart functions.  The Axis engine will create the
handler pool on Service Startup, and destroy the handler pool on Service
Stop.

When a WSDD is updated, the engine will detect the different WSDD and call
for Service Restart.

However, as you point out, #1 is much more simple to implement and does not
required thread safe handlers. If I had to vote right now, I'd say let's do
1 now and do 2 later.

- James

-----Original Message-----
From: Steve Graham [mailto:sggraham@us.ibm.com]
Sent: Friday, December 15, 2000 5:46 AM
To: soap-dev@xml.apache.org
Subject: RE: Requirements - 2000/12/11


I guess it boils down to an area we don't have consensus on, and that is
the relationship between what gets deployed/generated into the
handler/chainContainer registry and what actually gets created at runtime.
(see my question, a), b) and c) below).

I had imagined that the WSDD would be "compiled" into a net of object
instances that reflected chainContainer(s)/chains(s)/handler(s) (ie
chainables) as described in the WSDD.  If new .jar files (containing new
types of chainables) were deployed the question becomes how are the new
classes loaded and instantiated?  To me the possibility comes by
redeploying the WSDD for the service.  The redeployment causes new
chainables to be constructed.  If the new  handlers etc. from the new .jar
files have been properly deployed into the handler registry, the
chaincontainers/chains/handlers constructed as a result of the WSDD compile
will pick up these new classes.  When the new chainContainer is deployed
into the chainContainer registry, the next service invocation will pick up
the new chainContainer associated with that service/operation found in the
chainContainer registry.

Example:
I have a wsdd for service "foo" operation "bar".  Some "pseudo" WSDD
follows:
<wsdd>
<service name=foo> ... </service>
<chainContainer ...>
  <operation name="bar">
    <flow type = "input">
      <handler type="h1">  </handler>
</flow></operation></chainContainer></wsdd>

The result of this would be a chainContainer instance, registered in the
registry under service name "foo".
chainContainer
  + chain (type = input)
    + handler (type = h1).

If I subsequently loaded a new .jar file with a new class name for handler
type h1, you would need to "deploy" that handler into the handlerRegistry
(using a WSDD for the h1 handler).  After the new h1 is deployed to the
handler registry, redeploy the WSDD for the service "foo".  The result will
be a chainable similar to the paragraph above, except the new handler class
corresponding to handler type h1 will be constructed into the chain.

The previous paragraphs might require a little more detail on the
collaboration between the "deployment-time" activities of the
chainContainer registry and the runtime (eg. message received) activities:

At runtime, the message is received from the transport layer, a
"cannonical" message object (including something like the TRL SOAPEnvelope
object) is created, the "type" of service and operation is determined (eg
namespace on the envelope) and a lookup done against the chainContainer
registry.  The return of the lookup is a chainable (chainContainer or chain
or even just a single handler).

Now, the question in my mind is what is done with the chainable returned
from the lookup.    There are several possibilities:
a) It is sent the invoke() message?
b) It is "cloned" and sent the invoke() message
c) There is a separate construction step that uses the chainable as a
pattern that "constructs" the live chainables to be used on invocation.

To me a) is simple, but requires the handlers to be thread safe, making
handler construction much more difficult.  Further, a) does not provide
convenient facilities to do the sorts of lifecycle management we have been
discussing.  It certainly will not handle "stateful" chains, as the same
network of objects is used for each instance of a service invocation.

b) is slightly more complicated, but at least not much more coding.  The
cloned chainable is single instance (therefore issues of thread safety are
not complicating handler design).  This would allow these chainables to be
dedicated solely to this service invocation, and therefore fit nicely with
a "stateful"  chainable architecture that we have talked about.  Because
they are separate instances from other invocations of the same service,
these chainables can have state associated with an individual service
invocation.  However this approach implies alot of object creation and
garbage collection, threatening scalability.  Object management in Java is
really not as strong as other OO languages I have used.  Further, I do not
believe the "cloning" operation would influence the class loader to pick up
the new classes in the new .jar files.

c) this also a variant of b, but since the instantiations are happening
explicitly, it forces the class loading of the newly deployed .jar files.
Again, I am not 100% sure of the behavior of clone() with respect to class
loading.  I would suppose clone() would not have to do class loading.

So, short of being able to handle stateful chains (a concept I have yet to
see a good use case for), the simple approach described in a) seems to
suffice.  The sort of lifecycle management that Jacek described seems to be
handled by the use of classloader by the "WSDD compiler" when the service
and handlers are (re)deployed.

Therefore, I again propose that we defer stateful chainables until after we
have a good, solid working AXIS.  I bet we could define a new kind of
chainContainer and chains that would allow stateful behavior to be
associated with chainables.  But first, lets get the core functionality
working?

thoughts?
sgg

++++++++
Steve Graham
sggraham@us.ibm.com
(919)254-0615 (T/L 444)
<<Pithecanthropus Erectus>>
Emerging Internet Technologies
++++++++


"Yuhichi Nakamura" <NA...@jp.ibm.com> on 12/14/2000 09:39:20 PM

Please respond to soap-dev@xml.apache.org

To:   soap-dev@xml.apache.org
cc:
Subject:  RE: Requirements - 2000/12/11




Jacek,
I guess I am concerning the same problem.  I agree that the lifetime
management is really useful and demanded for real applications.
However, I cannot estimate how difficult to develop such functions.
At this moment, your impression is quite different from Steve's
and Glen's, threrefore I am just confusing.

Steve,
How do you think about Jack's concern?

Best regards,

Yuhichi Nakamura
IBM Research, Tokyo Research Laboratory
Tel: +81-46-215-4668
FAX: +81-46-215-7413


From: Jacek Kopecky <ja...@idoox.com> on 2000/12/15 07:38

Please respond to soap-dev@xml.apache.org

To:   James Snell <jm...@intesolv.com>
cc:
Subject:  RE: Requirements - 2000/12/11



 But I see a problem with the Java Virtual Machine. How do you enforce
a different behavior after redeploy when the redeployment means only
changing the insides of some classes, as opposed to classnames. If
only a .jar gets changed, the JVM needn't notice it at all and it
would be tricky to force it to use the new code for the next request
while still using the old code for the still unfinished older
requests.
 Is it only me seeing this problem? Or is it not a problem at all?
(I may be mistaken here since I'm no Java VM guru).

                            Jacek Kopecky
                               Idoox



On Thu, 14 Dec 2000, James Snell wrote:

 > + 1
 >
 > -----Original Message-----
 > From: Steve Graham [mailto:sggraham@us.ibm.com]
 > Sent: Thursday, December 14, 2000 7:09 AM
 > To: soap-dev@xml.apache.org
 > Subject: Re: Requirements - 2000/12/11
 >
 >
 > The lifetime management issue is important for a couple of reasons,
 > redeploy as well as state-ful chainables.
 > I propose we defer state-ful chainables until after an initial release
of
 > V3.0.
 >
 > As far as redeploy is concerned, stateless chainables simplifies the
 > problem considerably.
 >
 > sgg
 >
 > ++++++++
 > Steve Graham
 > sggraham@us.ibm.com
 > (919)254-0615 (T/L 444)
 > <<Pithecanthropus Erectus>>
 > Emerging Internet Technologies
 > ++++++++
 >
 >
 > "Yuhichi Nakamura" <NA...@jp.ibm.com> on 12/13/2000 09:34:03 PM
 >
 > Please respond to soap-dev@xml.apache.org
 >
 > To:   soap-dev@xml.apache.org
 > cc:
 > Subject:  Re: Requirements - 2000/12/11
 >
 >
 >
 >
 > Glen and Ryo,
 > As for lifetime management, I am happy to support it as long as it
 > is tiny as Glen described.  Lifetime management reminded me of
 > a huge stuff like EJB.  If we assumed such big stuff, I would just
 > disagreed with this.  As Jacked mentioned, we may need class
 > loaders.  In the same manner, when considering realistic
 > functions, we may have to increase it.  I hope someone
 > clarifies necessary functions so that we can imagine
 > the development size.
 > Best regards,
 >
 > Yuhichi Nakamura
 > IBM Research, Tokyo Research Laboratory
 > Tel: +81-46-215-4668
 > FAX: +81-46-215-7413
 >
 >
 > From: Ryo Neyama <ne...@trl.ibm.co.jp> on 2000/12/13 22:48
 >
 > Please respond to soap-dev@xml.apache.org
 >
 > To:   soap-dev@xml.apache.org
 > cc:
 > Subject:  Re: Requirements - 2000/12/11
 >
 >
 >
 > Glen,
 >
 > From: "Glen Daniels" <gd...@allaire.com>
 > Subject: Re: Requirements - 2000/12/11
 > Date: Tue, 12 Dec 2000 18:29:34 -0500
 >
 > > +1 on this being a good requirement; I think there are ways we can
 > > do it that don't require a hugely complex system (see below).  You
 > > could sort of say this is covered by 5.1 in the requirements list,
 > > but I think diving down a little deeper is quite appropriate here,
 > > as 5.1 is rather broad in terms of what's allowed/not.  So +1 for
 > > adding a new requirement.
 >
 > I agree with the requirement too. Also, I agree with the idea that the
 > core engine shouldn't become huge or complex because of implementing
 > the requirement as well.  If the system becomes huge, the system
 > should provide only the extensibility that can plug-in the facility.
 >
 > > As for implementing service switching, it should be fairly easy.
 > > Let's assume a registry of Handler types, and a registry of Chain
 > > types.
 > >
 > > There's a spectrum of usage patterns depending on how static these
 > > objects are.  On one end, you create new actual Chain and Handler
 > > objects for each request.  On the other end, there is only one
 > > instance of each type of Handler, and each type of Chain, shared by
 > > all users.  Let's consider these two cases.
 >
 > Ok. Thease two patterns will be the most extreme patterns.
 >
 > In my understanding, one of the "hybrid" pattern that is most likely
 > would be that instances may be stored into chain pool and they are
 > reused for some sessions as well as that is done for Java Servlet.
 >
 > > In the first case, switching service configurations is easy.  Just
 > > switch the registry to supply the new type of Chain/Handler, and
 > > you're done, since each request has its own copy.
 >
 > I agree.
 >
 > > If we do have shared handlers/chains, I think the switch can still
 > > pretty easily be performed by having simple reference counting on
 > > the entities.  Each time a Chain was retreived to process a request,
 > > it's reference count (and the reference count of all the referenced
 > > Handlers inside it) would be bumped, and it would be dropped each
 > > time the request completed.  The registry itself would cause a
 > > reference count of "1" on each Chain/Handler, so they wouldn't
 > > disappear after each request.  So now, if we want to change
 > > something, we simply replace it in the registry, decrement its
 > > reference count (i.e. the registry drops the reference), and let it
 > > disappear when everything using it has completed.  All new requests
 > > would get the new thing.
 > >
 > > This solution is applicable, I believe, to the whole spectrum of
 > > Handler/Chain lifetime patterns.  Comments?
 >
 > I agree with you.  Reference counting would be useful for this
 > purpose.  However, let me comment on one point.  From the performance
 > point of view, reference counting seems to have an overhead of
 > synchronization of threads.  When increasing or decreasing the
 > reference count of Chain/Handler, the system needs to block the other
 > threads than the current thread.  This might hit the performance of
 > the engine.  What do you think on this point?
 >
 > Regards,
 >     Ryo Neyama @ IBM Research, Tokyo Research Laboratory
 >     Internet Technology
 >     neyama@trl.ibm.co.jp
 >
 >
 >
 >
 >