1 57 58 59 package org.apache.wsif.providers.jca; 60 61 import java.text.MessageFormat ; 62 import java.util.HashMap ; 63 import java.util.Locale ; 64 import java.util.MissingResourceException ; 65 import java.util.ResourceBundle ; 66 67 74 public class WSIFResource_JCA { 75 76 private static final long serialVersionUID = 1L; 77 private static ResourceBundle messages = ResourceBundle.getBundle("org.apache.wsif.providers.jca.WSIFResource_JCA", Locale.getDefault()); 78 private static HashMap defaultMessages = new HashMap (); 79 80 static { 82 defaultMessages.put("WSIF1000E", "WSIF1000E: ResourceException thrown during execution of the interaction, check target exception for details."); 83 defaultMessages.put("WSIF1001E", "WSIF1001E: Could not instantiate Format Handler."); 84 defaultMessages.put("WSIF1002E", "WSIF1002E: Exception thrown during instantiation of the format handler."); 85 defaultMessages.put("WSIF1003E", "WSIF1003E: Exception thrown during execute method of the Interaction, check target exception for details."); 86 defaultMessages.put("WSIF1004E", "WSIF1004E: Exception thrown in WSIFMessage_JCAStreamable read method."); 87 defaultMessages.put("WSIF1005E", "WSIF1005E: Exception thrown in WSIFMessage_JCAStreamable write method."); 88 defaultMessages.put("WSIF1006E", "WSIF1006E: Exception thrown in the initialization of the Service SessionBean."); 89 defaultMessages.put("WSIF1007E", "WSIF1007E: Exception thrown in getObjectPart() method."); 90 defaultMessages.put("WSIF1008E", "WSIF1008E: Exception thrown during execution of the interaction, check target exception for details."); 91 defaultMessages.put("WSIF1009E", "UNKNOWN MESSAGE"); 92 } 93 94 private WSIFResource_JCA() { 95 super(); 96 } 97 98 101 public static String get(String key) { 102 try { 103 if (key != null && messages != null) 104 return messages.getString(key); 105 } 106 catch (MissingResourceException exn) { 107 return ((String ) WSIFResource_JCA.defaultMessages.get(key)); 108 } 109 return null; 110 } 111 112 115 public static String get(String key, Object arg) { 116 return get(key, new Object [] { arg }); 117 } 118 119 122 public static String get(String key, Object arg1, Object arg2) { 123 return get(key, new Object [] { arg1, arg2 }); 124 } 125 126 129 public static String get(String key, Object arg1, Object arg2, Object arg3) { 130 return get(key, new Object [] { arg1, arg2, arg3 }); 131 } 132 133 136 public static String get(String key, Object arg1, Object arg2, Object arg3, Object arg4) { 137 return get(key, new Object [] { arg1, arg2, arg3, arg4 }); 138 } 139 140 143 public static String get(String key, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) { 144 return get(key, new Object [] { arg1, arg2, arg3, arg4, arg5 }); 145 } 146 147 150 public static String get(String key, Object [] args) { 151 String text = get(key); 152 if (text == null) { 153 text = (String ) WSIFResource_JCA.defaultMessages.get(key); 154 } 155 if (text == null) { 156 return null; 157 } 158 return MessageFormat.format(text, args); 159 } 160 161 } | Popular Tags |