Re: interfaces as service parameters?

From: Simon Horrell <>
Date: Thu, 07 Mar 2002 11:23:50 +0000

>>From section 5.5 of the JAX-RPC spec.

A JAX-RPC value type is a Java class whose value can be moved between a

client and service endpoint. A Java class must follow these rules to be a

conformant value type:

. Java class must have a public default constructor.

. Java class must not implement (directly or indirectly) the java.rmi.Remote


. Java class may implement any Java interface (except the java.rmi.Remote

or extend another Java class.

. Java class may contain public, private, protected, package-level fields.
The Java type

of a public field must be a supported JAX-RPC type as specified in the
section 5.1,

"JAX-RPC Supported Java Types".

. Java class may contain methods. There are no specified restrictions on the
nature of

these methods. Refer to the later rule about the JavaBeans properties.

. Java class may contain static or transient fields.

. Java class for a JAX-RPC value type may be designed as a JavaBeans class.
In this

case, the bean properties (as defined by the JavaBeans introspection) are
required to

follow the JavaBeans design pattern of setter and getter methods. The Java
type of a

bean property must be a supported JAX-RPC type as specified in the section

"JAX-RPC Supported Java Types".

Even though the spec allows value types with public fields I think the
JAX-RPC reference implementation only supports JavaBeans right now. This
means implementing (not extending), having a public
no-arg constructor and having public getter/setter methods for each of the
fields to be [de]serialized.


----- Original Message -----
From: "Oliver Suciu" <olivers_at_TIBCOFINANCE.COM>
Sent: Thursday, March 07, 2002 2:52 AM
Subject: interfaces as service parameters?

> Hi all,
> Would the following work in JAX-RPC?
> // the service to be exposed:
> public interface MyServiceProvider extends java.rmi.Remote {
> public MyData doSomething(MyData someData) throws
> java.rmi.RemoteException;
> }
> // the interface that all data objects must implement:
> public interface MyData extends {
> }
> // some specific data object:
> public class SpecificData implements MyData {
> public boolean flag;
> }
> ???
> Thx,
> -- Oliver