Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump org.wildfly.common:wildfly-common from 1.6.0.Final to 1.7.0.Final #187

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<groupId>org.wildfly.transaction</groupId>
<artifactId>wildfly-transaction-client</artifactId>
<version>3.0.2.Final-SNAPSHOT</version>
<version>3.0.4.Final-SNAPSHOT</version>
<name>WildFly Transaction Client</name>
<description>Client library for applications using transactions with Wildfly - Jakarta EE Variant</description>

Expand All @@ -55,7 +55,7 @@
<version.org.jboss.remoting>5.0.27.Final</version.org.jboss.remoting>
<version.org.jboss.xnio>3.8.10.Final</version.org.jboss.xnio>
<version.org.kohsuke.metainf-services>1.11</version.org.kohsuke.metainf-services>
<version.org.wildfly.common>1.6.0.Final</version.org.wildfly.common>
<version.org.wildfly.common>1.7.0.Final</version.org.wildfly.common>
<version.org.wildfly.elytron>2.2.2.Final</version.org.wildfly.elytron>
<version.org.wildfly.naming-client>2.0.1.Final</version.org.wildfly.naming-client>
<version.bridger>1.6.Final</version.bridger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@ class TxnNamingContext extends AbstractContext {
private final ProviderEnvironment providerEnvironment;
private final RemoteUserTransaction remoteUserTransaction;

TxnNamingContext(final NamingProvider namingProvider, final ProviderEnvironment providerEnvironment) {
private final TxnNamingContextFactory.AccessChecker accessChecker;

TxnNamingContext(final NamingProvider namingProvider, final ProviderEnvironment providerEnvironment, final TxnNamingContextFactory.AccessChecker accessChecker) {
this.namingProvider = namingProvider;
this.providerEnvironment = providerEnvironment;
this.accessChecker = accessChecker;
remoteUserTransaction = getRemoteUserTransaction();
}

protected Object lookupNative(final Name name) throws NamingException {
if (accessChecker != null) {
accessChecker.checkAccessAllowed();
}
final String str = name.get(0);
switch (str) {
case USER_TRANSACTION: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,23 @@
*/
@MetaInfServices
public final class TxnNamingContextFactory implements NamingContextFactory {


private static AccessChecker accessChecker = null;

public boolean supportsUriScheme(final NamingProvider namingProvider, final String nameScheme) {
return nameScheme != null && nameScheme.equals("txn");
}

public Context createRootContext(final NamingProvider namingProvider, final String nameScheme, final FastHashtable<String, Object> env, final ProviderEnvironment providerEnvironment) throws NamingException {
return new TxnNamingContext(namingProvider, providerEnvironment);
return new TxnNamingContext(namingProvider, providerEnvironment, accessChecker);
}

public static void setAccessChecker(final AccessChecker accessChecker) {
TxnNamingContextFactory.accessChecker = accessChecker;
}

public interface AccessChecker {
void checkAccessAllowed() throws NamingException;
}
}