Previous section   Next section
Package javax.xml.rpc.holders

JAX-RPC 1.0; JWSDP 1.0, J2EE 1.4

This package contains a set of classes that are used to simulate method arguments that can be used to receive output values, a feature that is not directly supported by the Java programming language. A holder argument is used wherever the WSDL definition calls for an output or input/output argument. In terms of method call syntax, a service endpoint interface method that uses a holder class looks like this:

public void methodName(IntHolder arg) throws RemoteException;

All holders implement the Holder interface, which is a marker that does not declare any methods. Each holder class can contain a value of a specific type. There are 21 pre-defined holder classes in the javax.xml.rpc.holders package, which correspond to the Java primitive types (such as int), their object wrapper counterparts (such as Integer), and a small number of special cases (such as QNameHolder). A simple naming convention applies to the standard wrapper classes:

JAX-RPC is capable of generating additional holder classes for method arguments of other types that are defined to have either output or input/output semantics. For the reference implementation, this task is performed by the wscompile utility described in Chapter 2 and Chapter 8. Since the Holder interface does not define any methods, there is no standard way to get or set the value in a holder. Instead, the predefined classes all follow a coding convention as follows:

Assuming that the argument of the methodName( ) method just shown has input/output semantics, the following code extract shows how it might be used:

IntHolder arg = new IntHolder(10);    // Use 10 as the argument value
port.methodName(arg);                 // Invoke the method...
int result = arg.value;                      // ... and get the result

Customized holders can be created by writing a class that declares that it implements the Holder and follows these coding conventions. Refer to Chapter 2 for an example.

Interfaces

public interface Holder;

Classes

public final class BigDecimalHolder implements Holder;
public final class BigIntegerHolder implements Holder;
public final class BooleanHolder implements Holder;
public final class BooleanWrapperHolder implements Holder;
public final class ByteArrayHolder implements Holder;
public final class ByteHolder implements Holder;
public final class ByteWrapperHolder implements Holder;
public final class CalendarHolder implements Holder;
public final class DoubleHolder implements Holder;
public final class DoubleWrapperHolder implements Holder;
public final class FloatHolder implements Holder;
public final class FloatWrapperHolder implements Holder;
public final class IntegerWrapperHolder implements Holder;
public final class IntHolder implements Holder;
public final class LongHolder implements Holder;
public final class LongWrapperHolder implements Holder;
public final class ObjectHolder implements Holder;
public final class QNameHolder implements Holder;
public final class ShortHolder implements Holder;
public final class ShortWrapperHolder implements Holder;
public final class StringHolder implements Holder;

  Previous section   Next section