A wrapper around an existing java:comp/ context that exposes
UserTransaction entry.
Method from org.apache.geronimo.concurrent.impl.handlers.UserTransactionContext Detail: |
protected Context getContext() throws NamingException {
return this.componentContext;
}
|
public static UserTransaction getUserTransaction(Context componentContext) {
try {
return (UserTransaction)componentContext.lookup(USER_TRANSACTION);
} catch (NamingException e) {
return null;
}
}
|
public static boolean hasUserTransaction(Context componentContext) {
UserTransaction userTransaction = getUserTransaction(componentContext);
return (userTransaction != null);
}
|
public NamingEnumeration list(String name) throws NamingException {
if (name == null) {
throw new NullPointerException("name is null");
}
return list(getNameParser(name).parse(name));
}
|
public NamingEnumeration list(Name name) throws NamingException {
if (name == null) {
throw new NullPointerException("name is null");
}
if (name.isEmpty()) {
return list();
}
Object target = null;
try {
target = super.lookup(name);
} catch (NamingException e) {
throw new NotContextException(name.toString());
}
if (target == this) {
return list();
} else if (target instanceof Context) {
return ((Context) target).list("");
} else {
throw new NotContextException("The name " + name + " cannot be listed");
}
}
|
public NamingEnumeration listBindings(String name) throws NamingException {
if (name == null) {
throw new NullPointerException("name is null");
}
return listBindings(getNameParser(name).parse(name));
}
|
public NamingEnumeration listBindings(Name name) throws NamingException {
if (name == null) {
throw new NullPointerException("name is null");
}
if (name.isEmpty()) {
return listBindings();
}
Object target = null;
try {
target = super.lookup(name);
} catch (NamingException e) {
throw new NotContextException(name.toString());
}
if (target == this) {
return listBindings();
} else if (target instanceof Context) {
return ((Context) target).listBindings("");
} else {
throw new NotContextException("The name " + name + " cannot be listed");
}
}
|
public Object lookup(Name name) throws NamingException {
if (name != null && name.size() == 1 && name.get(0).equals(USER_TRANSACTION)) {
return getUserTransaction();
} else {
return super.lookup(name);
}
}
|
public Object lookup(String name) throws NamingException {
if (name != null && name.equals(USER_TRANSACTION)) {
return getUserTransaction();
} else {
return super.lookup(name);
}
}
|