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

AWS S3: add methods for the new actors API #2211

Merged
merged 2 commits into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions s3/src/main/mima-filters/2.0.0-M3.backwards.excludes
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# MiMa upgrade
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.alpakka.s3.S3Settings.this")

# override of apply in extension with the concrete type instead of the generic type
ProblemFilters.exclude[IncompatibleResultTypeProblem]("akka.stream.alpakka.s3.S3Ext.apply")
27 changes: 24 additions & 3 deletions s3/src/main/scala/akka/stream/alpakka/s3/S3Ext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

package akka.stream.alpakka.s3
import akka.actor.{ActorSystem, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider}
import akka.actor.{ClassicActorSystemProvider, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider}

/**
* Manages one [[S3Settings]] per `ActorSystem`.
Expand All @@ -18,6 +18,27 @@ object S3Ext extends ExtensionId[S3Ext] with ExtensionIdProvider {
override def lookup = S3Ext
override def createExtension(system: ExtendedActorSystem) = new S3Ext(system)

/** Java API */
override def get(system: ActorSystem): S3Ext = super.get(system)
/**
* Get the S3 extension with the classic actors API.
*/
override def apply(system: akka.actor.ActorSystem): S3Ext = super.apply(system)

// This is not source compatible with Akka 2.6 as it lacks `overrride`
/**
* Get the S3 extension with the new actors API.
*/
def apply(system: ClassicActorSystemProvider): S3Ext = super.apply(system.classicSystem)

/**
* Java API.
* Get the S3 extension with the classic actors API.
*/
override def get(system: akka.actor.ActorSystem): S3Ext = super.apply(system)

// This is not source compatible with Akka 2.6 as it lacks `overrride`
/**
* Java API.
* Get the S3 extension with the new actors API.
*/
def get(system: ClassicActorSystemProvider): S3Ext = super.apply(system.classicSystem)
}