< prev index next >

src/java.xml.ws/share/classes/com/sun/xml/internal/ws/server/sei/EndpointValueSetter.java

Print this page




  36  *
  37  * <p>
  38  * Sometimes values are returned as a return value, and
  39  * others are returned in the {@link Holder} value. Instances
  40  * of this interface abstracts this detail.
  41  *
  42  * <p>
  43  * {@link EndpointValueSetter} is a stateless behavior encapsulation.
  44  *
  45  * @author Jitendra Kotamraju
  46  */
  47 public abstract class EndpointValueSetter {
  48     private EndpointValueSetter() {}
  49 
  50     /**
  51      * Moves the value to the expected place.
  52      *
  53      * @param obj
  54      *      The unmarshalled object.
  55      * @param args
  56      *      The arguments that need to be given to the Java method invocation. If <tt>obj</tt>
  57      *      is supposed to be returned as a {@link Holder} value, a suitable
  58      *      {@link Holder} is obtained from this argument list and <tt>obj</tt>
  59      *      is set.
  60      *
  61      */
  62     abstract void put(Object obj, Object[] args);
  63 
  64     /**
  65      * {@link Param}s with small index numbers are used often,
  66      * so we pool them to reduce the footprint.
  67      */
  68     private static final EndpointValueSetter[] POOL = new EndpointValueSetter[16];
  69 
  70     static {
  71         for( int i=0; i<POOL.length; i++ )
  72             POOL[i] = new Param(i);
  73     }
  74 
  75     /**
  76      * Returns a {@link EndpointValueSetter} suitable for the given {@link Parameter}.
  77      */
  78     public static EndpointValueSetter get(ParameterImpl p) {
  79         int idx = p.getIndex();




  36  *
  37  * <p>
  38  * Sometimes values are returned as a return value, and
  39  * others are returned in the {@link Holder} value. Instances
  40  * of this interface abstracts this detail.
  41  *
  42  * <p>
  43  * {@link EndpointValueSetter} is a stateless behavior encapsulation.
  44  *
  45  * @author Jitendra Kotamraju
  46  */
  47 public abstract class EndpointValueSetter {
  48     private EndpointValueSetter() {}
  49 
  50     /**
  51      * Moves the value to the expected place.
  52      *
  53      * @param obj
  54      *      The unmarshalled object.
  55      * @param args
  56      *      The arguments that need to be given to the Java method invocation.
  57      *      If {@code obj} is supposed to be returned as a {@link Holder}
  58      *      value, a suitable {@link Holder} is obtained from
  59      *      this argument list and {@code obj} is set.
  60      *
  61      */
  62     abstract void put(Object obj, Object[] args);
  63 
  64     /**
  65      * {@link Param}s with small index numbers are used often,
  66      * so we pool them to reduce the footprint.
  67      */
  68     private static final EndpointValueSetter[] POOL = new EndpointValueSetter[16];
  69 
  70     static {
  71         for( int i=0; i<POOL.length; i++ )
  72             POOL[i] = new Param(i);
  73     }
  74 
  75     /**
  76      * Returns a {@link EndpointValueSetter} suitable for the given {@link Parameter}.
  77      */
  78     public static EndpointValueSetter get(ParameterImpl p) {
  79         int idx = p.getIndex();


< prev index next >