Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WFLY-2137 Fix circular dependency between security subsystem, jacorb …
…and the transaction subsystem when JTS is enabled
- Loading branch information
1 parent
cab231f
commit c958f6c
Showing
7 changed files
with
106 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
security/subsystem/src/main/java/org/jboss/as/security/TransactionManagerLocatorService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.jboss.as.security; | ||
|
||
import org.jboss.msc.service.Service; | ||
import org.jboss.msc.service.ServiceName; | ||
import org.jboss.msc.service.StartContext; | ||
import org.jboss.msc.service.StartException; | ||
import org.jboss.msc.service.StopContext; | ||
import org.jboss.msc.value.InjectedValue; | ||
import org.jboss.security.plugins.TransactionManagerLocator; | ||
|
||
import javax.transaction.TransactionManager; | ||
|
||
/** | ||
* Service that initializes the TransactionManagerLocator. | ||
* | ||
* Note that even if the transaction manager is not present this service will still be installed, | ||
* so services can depend on it without needing to do a check for the capability. | ||
* | ||
* @author Stuart Douglas | ||
*/ | ||
public class TransactionManagerLocatorService implements Service<Void> { | ||
|
||
public static ServiceName SERVICE_NAME = SecurityExtension.JBOSS_SECURITY.append("transaction-manager-locator"); | ||
|
||
private final InjectedValue<TransactionManager> transactionManagerInjectedValue = new InjectedValue<>(); | ||
|
||
@Override | ||
public void start(StartContext startContext) throws StartException { | ||
TransactionManagerLocator.setTransactionManager(transactionManagerInjectedValue.getValue()); | ||
} | ||
|
||
@Override | ||
public void stop(StopContext stopContext) { | ||
TransactionManagerLocator.setTransactionManager(null); | ||
} | ||
|
||
@Override | ||
public Void getValue() throws IllegalStateException, IllegalArgumentException { | ||
return null; | ||
} | ||
|
||
public InjectedValue<TransactionManager> getTransactionManagerInjectedValue() { | ||
return transactionManagerInjectedValue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters