1
|
|
|
2
|
|
|
3
|
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
|
|
10
|
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
package org.apache.hivemind.service.impl;
|
16
|
|
|
17
|
|
import java.beans.EventSetDescriptor;
|
18
|
|
|
19
|
|
import javassist.CtClass;
|
20
|
|
import javassist.CtMethod;
|
21
|
|
|
22
|
|
import org.apache.hivemind.InterceptorStack;
|
23
|
|
import org.apache.hivemind.Location;
|
24
|
|
import org.apache.hivemind.impl.MessageFormatter;
|
25
|
|
import org.apache.hivemind.service.MethodSignature;
|
26
|
|
|
27
|
|
|
28
|
|
|
29
|
|
|
30
|
|
|
31
|
|
|
32
|
|
final class ServiceMessages
|
33
|
|
{
|
34
|
|
private static final MessageFormatter _formatter =
|
35
|
|
new MessageFormatter(ServiceMessages.class, "ServiceStrings");
|
36
|
|
|
37
|
3
|
public static String unableToInitializeService(
|
38
|
|
String serviceId,
|
39
|
|
String methodName,
|
40
|
|
Class serviceClass,
|
41
|
|
Throwable ex)
|
42
|
|
{
|
43
|
3
|
return _formatter.format(
|
44
|
|
"unable-to-initialize-service",
|
45
|
|
new Object[] { serviceId, methodName, serviceClass.getName(), ex });
|
46
|
|
}
|
47
|
|
|
48
|
0
|
public static String errorInstantiatingInterceptor(
|
49
|
|
String serviceId,
|
50
|
|
InterceptorStack stack,
|
51
|
|
Class interceptorClass,
|
52
|
|
Throwable cause)
|
53
|
|
{
|
54
|
0
|
return _formatter.format(
|
55
|
|
"error-instantiating-interceptor",
|
56
|
|
new Object[] {
|
57
|
|
serviceId,
|
58
|
|
stack.getServiceInterface().getName(),
|
59
|
|
stack.getServiceExtensionPointId(),
|
60
|
|
interceptorClass.getName(),
|
61
|
|
cause });
|
62
|
|
}
|
63
|
|
|
64
|
0
|
public static String unableToAddField(String fieldName, CtClass ctClass, Throwable cause)
|
65
|
|
{
|
66
|
0
|
return _formatter.format("unable-to-add-field", fieldName, ctClass.getName(), cause);
|
67
|
|
}
|
68
|
|
|
69
|
1
|
public static String unableToAddMethod(
|
70
|
|
MethodSignature methodSignature,
|
71
|
|
CtClass ctClass,
|
72
|
|
Throwable cause)
|
73
|
|
{
|
74
|
1
|
return _formatter.format("unable-to-add-method", methodSignature, ctClass.getName(), cause);
|
75
|
|
}
|
76
|
|
|
77
|
1
|
public static String unableToAddConstructor(CtClass ctClass, Throwable cause)
|
78
|
|
{
|
79
|
1
|
return _formatter.format("unable-to-add-constructor", ctClass.getName(), cause);
|
80
|
|
}
|
81
|
|
|
82
|
3
|
public static String unableToWriteClass(CtClass ctClass, Throwable cause)
|
83
|
|
{
|
84
|
3
|
return _formatter.format("unable-to-write-class", ctClass.getName(), cause);
|
85
|
|
}
|
86
|
|
|
87
|
0
|
public static String unableToCreateClass(String name, Class superClass, Throwable cause)
|
88
|
|
{
|
89
|
0
|
return _formatter.format("unable-to-create-class", name, superClass.getName(), cause);
|
90
|
|
}
|
91
|
|
|
92
|
0
|
public static String unableToLookupClass(String name, Throwable cause)
|
93
|
|
{
|
94
|
0
|
return _formatter.format("unable-to-lookup", name, cause);
|
95
|
|
}
|
96
|
|
|
97
|
1
|
public static String notCompatibleWithEvent(
|
98
|
|
Object consumer,
|
99
|
|
EventSetDescriptor set,
|
100
|
|
Object producer)
|
101
|
|
{
|
102
|
1
|
return _formatter.format(
|
103
|
|
"not-compatible-with-event",
|
104
|
|
new Object[] { consumer, set.getListenerType().getName(), set.getName(), producer });
|
105
|
|
}
|
106
|
|
|
107
|
1
|
public static String noSuchEventSet(Object producer, String name)
|
108
|
|
{
|
109
|
1
|
return _formatter.format("no-such-event-set", producer, name);
|
110
|
|
}
|
111
|
|
|
112
|
2
|
public static String noEventMatches(Object consumer, Object producer)
|
113
|
|
{
|
114
|
2
|
return _formatter.format("no-event-matches", consumer, producer);
|
115
|
|
}
|
116
|
|
|
117
|
0
|
public static String unableToAddListener(
|
118
|
|
Object producer,
|
119
|
|
EventSetDescriptor set,
|
120
|
|
Object consumer,
|
121
|
|
Location location,
|
122
|
|
Throwable cause)
|
123
|
|
{
|
124
|
0
|
return _formatter.format(
|
125
|
|
"unable-to-add-listener",
|
126
|
|
new Object[] { consumer, producer, set.getName(), location, cause });
|
127
|
|
}
|
128
|
|
|
129
|
0
|
public static String unableToIntrospectClass(Class targetClass, Throwable cause)
|
130
|
|
{
|
131
|
0
|
return _formatter.format("unable-to-introspect-class", targetClass.getName(), cause);
|
132
|
|
}
|
133
|
|
|
134
|
1
|
public static String unableToAddCatch(Class exceptionClass, CtMethod method, Throwable cause)
|
135
|
|
{
|
136
|
1
|
return _formatter.format(
|
137
|
|
"unable-to-add-catch",
|
138
|
|
exceptionClass.getName(),
|
139
|
|
method.getDeclaringClass().getName(),
|
140
|
|
cause);
|
141
|
|
}
|
142
|
|
|
143
|
1
|
public static String duplicateMethodInClass(MethodSignature ms, ClassFabImpl cf)
|
144
|
|
{
|
145
|
1
|
return _formatter.format("duplicate-method-in-class", ms, cf.getName());
|
146
|
|
}
|
147
|
|
|
148
|
1
|
public static String unableToExtendMethod(
|
149
|
|
MethodSignature ms,
|
150
|
|
String className,
|
151
|
|
Throwable cause)
|
152
|
|
{
|
153
|
1
|
return _formatter.format("unable-to-extend-method", ms, className, cause);
|
154
|
|
}
|
155
|
|
|
156
|
1
|
public static String invalidProviderSelector(String selector)
|
157
|
|
{
|
158
|
1
|
return _formatter.format("invalid-provider-selector", selector);
|
159
|
|
}
|
160
|
|
|
161
|
1
|
public static String unknownProviderPrefix(String prefix)
|
162
|
|
{
|
163
|
1
|
return _formatter.format("unknown-provider-prefix", prefix);
|
164
|
|
}
|
165
|
|
|
166
|
0
|
public static String duplicateProviderPrefix(String prefix, Location priorLocation)
|
167
|
|
{
|
168
|
0
|
return _formatter.format("duplicate-provider-prefix", prefix, priorLocation);
|
169
|
|
}
|
170
|
|
|
171
|
1
|
public static String errorInstantiatingInstance(Class clazz, Throwable cause)
|
172
|
|
{
|
173
|
1
|
return _formatter.format("error-instantiating-instance", clazz.getName(), cause);
|
174
|
|
}
|
175
|
|
|
176
|
2
|
public static String invalidServicePropertyLocator(String locator)
|
177
|
|
{
|
178
|
2
|
return _formatter.format("invalid-service-property-locator", locator);
|
179
|
|
}
|
180
|
|
|
181
|
1
|
public static String failureBuildingService(String serviceId, Throwable cause)
|
182
|
|
{
|
183
|
1
|
return _formatter.format("failure-building-service", serviceId, cause);
|
184
|
|
}
|
185
|
|
|
186
|
2
|
public static String autowirePropertyFailure(
|
187
|
|
String propertyName,
|
188
|
|
String serviceId,
|
189
|
|
Throwable cause)
|
190
|
|
{
|
191
|
2
|
return _formatter.format("autowire-property-failure", propertyName, serviceId, cause);
|
192
|
|
}
|
193
|
|
|
194
|
1
|
public static String unableToFindAutowireConstructor()
|
195
|
|
{
|
196
|
1
|
return _formatter.getMessage("unable-to-find-autowire-constructor");
|
197
|
|
}
|
198
|
|
}
|
199
|
|
|