KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > api > internal > toolagent > AppParameter


1 package org.enhydra.shark.api.internal.toolagent;
2
3 /**
4  * This class represents the parameter passed to tool agent application.
5  * It holds all neccessary information about shark's activity variable.
6  * It differs from original WfMC spec in the following:
7  * <ul>
8  * <li> it defines two fields for parameter name (instead of one as it is in spec):
9  * the actual one, and the formal one
10  * <li> it defines additional field which determines the mode of parameter
11  * (it can be input, output or input and output parameter).
12  * <li> it defined additional field which determines the Java class
13  * for the parameter
14  * </ul>
15  */

16 public final class AppParameter {
17
18    /**
19     * The name of the actual parameter (shark variable). This is the Id of
20     * the FormalParameter or DataField from XPDL definition, if mode of
21     * corresponding FormalParameter from XPDL Application Definition is OUT or
22     * IN_OUT, otherwise it is the expression which is evaluated to get the
23     * value contained in this object.
24     */

25    public String JavaDoc the_actual_name = null;
26
27    /**
28     * The name of the formal parameter of XPDL application definition
29     * that corresponds to this AppParameter instance.
30     */

31    public String JavaDoc the_formal_name = null;
32
33    /**
34     * The mode of the formal parameter, as defined in its XPDL application
35     * definition. It can be:
36     * <ul>
37     * <li> "IN" - then shark doesn't take into account the value of this
38     * parameter after execution of tool agent.
39     * <li> "OUT" - then shark takes into account the value of this parameter
40     * after execution, but tool agent application should not care about
41     * this parameter value when it gets it.
42     * <li> "INOUT" - then both, shark and tool agent application take into
43     * account the value of this parameter.
44     * </ul>
45     */

46    public String JavaDoc the_mode = null;
47
48    /**
49     * The value of the parameter - this is a value of a shark variable
50     * if mode of corresponding FormalParameter from XPDL Application Definition
51     * is OUT or IN_OUT, otherwise it is the value of evaluated expression for
52     * the actual parameter in XPDL.
53     */

54    public Object JavaDoc the_value = null;
55
56    /**
57     * The java class of parameter.
58     */

59    public Class JavaDoc the_class = null;
60
61    /**
62     * The length of parameter value. This is not used in standard shark kernel
63     * implementation, and it is defined only to stay as close as possible
64     * to WfMC spec.
65     */

66    public long the_length = -1;
67
68    /**
69     * The type of parameter. This is not used in standard shark kernel
70     * implementation, and it is defined only to stay as close as possible
71     * to WfMC spec.
72     */

73    public long the_type = -1;
74
75    /**
76     * Creates instance with all object fields initialized to null possible
77     * and primitive type fields to -1.
78     */

79    public AppParameter () {
80    }
81
82    /**
83     * Creates an instance with fields set to the given parameter values
84     * (the_length and the_type fields are initialize to -1).
85     */

86    public AppParameter (String JavaDoc _the_actual_name,
87                         String JavaDoc _the_formal_name,
88                         String JavaDoc _the_mode,
89                         Object JavaDoc _the_value,
90                         Class JavaDoc _the_class) {
91
92       the_actual_name = _the_actual_name;
93       the_formal_name = _the_formal_name;
94       the_mode = _the_mode;
95       the_value = _the_value;
96       the_class = _the_class;
97    } // ctor
98

99    /**
100     * Creates an instance with fields set to the given parameter values.
101     */

102    public AppParameter (String JavaDoc _the_actual_name,
103                         String JavaDoc _the_formal_name,
104                         String JavaDoc _the_mode,
105                         Object JavaDoc _the_value,
106                         Class JavaDoc _the_class,
107                         long _the_length_,
108                         long _the_type_) {
109       the_actual_name = _the_actual_name;
110       the_formal_name = _the_formal_name;
111       the_mode = _the_mode;
112       the_value = _the_value;
113       the_class = _the_class;
114       the_length = _the_length_;
115       the_type = _the_type_;
116    } // ctor
117

118    public String JavaDoc toString () {
119       return "[APN="+the_actual_name+", FPN="+the_formal_name+", MODE="+the_mode+", VAL="+the_value+", CLS="+the_class+", LNG="+the_length+", TYP="+the_type+"]";
120    }
121 }
122
Popular Tags