KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > definition > impl > ImplementationDefinitionImpl


1 // Copyright 2007 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.definition.impl;
16
17 import org.apache.hivemind.Location;
18 import org.apache.hivemind.definition.ImplementationConstructor;
19 import org.apache.hivemind.definition.ImplementationDefinition;
20 import org.apache.hivemind.definition.ModuleDefinition;
21
22 /**
23  * Default implementation of {@link ImplementationDefinition}.
24  *
25  * @author Achim Huegen
26  */

27 public class ImplementationDefinitionImpl extends ExtensionDefinitionImpl implements
28         ImplementationDefinition
29 {
30     private String JavaDoc _serviceModel;
31
32     private ImplementationConstructor _implementationConstructor;
33
34     private boolean _isDefault;
35
36     public ImplementationDefinitionImpl(ModuleDefinition module)
37     {
38         super(module);
39     }
40
41     public ImplementationDefinitionImpl(ModuleDefinition module, Location location,
42             ImplementationConstructor implementationConstructor, String JavaDoc serviceModel, boolean isDefault)
43     {
44         super(module, location);
45         _implementationConstructor = implementationConstructor;
46         _serviceModel = serviceModel;
47         _isDefault = isDefault;
48     }
49
50     /**
51      * @see org.apache.hivemind.definition.ImplementationDefinition#getServiceModel()
52      */

53     public String JavaDoc getServiceModel()
54     {
55         return _serviceModel;
56     }
57
58     /**
59      * Sets the service model of the implementation.
60      */

61     public void setServiceModel(String JavaDoc serviceModel)
62     {
63         _serviceModel = serviceModel;
64     }
65
66     /**
67      * @see org.apache.hivemind.definition.ImplementationDefinition#isDefault()
68      */

69     public boolean isDefault()
70     {
71         return _isDefault;
72     }
73
74     /**
75      * Sets the default attribute of the implementation.
76      * @param isDefault true, if this implementation is the default one
77      */

78     public void setDefault(boolean isDefault)
79     {
80         _isDefault = isDefault;
81     }
82
83     /**
84      * @see org.apache.hivemind.definition.ImplementationDefinition#getServiceConstructor()
85      */

86     public ImplementationConstructor getServiceConstructor()
87     {
88         return _implementationConstructor;
89     }
90
91     /**
92      * Sets the constructor implementation that is used for the creation of
93      * the implementation instance.
94      */

95     public void setImplementationConstructor(ImplementationConstructor serviceConstructor)
96     {
97         _implementationConstructor = serviceConstructor;
98     }
99
100 }
101
Popular Tags