|
|||||||||||||||||||
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 | |||||||||||||||
OrdererMessages.java | - | 83.3% | 83.3% | 83.3% |
|
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.order;
|
|
16 |
|
|
17 |
import org.apache.hivemind.HiveMind;
|
|
18 |
import org.apache.hivemind.impl.MessageFormatter;
|
|
19 |
import org.apache.hivemind.util.StringUtils;
|
|
20 |
|
|
21 |
/**
|
|
22 |
* Messages for classes in this package.
|
|
23 |
*
|
|
24 |
* @author Howard Lewis Ship
|
|
25 |
*/
|
|
26 |
final class OrdererMessages
|
|
27 |
{ |
|
28 |
private static final MessageFormatter _formatter = |
|
29 |
new MessageFormatter(OrdererMessages.class, "OrdererStrings"); |
|
30 |
|
|
31 | 1 |
public static String duplicateName( |
32 |
String objectType, |
|
33 |
String objectName, |
|
34 |
Object newObject, |
|
35 |
Object existingObject) |
|
36 |
{ |
|
37 | 1 |
return _formatter.format(
|
38 |
"duplicate-name",
|
|
39 |
StringUtils.capitalize(objectType), |
|
40 |
objectName, |
|
41 |
HiveMind.getLocationString(existingObject)); |
|
42 |
} |
|
43 |
|
|
44 | 0 |
public static String exception(String objectType, Throwable cause) |
45 |
{ |
|
46 | 0 |
return _formatter.format("Orderer.exception", objectType, cause); |
47 |
} |
|
48 |
|
|
49 | 1 |
public static String dupeLeader( |
50 |
String objectType, |
|
51 |
ObjectOrdering newOrdering, |
|
52 |
ObjectOrdering existingLeader) |
|
53 |
{ |
|
54 | 1 |
return _formatter.format(
|
55 |
"dupe-leader",
|
|
56 |
new Object[] {
|
|
57 |
StringUtils.capitalize(objectType), |
|
58 |
newOrdering.getName(), |
|
59 |
existingLeader.getName(), |
|
60 |
HiveMind.getLocationString(existingLeader.getObject())}); |
|
61 |
} |
|
62 |
|
|
63 | 1 |
public static String dupeTrailer( |
64 |
String objectType, |
|
65 |
ObjectOrdering newOrdering, |
|
66 |
ObjectOrdering existingTrailer) |
|
67 |
{ |
|
68 | 1 |
return _formatter.format(
|
69 |
"dupe-trailer",
|
|
70 |
new Object[] {
|
|
71 |
StringUtils.capitalize(objectType), |
|
72 |
newOrdering.getName(), |
|
73 |
existingTrailer.getName(), |
|
74 |
HiveMind.getLocationString(existingTrailer.getObject())}); |
|
75 |
} |
|
76 |
|
|
77 | 2 |
public static String dependencyCycle( |
78 |
String objectType, |
|
79 |
ObjectOrdering trigger, |
|
80 |
Throwable cause) |
|
81 |
{ |
|
82 | 2 |
return _formatter.format("dependency-cycle", objectType, trigger.getName(), cause); |
83 |
} |
|
84 |
|
|
85 | 2 |
public static String badDependency( |
86 |
String objectType, |
|
87 |
String dependencyName, |
|
88 |
ObjectOrdering ordering) |
|
89 |
{ |
|
90 | 2 |
return _formatter.format("bad-dependency", objectType, dependencyName, ordering.getName()); |
91 |
|
|
92 |
} |
|
93 |
|
|
94 |
} |
|