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