|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
CreateInstanceDescriptor.java | - | 100% | 100% | 100% |
|
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 org.apache.hivemind.impl.BaseLocatable;
|
|
18 |
import org.apache.hivemind.impl.CreateClassServiceConstructor;
|
|
19 |
import org.apache.hivemind.internal.Module;
|
|
20 |
import org.apache.hivemind.internal.ServicePoint;
|
|
21 |
import org.apache.hivemind.internal.ServiceImplementationConstructor;
|
|
22 |
import org.apache.hivemind.util.ToStringBuilder;
|
|
23 |
|
|
24 |
/**
|
|
25 |
* Descriptor for the <create-instance< element, used to create
|
|
26 |
* a core service implementation from a class name.
|
|
27 |
*
|
|
28 |
* @author Howard Lewis Ship
|
|
29 |
*/
|
|
30 |
public final class CreateInstanceDescriptor extends BaseLocatable implements InstanceBuilder |
|
31 |
{ |
|
32 |
private String _serviceModel = "singleton"; |
|
33 |
private String _instanceClassName;
|
|
34 |
|
|
35 | 23 |
public String getInstanceClassName()
|
36 |
{ |
|
37 | 23 |
return _instanceClassName;
|
38 |
} |
|
39 |
|
|
40 | 793 |
public void setInstanceClassName(String string) |
41 |
{ |
|
42 | 793 |
_instanceClassName = string; |
43 |
} |
|
44 |
|
|
45 | 759 |
public ServiceImplementationConstructor createConstructor(
|
46 |
ServicePoint point, |
|
47 |
Module contributingModule) |
|
48 |
{ |
|
49 | 759 |
CreateClassServiceConstructor result = new CreateClassServiceConstructor();
|
50 |
|
|
51 | 759 |
result.setLocation(getLocation()); |
52 | 759 |
result.setContributingModule(contributingModule); |
53 | 759 |
result.setInstanceClassName(_instanceClassName); |
54 |
|
|
55 | 759 |
return result;
|
56 |
} |
|
57 |
|
|
58 | 92 |
public String toString()
|
59 |
{ |
|
60 | 92 |
ToStringBuilder builder = new ToStringBuilder(this); |
61 |
|
|
62 | 92 |
builder.append("instanceClassName", _instanceClassName);
|
63 | 92 |
builder.append("serviceModel", _serviceModel);
|
64 |
|
|
65 | 92 |
return builder.toString();
|
66 |
} |
|
67 |
|
|
68 | 787 |
public String getServiceModel()
|
69 |
{ |
|
70 | 787 |
return _serviceModel;
|
71 |
} |
|
72 |
|
|
73 | 793 |
public void setServiceModel(String serviceModel) |
74 |
{ |
|
75 | 793 |
_serviceModel = serviceModel; |
76 |
} |
|
77 |
|
|
78 |
} |
|
79 |
|
|