Methods Summary |
---|
public static java.lang.String | convertPropsToString(java.util.Properties prop)Helper method to convert properties to string.
if(prop==null){
return "{null}";
}
StringBuffer strBuf = new StringBuffer("{ ");
for(Enumeration enum1 = prop.propertyNames(); enum1.hasMoreElements(); )
{
Object obj = enum1.nextElement();
strBuf.append("[ ").append(obj).append("->");
Object val=prop.getProperty((String)obj);
if(val==null)
strBuf.append("null");
else
strBuf.append((String)val);
strBuf.append(" ] ");
}
strBuf.append("}");
return strBuf.toString();
|
public static java.lang.String | convertToString(byte[] byteArray)Helper method to convert a byte arror to string. This is typically used for printing Xids.
int i;
StringBuffer strBuf=new StringBuffer();
for(i = 0; i < byteArray.length; i++)
{
strBuf.append(byteArray[i]);
}
return strBuf.toString();
|
public static java.lang.String | convertXidArrayToString(javax.transaction.xa.Xid[] xidArray)Converts an array of xids to string that can be printed. Its a helper method.
if(xidArray.length != 0)
{
int i;
StringBuffer strBuf = new StringBuffer("Xid class name is " + xidArray[0].getClass().getName() + " Number of Xids are " + xidArray.length + " [ ");
for(i = 0; i < xidArray.length - 1; i++)
{
strBuf.append(xidArray[i]).append("\n");
}
strBuf.append(xidArray[xidArray.length - 1]).append(" ]");
return strBuf.toString();
}
else
return " null ";
|
public static java.lang.String | getLocalizedMessage(java.util.logging.Logger logger, java.lang.String key)getLocalizedMessage is used to localize the messages being used in
exceptions
try{
ResourceBundle rb = logger.getResourceBundle();
String message = rb.getString(key);
return message;
}catch ( Exception ex){
logger.log(Level.FINE,"JTS:Error while localizing the log message");
return key;
}
|
public static java.lang.String | getLocalizedMessage(java.util.logging.Logger logger, java.lang.String key, java.lang.Object[] args)getLocalizedMessage is used to localize the messages being used in
exceptions with arguments inserted appropriately.
try{
ResourceBundle rb = logger.getResourceBundle();
String message = rb.getString(key);
return MessageFormat.format(message,args);
}catch ( Exception ex){
logger.log(Level.FINE,"JTS:Error while localizing the log message");
return key;
}
|