Skip to content

Commit

Permalink
Disable Unsafe access for RxJavas in fault-tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Oct 8, 2018
1 parent fbef4f5 commit 95c6a78
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fault-tolerance/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
<groupId>org.jboss.shamrock</groupId>
<artifactId>shamrock-fault-tolerance-runtime</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.graalvm</groupId>
<artifactId>graal-annotations</artifactId>
<version>1.0.0-rc4</version>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public void process(ArchiveContext archiveContext, ProcessorContext processorCon

IndexView index = archiveContext.getCombinedIndex();

//Make sure rx.internal.util.unsafe.UnsafeAccess.DISABLED_BY_USER is set.
processorContext.addNativeImageSystemProperty( "rx.unsafe-disable", "true" );

// Add reflective acccess to fallback handlers
Collection<ClassInfo> fallbackHandlers = index.getAllKnownImplementors(DotName.createSimple(FallbackHandler.class.getName()));
for (ClassInfo fallbackHandler : fallbackHandlers) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.jboss.shamrock.faulttolerance.deployment.substitutions.rxjava;

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

@TargetClass(className = "rx.internal.util.unsafe.UnsafeAccess")
public final class UnsafeAccess {

@Substitute
public static boolean isUnsafeAvailable() {
return false;
}

}

0 comments on commit 95c6a78

Please sign in to comment.