KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > parse > AbstractServiceInvocationDescriptor


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.hivemind.parse;
16
17 import java.util.ArrayList JavaDoc;
18 import java.util.List JavaDoc;
19
20 import org.apache.hivemind.Element;
21 import org.apache.hivemind.impl.BaseLocatable;
22 import org.apache.hivemind.util.ToStringBuilder;
23
24 /**
25  * Base class for descriptors that represent invocating a service with parameters.
26  * This is used for the <interceptor> and <invoke-factory> elements.
27  *
28  * @author Howard Lewis Ship
29  */

30 public abstract class AbstractServiceInvocationDescriptor extends BaseLocatable
31 {
32     private String JavaDoc _factoryServiceId;
33
34     private List JavaDoc _parameters;
35
36     public void addParameter(Element parameter)
37     {
38         if (_parameters == null)
39             _parameters = new ArrayList JavaDoc();
40     
41         _parameters.add(parameter);
42     }
43
44     public List JavaDoc getParameters()
45     {
46         return _parameters;
47     }
48
49     public String JavaDoc getFactoryServiceId()
50     {
51         return _factoryServiceId;
52     }
53
54     public void setFactoryServiceId(String JavaDoc string)
55     {
56         _factoryServiceId = string;
57     }
58
59     public String JavaDoc toString()
60     {
61         ToStringBuilder builder = new ToStringBuilder(this);
62     
63         builder.append("factoryServiceId", _factoryServiceId);
64         builder.append("parameters", _parameters);
65        
66         extendDescription(builder);
67     
68         return builder.toString();
69     }
70     
71     /**
72      * Overridden in subclasses to provide more information about
73      * the instance. This implementation does nothing.
74      */

75     protected void extendDescription(ToStringBuilder builder)
76     {
77     }
78
79     
80 }
81
Popular Tags