Hi,

This mail thread having got very long, here is a summary of where we stand
and where I seek help from the community.

1) PassByValue is enforced by the way of PassByValueInterceptor that is
added to the inbound chain of the producer / server component.

2) The PassByValueInterceptor copies the arguments / result data objects as
follows : -
  - checks the databinding associated with the arguments / result data
types and invokes the 'copy' method on the associated databinding
implementation.  The databinding is found by introspecting the data type
(using DataBindingRegistry.introspect).
  - if a databinding cannot be assoicated then the interceptor tries to
copy using Java Serialization
  - if the argument / result objects are not java.io.Serializable then an
exception is thrown.

Questions
---------
Is this a good enough policy for data copying i.e. going by the databinding
if detectable or by java.io.Serializability.  Take for example the
echo.databinding sample that has XMLStreamReader as argument for one of the
components service methods. This fails rightaway.  Wonder what other
datatypes could fail as this.

Besides using the databinding, java serialization there is a another way of
copying objects using the various transformers that are available.  For
example in the XMLStreamReader case we could use a round trip transformation
of  XMLStreamReader->String->XMLStreamReader.  Is this something that we
could do?

To me, passing streams / readers as arguments is not so convincing of a lose
coupling of components.  I'd rather pass information based on which the
stream could be constructed by the producer in the producers context.  But
then, this is besides the point as it probably excludes a subset of data
types. To cover all, is there a design / programming model that needs to be
put in place for the types of arguments can be used on Service interfaces
for e.g. do we say that Remotable Interfaces should use arguments that are
either associated with a databinding or is java.io.Serializable ?

Could the community help me with some clarity on this please.  Thanks.

- Venkat

Reply via email to