package org.jboss.metadata;
public class MethodAttributes
{
String pattern;
boolean readOnly;
boolean idempotent;
int txTimeout;
public static MethodAttributes kDefaultMethodAttributes;
static
{
kDefaultMethodAttributes = new MethodAttributes();
kDefaultMethodAttributes.pattern = "*";
kDefaultMethodAttributes.readOnly = false;
kDefaultMethodAttributes.idempotent = false;
kDefaultMethodAttributes.txTimeout = 0;
}
public boolean patternMatches(String methodName)
{
int ct, end;
end = pattern.length();
if(end > methodName.length())
return false;
for(ct = 0; ct < end; ct ++)
{
char c = pattern.charAt(ct);
if(c == '*')
return true;
if(c != methodName.charAt(ct))
return false;
}
return ct == methodName.length();
}
public boolean isReadOnly()
{
return readOnly;
}
public boolean isIdempotent()
{
return idempotent;
}
public int getTransactionTimeout()
{
return txTimeout;
}
}