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 = new MessageFormatter(ServiceMessages.class,
|
35
|
|
"ServiceStrings");
|
36
|
|
|
37
|
3
|
public static String unableToInitializeService(String serviceId, String methodName,
|
38
|
|
Class serviceClass, Throwable ex)
|
39
|
|
{
|
40
|
3
|
return _formatter.format("unable-to-initialize-service", new Object[]
|
41
|
|
{ serviceId, methodName, serviceClass.getName(), ex });
|
42
|
|
}
|
43
|
|
|
44
|
0
|
public static String errorInstantiatingInterceptor(String serviceId, InterceptorStack stack,
|
45
|
|
Class interceptorClass, Throwable cause)
|
46
|
|
{
|
47
|
0
|
return _formatter.format("error-instantiating-interceptor", new Object[]
|
48
|
|
{ serviceId, stack.getServiceInterface().getName(), stack.getServiceExtensionPointId(),
|
49
|
|
interceptorClass.getName(), cause });
|
50
|
|
}
|
51
|
|
|
52
|
0
|
public static String unableToAddField(String fieldName, CtClass ctClass, Throwable cause)
|
53
|
|
{
|
54
|
0
|
return _formatter.format("unable-to-add-field", fieldName, ctClass.getName(), cause);
|
55
|
|
}
|
56
|
|
|
57
|
1
|
public static String unableToAddMethod(MethodSignature methodSignature, CtClass ctClass,
|
58
|
|
Throwable cause)
|
59
|
|
{
|
60
|
1
|
return _formatter.format("unable-to-add-method", methodSignature, ctClass.getName(), cause);
|
61
|
|
}
|
62
|
|
|
63
|
1
|
public static String unableToAddConstructor(CtClass ctClass, Throwable cause)
|
64
|
|
{
|
65
|
1
|
return _formatter.format("unable-to-add-constructor", ctClass.getName(), cause);
|
66
|
|
}
|
67
|
|
|
68
|
3
|
public static String unableToWriteClass(CtClass ctClass, Throwable cause)
|
69
|
|
{
|
70
|
3
|
return _formatter.format("unable-to-write-class", ctClass.getName(), cause);
|
71
|
|
}
|
72
|
|
|
73
|
0
|
public static String unableToCreateClass(String name, Class superClass, Throwable cause)
|
74
|
|
{
|
75
|
0
|
return _formatter.format("unable-to-create-class", name, superClass.getName(), cause);
|
76
|
|
}
|
77
|
|
|
78
|
0
|
public static String unableToLookupClass(String name, Throwable cause)
|
79
|
|
{
|
80
|
0
|
return _formatter.format("unable-to-lookup", name, cause);
|
81
|
|
}
|
82
|
|
|
83
|
1
|
public static String notCompatibleWithEvent(Object consumer, EventSetDescriptor set,
|
84
|
|
Object producer)
|
85
|
|
{
|
86
|
1
|
return _formatter.format("not-compatible-with-event", new Object[]
|
87
|
|
{ consumer, set.getListenerType().getName(), set.getName(), producer });
|
88
|
|
}
|
89
|
|
|
90
|
1
|
public static String noSuchEventSet(Object producer, String name)
|
91
|
|
{
|
92
|
1
|
return _formatter.format("no-such-event-set", producer, name);
|
93
|
|
}
|
94
|
|
|
95
|
2
|
public static String noEventMatches(Object consumer, Object producer)
|
96
|
|
{
|
97
|
2
|
return _formatter.format("no-event-matches", consumer, producer);
|
98
|
|
}
|
99
|
|
|
100
|
0
|
public static String unableToAddListener(Object producer, EventSetDescriptor set,
|
101
|
|
Object consumer, Location location, Throwable cause)
|
102
|
|
{
|
103
|
0
|
return _formatter.format("unable-to-add-listener", new Object[]
|
104
|
|
{ consumer, producer, set.getName(), location, cause });
|
105
|
|
}
|
106
|
|
|
107
|
0
|
public static String unableToIntrospectClass(Class targetClass, Throwable cause)
|
108
|
|
{
|
109
|
0
|
return _formatter.format("unable-to-introspect-class", targetClass.getName(), cause);
|
110
|
|
}
|
111
|
|
|
112
|
1
|
public static String unableToAddCatch(Class exceptionClass, CtMethod method, Throwable cause)
|
113
|
|
{
|
114
|
1
|
return _formatter.format("unable-to-add-catch", exceptionClass.getName(), method
|
115
|
|
.getDeclaringClass().getName(), cause);
|
116
|
|
}
|
117
|
|
|
118
|
1
|
public static String duplicateMethodInClass(MethodSignature ms, ClassFabImpl cf)
|
119
|
|
{
|
120
|
1
|
return _formatter.format("duplicate-method-in-class", ms, cf.getName());
|
121
|
|
}
|
122
|
|
|
123
|
1
|
public static String unableToExtendMethod(MethodSignature ms, String className, Throwable cause)
|
124
|
|
{
|
125
|
1
|
return _formatter.format("unable-to-extend-method", ms, className, cause);
|
126
|
|
}
|
127
|
|
|
128
|
1
|
public static String invalidProviderSelector(String selector)
|
129
|
|
{
|
130
|
1
|
return _formatter.format("invalid-provider-selector", selector);
|
131
|
|
}
|
132
|
|
|
133
|
1
|
public static String unknownProviderPrefix(String prefix)
|
134
|
|
{
|
135
|
1
|
return _formatter.format("unknown-provider-prefix", prefix);
|
136
|
|
}
|
137
|
|
|
138
|
0
|
public static String duplicateProviderPrefix(String prefix, Location priorLocation)
|
139
|
|
{
|
140
|
0
|
return _formatter.format("duplicate-provider-prefix", prefix, priorLocation);
|
141
|
|
}
|
142
|
|
|
143
|
2
|
public static String invalidServicePropertyLocator(String locator)
|
144
|
|
{
|
145
|
2
|
return _formatter.format("invalid-service-property-locator", locator);
|
146
|
|
}
|
147
|
|
|
148
|
1
|
public static String failureBuildingService(String serviceId, Throwable cause)
|
149
|
|
{
|
150
|
1
|
return _formatter.format("failure-building-service", serviceId, cause);
|
151
|
|
}
|
152
|
|
|
153
|
2
|
public static String autowirePropertyFailure(String propertyName, String serviceId,
|
154
|
|
Throwable cause)
|
155
|
|
{
|
156
|
2
|
return _formatter.format("autowire-property-failure", propertyName, serviceId, cause);
|
157
|
|
}
|
158
|
|
|
159
|
1
|
public static String unableToFindAutowireConstructor()
|
160
|
|
{
|
161
|
1
|
return _formatter.getMessage("unable-to-find-autowire-constructor");
|
162
|
|
}
|
163
|
|
|
164
|
|
|
165
|
1
|
public static String unableToCreateInterface(String name, Exception cause)
|
166
|
|
{
|
167
|
1
|
return _formatter.format("unable-to-create-interface", name, cause);
|
168
|
|
}
|
169
|
|
}
|