KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > order > OrdererMessages


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 class OrdererMessages
27 {
28     protected static MessageFormatter _formatter = new MessageFormatter(OrdererMessages.class);
29
30     static String JavaDoc duplicateName(String JavaDoc objectType, String JavaDoc objectName, Object JavaDoc newObject,
31             Object JavaDoc existingObject)
32     {
33         return _formatter.format(
34                 "duplicate-name",
35                 StringUtils.capitalize(objectType),
36                 objectName,
37                 HiveMind.getLocationString(existingObject));
38     }
39
40     static String JavaDoc exception(String JavaDoc objectType, Throwable JavaDoc cause)
41     {
42         return _formatter.format("exception", objectType, cause);
43     }
44
45     static String JavaDoc dupeLeader(String JavaDoc objectType, ObjectOrdering newOrdering,
46             ObjectOrdering existingLeader)
47     {
48         return _formatter.format("dupe-leader", new Object JavaDoc[]
49         { StringUtils.capitalize(objectType), newOrdering.getName(), existingLeader.getName(),
50                 HiveMind.getLocationString(existingLeader.getObject()) });
51     }
52
53     static String JavaDoc dupeTrailer(String JavaDoc objectType, ObjectOrdering newOrdering,
54             ObjectOrdering existingTrailer)
55     {
56         return _formatter.format("dupe-trailer", new Object JavaDoc[]
57         { StringUtils.capitalize(objectType), newOrdering.getName(), existingTrailer.getName(),
58                 HiveMind.getLocationString(existingTrailer.getObject()) });
59     }
60
61     static String JavaDoc dependencyCycle(String JavaDoc objectType, ObjectOrdering trigger, Throwable JavaDoc cause)
62     {
63         return _formatter.format("dependency-cycle", objectType, trigger.getName(), cause);
64     }
65
66     static String JavaDoc badDependency(String JavaDoc objectType, String JavaDoc dependencyName, ObjectOrdering ordering)
67     {
68         return _formatter.format("bad-dependency", objectType, dependencyName, ordering.getName());
69
70     }
71
72 }
Popular Tags