KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > service > impl > ServiceMessages


1 // Copyright 2004, 2005 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.service.impl;
16
17 import java.beans.EventSetDescriptor JavaDoc;
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  * Messages for the service.impl package.
29  *
30  * @author Howard Lewis Ship
31  */

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