KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > lib > impl > ImplMessages


1 // Copyright 2004-2006 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.lib.impl;
16
17 import javax.naming.Context JavaDoc;
18
19 import org.apache.hivemind.impl.MessageFormatter;
20 import org.apache.hivemind.service.ClassFabUtils;
21
22 /**
23  * Messages for the lib.impl package.
24  *
25  * @author Howard Lewis Ship
26  */

27 final class ImplMessages
28 {
29     private static final MessageFormatter FORMATTER = new MessageFormatter(ImplMessages.class);
30
31     static String JavaDoc unableToCreateDefaultImplementation(Class JavaDoc interfaceType, Throwable JavaDoc cause)
32     {
33         return FORMATTER.format(
34                 "unable-to-create-default-implementation",
35                 interfaceType.getName(),
36                 cause.getMessage());
37     }
38
39     static String JavaDoc notAnInterface(Class JavaDoc interfaceType)
40     {
41         return FORMATTER.format("not-an-interface", interfaceType.getName());
42     }
43
44     static String JavaDoc defaultImplementationDescription(Class JavaDoc interfaceType)
45     {
46         return FORMATTER.format("default-implementation-description", interfaceType.getName());
47     }
48
49     static String JavaDoc ejbProxyDescription(String JavaDoc serviceId, Class JavaDoc serviceInterface, String JavaDoc jndiName)
50     {
51         return FORMATTER.format(
52                 "ejb-proxy-description",
53                 serviceId,
54                 serviceInterface.getName(),
55                 jndiName);
56     }
57
58     static String JavaDoc unableToLookup(String JavaDoc name, Context JavaDoc context)
59     {
60         return FORMATTER.format("unable-to-lookup", name, context);
61     }
62
63     static String JavaDoc noObject(String JavaDoc name, Class JavaDoc expectedType)
64     {
65         return FORMATTER.format("no-object", name, expectedType);
66     }
67
68     static String JavaDoc wrongType(String JavaDoc name, Object JavaDoc object, Class JavaDoc expectedType)
69     {
70         return FORMATTER.format("wrong-type", name, object, expectedType);
71     }
72
73     static String JavaDoc coordinatorLocked(String JavaDoc methodName)
74     {
75         return FORMATTER.format("coordinator-locked", methodName);
76     }
77
78     static String JavaDoc servicePropertyNotReadable(String JavaDoc propertyName, Object JavaDoc service)
79     {
80         return FORMATTER.format("service-property-not-readable", propertyName, service);
81     }
82
83     static String JavaDoc servicePropertyWrongType(String JavaDoc propertyName, Object JavaDoc service, Class JavaDoc actualType,
84             Class JavaDoc expectedType)
85     {
86         return FORMATTER.format(
87                 "service-property-wrong-type",
88                 new Object JavaDoc[]
89                 { propertyName, service, ClassFabUtils.getJavaClassName(actualType),
90                         expectedType.getName() });
91     }
92
93     static String JavaDoc servicePropertyWasNull(String JavaDoc propertyName, Object JavaDoc service)
94     {
95         return FORMATTER.format("service-property-was-null", propertyName, service);
96     }
97
98     static String JavaDoc servicePropertyToString(String JavaDoc serviceId, Class JavaDoc serviceInterface,
99             String JavaDoc propertyName, Object JavaDoc service)
100     {
101         return FORMATTER.format("service-property-to-string", new Object JavaDoc[]
102         { serviceId, serviceInterface.getName(), propertyName, service });
103     }
104 }
Popular Tags