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
|
1
|
public static String unableToInitializeService(
|
38
|
|
String serviceId,
|
39
|
|
String methodName,
|
40
|
|
Class serviceClass,
|
41
|
|
Throwable ex)
|
42
|
|
{
|
43
|
1
|
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 duplicateSymbol(String symbol, Location priorLocation)
|
98
|
|
{
|
99
|
1
|
return _formatter.format("duplicate-symbol", symbol, priorLocation);
|
100
|
|
}
|
101
|
|
|
102
|
1
|
public static String notCompatibleWithEvent(
|
103
|
|
Object consumer,
|
104
|
|
EventSetDescriptor set,
|
105
|
|
Object producer)
|
106
|
|
{
|
107
|
1
|
return _formatter.format(
|
108
|
|
"not-compatible-with-event",
|
109
|
|
new Object[] { consumer, set.getListenerType().getName(), set.getName(), producer });
|
110
|
|
}
|
111
|
|
|
112
|
1
|
public static String noSuchEventSet(Object producer, String name)
|
113
|
|
{
|
114
|
1
|
return _formatter.format("no-such-event-set", producer, name);
|
115
|
|
}
|
116
|
|
|
117
|
2
|
public static String noEventMatches(Object consumer, Object producer)
|
118
|
|
{
|
119
|
2
|
return _formatter.format("no-event-matches", consumer, producer);
|
120
|
|
}
|
121
|
|
|
122
|
0
|
public static String unableToAddListener(
|
123
|
|
Object producer,
|
124
|
|
EventSetDescriptor set,
|
125
|
|
Object consumer,
|
126
|
|
Location location,
|
127
|
|
Throwable cause)
|
128
|
|
{
|
129
|
0
|
return _formatter.format(
|
130
|
|
"unable-to-add-listener",
|
131
|
|
new Object[] { consumer, producer, set.getName(), location, cause });
|
132
|
|
}
|
133
|
|
|
134
|
0
|
public static String unableToIntrospectClass(Class targetClass, Throwable cause)
|
135
|
|
{
|
136
|
0
|
return _formatter.format("unable-to-introspect-class", targetClass.getName(), cause);
|
137
|
|
}
|
138
|
|
|
139
|
1
|
public static String unableToAddCatch(Class exceptionClass, CtMethod method, Throwable cause)
|
140
|
|
{
|
141
|
1
|
return _formatter.format(
|
142
|
|
"unable-to-add-catch",
|
143
|
|
exceptionClass.getName(),
|
144
|
|
method.getDeclaringClass().getName(),
|
145
|
|
cause);
|
146
|
|
}
|
147
|
|
|
148
|
1
|
public static String duplicateMethodInClass(MethodSignature ms, ClassFabImpl cf)
|
149
|
|
{
|
150
|
1
|
return _formatter.format("duplicate-method-in-class", ms, cf.getName());
|
151
|
|
}
|
152
|
|
|
153
|
1
|
public static String unableToExtendMethod(
|
154
|
|
MethodSignature ms,
|
155
|
|
String className,
|
156
|
|
Throwable cause)
|
157
|
|
{
|
158
|
1
|
return _formatter.format("unable-to-extend-method", ms, className, cause);
|
159
|
|
}
|
160
|
|
}
|
161
|
|
|