Skip to content

Commit

Permalink
Google Cloud Storage: add access with new actors API (#2213)
Browse files Browse the repository at this point in the history
  • Loading branch information
ennru authored Mar 19, 2020
1 parent 6882c98 commit 9f26e38
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ ProblemFilters.exclude[MissingClassProblem]("main.scala.*")
ProblemFilters.exclude[IncompatibleSignatureProblem]("akka.stream.alpakka.googlecloud.storage.StorageObject.*")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.stream.alpakka.googlecloud.storage.StorageObject.withCustomerEncryption")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.stream.alpakka.googlecloud.storage.StorageObject.withOwner")

# override of apply in extension with the concrete type instead of the generic type
ProblemFilters.exclude[IncompatibleResultTypeProblem]("akka.stream.alpakka.googlecloud.storage.GCStorageExt.apply")
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package akka.stream.alpakka.googlecloud.storage

import akka.actor.{ActorSystem, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider}
import akka.actor.{ClassicActorSystemProvider, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider}

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

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

/**
* Get the GCS extension with the new actors API.
*/
def apply(system: ClassicActorSystemProvider): GCStorageExt = super.apply(system.classicSystem)

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

/**
* Java API.
* Get the GCS extension with the new actors API.
*/
def get(system: ClassicActorSystemProvider): GCStorageExt = super.apply(system.classicSystem)
}

0 comments on commit 9f26e38

Please sign in to comment.