|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| package org.apache.hivemind.lib.impl; |
|
16 |
| |
|
17 |
| import javax.naming.Context; |
|
18 |
| |
|
19 |
| import org.apache.commons.logging.Log; |
|
20 |
| import org.apache.commons.logging.LogFactory; |
|
21 |
| import org.apache.hivemind.impl.MessageFormatter; |
|
22 |
| import org.apache.hivemind.service.ClassFabUtils; |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| final class ImplMessages |
|
30 |
| { |
|
31 |
| private static final Log LOG = LogFactory.getLog(ImplMessages.class); |
|
32 |
| |
|
33 |
| private static final MessageFormatter _formatter = |
|
34 |
| new MessageFormatter(LOG, ImplMessages.class, "ImplStrings"); |
|
35 |
| |
|
36 |
0
| static String unableToCreateDefaultImplementation(Class interfaceType, Throwable cause)
|
|
37 |
| { |
|
38 |
0
| return _formatter.format(
|
|
39 |
| "unable-to-create-default-implementation", |
|
40 |
| interfaceType.getName(), |
|
41 |
| cause.getMessage()); |
|
42 |
| } |
|
43 |
| |
|
44 |
1
| static String notAnInterface(Class interfaceType)
|
|
45 |
| { |
|
46 |
1
| return _formatter.format("not-an-interface", interfaceType.getName());
|
|
47 |
| } |
|
48 |
| |
|
49 |
7
| static String defaultImplementationDescription(Class interfaceType)
|
|
50 |
| { |
|
51 |
7
| return _formatter.format("default-implementation-description", interfaceType.getName());
|
|
52 |
| } |
|
53 |
| |
|
54 |
3
| static String ejbProxyDescription(String serviceId, Class serviceInterface, String jndiName)
|
|
55 |
| { |
|
56 |
3
| return _formatter.format(
|
|
57 |
| "ejb-proxy-description", |
|
58 |
| serviceId, |
|
59 |
| serviceInterface.getName(), |
|
60 |
| jndiName); |
|
61 |
| } |
|
62 |
| |
|
63 |
1
| static String unableToLookup(String name, Context context)
|
|
64 |
| { |
|
65 |
1
| return _formatter.format("unable-to-lookup", name, context);
|
|
66 |
| } |
|
67 |
| |
|
68 |
0
| static String noObject(String name, Class expectedType)
|
|
69 |
| { |
|
70 |
0
| return _formatter.format("no-object", name, expectedType);
|
|
71 |
| } |
|
72 |
| |
|
73 |
0
| static String wrongType(String name, Object object, Class expectedType)
|
|
74 |
| { |
|
75 |
0
| return _formatter.format("wrong-type", name, object, expectedType);
|
|
76 |
| } |
|
77 |
| |
|
78 |
0
| static String coordinatorLocked(String methodName)
|
|
79 |
| { |
|
80 |
0
| return _formatter.format("coordinator-locked", methodName);
|
|
81 |
| } |
|
82 |
| |
|
83 |
1
| static String servicePropertyNotReadable(String propertyName, Object service)
|
|
84 |
| { |
|
85 |
1
| return _formatter.format("service-property-not-readable", propertyName, service);
|
|
86 |
| } |
|
87 |
| |
|
88 |
1
| static String servicePropertyWrongType(
|
|
89 |
| String propertyName, |
|
90 |
| Object service, |
|
91 |
| Class actualType, |
|
92 |
| Class expectedType) |
|
93 |
| { |
|
94 |
1
| return _formatter.format(
|
|
95 |
| "service-property-wrong-type", |
|
96 |
| new Object[] { |
|
97 |
| propertyName, |
|
98 |
| service, |
|
99 |
| ClassFabUtils.getJavaClassName(actualType), |
|
100 |
| expectedType.getName()}); |
|
101 |
| } |
|
102 |
| |
|
103 |
6
| static String servicePropertyWasNull(String propertyName, Object service)
|
|
104 |
| { |
|
105 |
6
| return _formatter.format("service-property-was-null", propertyName, service);
|
|
106 |
| } |
|
107 |
| |
|
108 |
6
| static String servicePropertyToString(
|
|
109 |
| String serviceId, |
|
110 |
| Class serviceInterface, |
|
111 |
| String propertyName, |
|
112 |
| Object service) |
|
113 |
| { |
|
114 |
6
| return _formatter.format(
|
|
115 |
| "service-property-to-string", |
|
116 |
| new Object[] { serviceId, serviceInterface.getName(), propertyName, service }); |
|
117 |
| } |
|
118 |
| } |