1 15 package org.apache.hivemind.order; 16 17 import org.apache.hivemind.HiveMind; 18 import org.apache.hivemind.impl.MessageFormatter; 19 import org.apache.hivemind.util.StringUtils; 20 21 26 class OrdererMessages 27 { 28 protected static MessageFormatter _formatter = new MessageFormatter(OrdererMessages.class); 29 30 static String duplicateName(String objectType, String objectName, Object newObject, 31 Object existingObject) 32 { 33 return _formatter.format( 34 "duplicate-name", 35 StringUtils.capitalize(objectType), 36 objectName, 37 HiveMind.getLocationString(existingObject)); 38 } 39 40 static String exception(String objectType, Throwable cause) 41 { 42 return _formatter.format("exception", objectType, cause); 43 } 44 45 static String dupeLeader(String objectType, ObjectOrdering newOrdering, 46 ObjectOrdering existingLeader) 47 { 48 return _formatter.format("dupe-leader", new Object [] 49 { StringUtils.capitalize(objectType), newOrdering.getName(), existingLeader.getName(), 50 HiveMind.getLocationString(existingLeader.getObject()) }); 51 } 52 53 static String dupeTrailer(String objectType, ObjectOrdering newOrdering, 54 ObjectOrdering existingTrailer) 55 { 56 return _formatter.format("dupe-trailer", new Object [] 57 { StringUtils.capitalize(objectType), newOrdering.getName(), existingTrailer.getName(), 58 HiveMind.getLocationString(existingTrailer.getObject()) }); 59 } 60 61 static String dependencyCycle(String objectType, ObjectOrdering trigger, Throwable cause) 62 { 63 return _formatter.format("dependency-cycle", objectType, trigger.getName(), cause); 64 } 65 66 static String badDependency(String objectType, String dependencyName, ObjectOrdering ordering) 67 { 68 return _formatter.format("bad-dependency", objectType, dependencyName, ordering.getName()); 69 70 } 71 72 } | Popular Tags |