当前位置: 首页>>代码示例>>Scala>>正文


Scala LagomKafkaComponents类代码示例

本文整理汇总了Scala中com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents的典型用法代码示例。如果您正苦于以下问题:Scala LagomKafkaComponents类的具体用法?Scala LagomKafkaComponents怎么用?Scala LagomKafkaComponents使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LagomKafkaComponents类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Scala代码示例。

示例1: HelloLoader

//设置package包名称以及导入依赖的类
package sample.helloworld.impl


import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import com.softwaremill.macwire._
import play.api.libs.ws.ahc.AhcWSComponents
import sample.helloworld.api.HelloService

class HelloLoader extends LagomApplicationLoader {

  override def load(context: LagomApplicationContext): LagomApplication =
    new HelloApplication(context) {
      override def serviceLocator: ServiceLocator = NoServiceLocator
    }

  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new HelloApplication(context) with LagomDevModeComponents
}

abstract class HelloApplication(context: LagomApplicationContext) extends HelloComponents(context)
    with LagomKafkaComponents
    {

}

abstract class HelloComponents(context: LagomApplicationContext) extends LagomApplication(context)
  with CassandraPersistenceComponents
with AhcWSComponents{


  // Bind the services that this server provides
  override lazy val lagomServer = LagomServer.forServices(
    bindService[HelloService].to(wire[HelloServiceImpl])
  )

  // Register the JSON serializer registry
  override lazy val jsonSerializerRegistry = HelloSerializerRegistry

  // Register the Hello persistent entity
  persistentEntityRegistry.register(wire[HelloEntity])
} 
开发者ID:knoldus,项目名称:lagom-scala-wordcount.g8,代码行数:47,代码来源:HelloLoader.scala

示例2: HelloConsumerLoader

//设置package包名称以及导入依赖的类
package sample.helloworldconsumer.impl

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server.{LagomApplication, LagomApplicationContext, LagomApplicationLoader, LagomServer}
import com.softwaremill.macwire._
import play.api.libs.ws.ahc.AhcWSComponents
import sample.helloworld.api.HelloService
import sample.helloworldconsumer.api.HelloConsumerService
import sample.helloworldconsumer.impl.repositories.MessageRepository

class HelloConsumerLoader extends LagomApplicationLoader {

  override def load(context: LagomApplicationContext): LagomApplication =
    new HelloConsumerApplication(context) {
      override def serviceLocator: ServiceLocator = NoServiceLocator
    }

  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new HelloConsumerApplication(context) with LagomDevModeComponents
}

abstract class HelloConsumerApplication(context: LagomApplicationContext)
  extends LagomApplication(context)
    with CassandraPersistenceComponents
    with LagomKafkaComponents
    with AhcWSComponents {

  // Bind the services that this server provides
  override lazy val lagomServer = LagomServer.forServices(
    bindService[HelloConsumerService].to(wire[HelloConsumerServiceImpl])
  )

  //Bind the HelloService client
  lazy val helloService = serviceClient.implement[HelloService]

  lazy val messageRepository = wire[MessageRepository]

  // Register the JSON serializer registry
  override lazy val jsonSerializerRegistry = HelloConsumerSerializerRegistry

  // Register the Message persistent entity
   persistentEntityRegistry.register(wire[MessageEntity])

  readSide.register(wire[MessageEventProcessor])
} 
开发者ID:knoldus,项目名称:lagom-scala-wordcount.g8,代码行数:50,代码来源:HelloConsumerLoader.scala

示例3: AccountLoader

//设置package包名称以及导入依赖的类
package org.ioreskovic.greatmaterialcontinuum.impl

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import com.softwaremill.macwire._
import org.ioreskovic.greatmaterialcontinuum.api.AccountService
import org.ioreskovic.greatmaterialcontinuum.impl.ent.acc.{AccountEntity, AccountSerializerRegistry}
import play.api.libs.ws.ahc.AhcWSComponents

class AccountLoader extends LagomApplicationLoader {

  override def load(context: LagomApplicationContext): LagomApplication =
    new AccountApplication(context) {
      override def serviceLocator: ServiceLocator = NoServiceLocator
    }

  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new AccountApplication(context) with LagomDevModeComponents

  override def describeServices = List(
    readDescriptor[AccountService]
  )
}

abstract class AccountApplication(context: LagomApplicationContext)
  extends LagomApplication(context)
    with CassandraPersistenceComponents
    with LagomKafkaComponents
    with AhcWSComponents {

  // Bind the service that this server provides
  override lazy val lagomServer = serverFor[AccountService](wire[AccountServiceImpl])

  // Register the JSON serializer registry
  override lazy val jsonSerializerRegistry = AccountSerializerRegistry

  // Register the great-material-continuum persistent entity
  persistentEntityRegistry.register(wire[AccountEntity])
} 
开发者ID:ioreskovic,项目名称:great-material-continuum,代码行数:44,代码来源:AccountLoader.scala

示例4: BasketApplication

//设置package包名称以及导入依赖的类
package demo.impl.basket

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
import com.lightbend.lagom.scaladsl.server._
import com.softwaremill.macwire._
import demo.api.basket.{Basket, BasketService}
import play.api.libs.ws.ahc.AhcWSComponents

import scala.collection.immutable.Seq

abstract class BasketApplication(ctx: LagomApplicationContext) extends LagomApplication(ctx)
  with AhcWSComponents
  with LagomKafkaComponents
  with CassandraPersistenceComponents {
  override def lagomServer: LagomServer = LagomServer.forServices {
    bindService[BasketService].to(wire[BasketServiceImpl])
  }

  persistentEntityRegistry.register(wire[BasketEntity])
}

class BasketApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new BasketApplication(context) with LagomDevModeComponents {
      override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
    }

  override def load(context: LagomApplicationContext): LagomApplication = new BasketApplication(context) {
    override def serviceLocator: ServiceLocator = NoServiceLocator
    override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
  }
}

object BasketSerializerRegistry extends JsonSerializerRegistry {
  import BasketEntityFormats._
  override def serializers: Seq[JsonSerializer[_]] = Seq (
    JsonSerializer[AddItem],
    JsonSerializer[GetBasket.type],
    JsonSerializer[GetTotal.type],
    JsonSerializer[ClearAll.type],
    JsonSerializer[BasketCleared.type],
    JsonSerializer[ItemAdded],
    JsonSerializer[BasketEntityState],
    JsonSerializer[Basket],
    JsonSerializer[OrderPlaced],
    JsonSerializer[PlaceOrder.type],
    JsonSerializer[Basket]
  )
} 
开发者ID:tommpy,项目名称:demo-lagom-checkout,代码行数:55,代码来源:BasketApplication.scala

示例5: OrderApplication

//设置package包名称以及导入依赖的类
package demo.impl.order

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
import com.lightbend.lagom.scaladsl.server._
import com.softwaremill.macwire.wire
import demo.api.basket.BasketService
import demo.api.order.OrderService
import play.api.libs.ws.ahc.AhcWSComponents

import scala.collection.immutable.Seq

abstract class OrderApplication(ctx: LagomApplicationContext) extends LagomApplication(ctx)
  with AhcWSComponents
  with CassandraPersistenceComponents
  with LagomKafkaComponents {
  override def lagomServer: LagomServer = LagomServer.forServices {
    bindService[OrderService].to(wire[OrderServiceImpl])
  }

  lazy val basketService: BasketService = serviceClient.implement[BasketService]

  persistentEntityRegistry.register(wire[Order])

  wire[BasketServiceSubscriber]
}

class OrderApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication = {
    new OrderApplication(context) with LagomDevModeComponents {
      override def jsonSerializerRegistry: JsonSerializerRegistry = OrderSerializerRegistry
    }
  }

  override def load(context: LagomApplicationContext): LagomApplication = {
    new OrderApplication(context) {
      override def serviceLocator: ServiceLocator = NoServiceLocator
      override def jsonSerializerRegistry: JsonSerializerRegistry = OrderSerializerRegistry
    }
  }
}

object OrderSerializerRegistry extends JsonSerializerRegistry {
  import OrderEntityFormats._
  override def serializers: Seq[JsonSerializer[_]] = {
    Seq(JsonSerializer[OrderInitialized],
      JsonSerializer[OrderState],
      JsonSerializer[CreateOrder],
      JsonSerializer[GetOrder.type],
      JsonSerializer[OrderItems])
  }
} 
开发者ID:tommpy,项目名称:demo-lagom-checkout,代码行数:57,代码来源:OrderApplication.scala

示例6: BasketApplication

//设置package包名称以及导入依赖的类
package demo.impl.basket

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
import com.lightbend.lagom.scaladsl.server._
import com.softwaremill.macwire._
import demo.api.basket.{Basket, BasketService}
import play.api.libs.ws.ahc.AhcWSComponents

import scala.collection.immutable.Seq

abstract class BasketApplication(ctx: LagomApplicationContext) extends LagomApplication(ctx)
  with AhcWSComponents
  with LagomKafkaComponents
  with CassandraPersistenceComponents {
  override def lagomServer: LagomServer = LagomServer.forServices {
    bindService[BasketService].to(wire[BasketServiceImpl])
  }


  persistentEntityRegistry.register(wire[BasketEntity])
}

class BasketApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new BasketApplication(context) with LagomDevModeComponents {
      override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
    }

  override def load(context: LagomApplicationContext): LagomApplication = new BasketApplication(context) {
    override def serviceLocator: ServiceLocator = NoServiceLocator
    override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
  }
}

object BasketSerializerRegistry extends JsonSerializerRegistry {
  import BasketEntityFormats._
  override def serializers: Seq[JsonSerializer[_]] = Seq (
    JsonSerializer[AddItem],
    JsonSerializer[GetBasket.type],
    JsonSerializer[GetTotal.type],
    JsonSerializer[ClearAll.type],
    JsonSerializer[BasketCleared.type],
    JsonSerializer[ItemAdded],
    JsonSerializer[BasketEntityState],
    JsonSerializer[Basket],
    JsonSerializer[OrderPlaced],
    JsonSerializer[PlaceOrder.type],
    JsonSerializer[Basket]
  )
} 
开发者ID:tommpy,项目名称:demo-lagom-checkout,代码行数:56,代码来源:BasketApplication.scala

示例7: BasketApplication

//设置package包名称以及导入依赖的类
package demo.impl.basket

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
import com.lightbend.lagom.scaladsl.server._
import demo.api.basket.{Basket, BasketService, Item}
import play.api.libs.ws.ahc.AhcWSComponents
import com.softwaremill.macwire._

import scala.collection.immutable.Seq

abstract class BasketApplication(ctx: LagomApplicationContext) extends LagomApplication(ctx)
  with AhcWSComponents
  with LagomKafkaComponents
  with CassandraPersistenceComponents {
  override def lagomServer: LagomServer = LagomServer.forServices {
    bindService[BasketService].to(wire[BasketServiceImpl])
  }

  persistentEntityRegistry.register(wire[BasketEntity])
}

class BasketApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new BasketApplication(context) with LagomDevModeComponents {
      override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
    }

  override def load(context: LagomApplicationContext): LagomApplication = new BasketApplication(context) {
    override def serviceLocator: ServiceLocator = NoServiceLocator
    override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
  }
}

object BasketSerializerRegistry extends JsonSerializerRegistry {
  import BasketEntityFormats._
  override def serializers: Seq[JsonSerializer[_]] = Seq (
    JsonSerializer[AddItem],
    JsonSerializer[GetBasket.type],
    JsonSerializer[GetTotal.type],
    JsonSerializer[ItemAdded],
    JsonSerializer[BasketEntityState],
    JsonSerializer[Basket]
  )
} 
开发者ID:tommpy,项目名称:demo-lagom-checkout,代码行数:50,代码来源:BasketApplication.scala

示例8: BasketApplication

//设置package包名称以及导入依赖的类
package demo.impl.basket

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
import com.lightbend.lagom.scaladsl.server._
import demo.api.basket.{BasketService, Item}
import play.api.libs.ws.ahc.AhcWSComponents
import com.softwaremill.macwire._

import scala.collection.immutable.Seq

abstract class BasketApplication(ctx: LagomApplicationContext) extends LagomApplication(ctx)
  with AhcWSComponents
  with LagomKafkaComponents
  with CassandraPersistenceComponents {
  override def lagomServer: LagomServer = LagomServer.forServices {
    bindService[BasketService].to(wire[BasketServiceImpl])
  }
}

class BasketApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new BasketApplication(context) with LagomDevModeComponents {
      override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
    }

  override def load(context: LagomApplicationContext): LagomApplication = new BasketApplication(context) {
    override def serviceLocator: ServiceLocator = NoServiceLocator
    override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
  }
}

object BasketSerializerRegistry extends JsonSerializerRegistry {
  override def serializers: Seq[JsonSerializer[_]] = Seq (
  )
} 
开发者ID:tommpy,项目名称:demo-lagom-checkout,代码行数:41,代码来源:BasketApplication.scala

示例9: BasketApplication

//设置package包名称以及导入依赖的类
package demo.impl.basket

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
import com.lightbend.lagom.scaladsl.server._
import demo.api.basket.{Basket, BasketService, Item}
import play.api.libs.ws.ahc.AhcWSComponents
import com.softwaremill.macwire._

import scala.collection.immutable.Seq

abstract class BasketApplication(ctx: LagomApplicationContext) extends LagomApplication(ctx)
  with AhcWSComponents
  with LagomKafkaComponents
  with CassandraPersistenceComponents {
  override def lagomServer: LagomServer = LagomServer.forServices {
    bindService[BasketService].to(wire[BasketServiceImpl])
  }

  persistentEntityRegistry.register(wire[BasketEntity])
}

class BasketApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new BasketApplication(context) with LagomDevModeComponents {
      override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
    }

  override def load(context: LagomApplicationContext): LagomApplication = new BasketApplication(context) {
    override def serviceLocator: ServiceLocator = NoServiceLocator
    override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
  }
}

object BasketSerializerRegistry extends JsonSerializerRegistry {
  import BasketEntityFormats._
  override def serializers: Seq[JsonSerializer[_]] = Seq (
    JsonSerializer[AddItem],
    JsonSerializer[GetBasket.type],
    JsonSerializer[ItemAdded],
    JsonSerializer[BasketEntityState],
    JsonSerializer[Basket]
  )
} 
开发者ID:tommpy,项目名称:demo-lagom-checkout,代码行数:49,代码来源:BasketApplication.scala

示例10: BasketApplication

//设置package包名称以及导入依赖的类
package demo.impl.basket

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
import com.lightbend.lagom.scaladsl.server._
import demo.api.basket.{BasketService}
import play.api.libs.ws.ahc.AhcWSComponents
import com.softwaremill.macwire._

import scala.collection.immutable.Seq

abstract class BasketApplication(ctx: LagomApplicationContext) extends LagomApplication(ctx)
  with AhcWSComponents
  with LagomKafkaComponents
  with CassandraPersistenceComponents {
  override def lagomServer: LagomServer = LagomServer.forServices {
    ???
    //bindService[BasketService].to(wire[BasketServiceImpl])
  }
}

class BasketApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new BasketApplication(context) with LagomDevModeComponents {
      override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
    }

  override def load(context: LagomApplicationContext): LagomApplication = new BasketApplication(context) {
    override def serviceLocator: ServiceLocator = NoServiceLocator
    override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
  }
}

object BasketSerializerRegistry extends JsonSerializerRegistry {
  override def serializers: Seq[JsonSerializer[_]] = Seq (
  )
} 
开发者ID:tommpy,项目名称:demo-lagom-checkout,代码行数:42,代码来源:BasketApplication.scala

示例11: BasketApplication

//设置package包名称以及导入依赖的类
package demo.impl.basket

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
import com.lightbend.lagom.scaladsl.server._
import com.softwaremill.macwire._
import demo.api.basket.{Basket, BasketService}
import play.api.libs.ws.ahc.AhcWSComponents

import scala.collection.immutable.Seq

abstract class BasketApplication(ctx: LagomApplicationContext) extends LagomApplication(ctx)
  with AhcWSComponents
  with LagomKafkaComponents
  with CassandraPersistenceComponents {
  override def lagomServer: LagomServer = LagomServer.forServices {
    bindService[BasketService].to(wire[BasketServiceImpl])
  }

  persistentEntityRegistry.register(wire[BasketEntity])
}

class BasketApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new BasketApplication(context) with LagomDevModeComponents {
      override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
    }

  override def load(context: LagomApplicationContext): LagomApplication = new BasketApplication(context) {
    override def serviceLocator: ServiceLocator = NoServiceLocator
    override def jsonSerializerRegistry: JsonSerializerRegistry = BasketSerializerRegistry
  }
}

object BasketSerializerRegistry extends JsonSerializerRegistry {
  import BasketEntityFormats._
  override def serializers: Seq[JsonSerializer[_]] = Seq (
    JsonSerializer[AddItem],
    JsonSerializer[GetBasket.type],
    JsonSerializer[GetTotal.type],
    JsonSerializer[ClearAll.type],
    JsonSerializer[BasketCleared.type],
    JsonSerializer[ItemAdded],
    JsonSerializer[BasketEntityState],
    JsonSerializer[Basket]
  )
} 
开发者ID:tommpy,项目名称:demo-lagom-checkout,代码行数:52,代码来源:BasketApplication.scala

示例12: BiddingApplication

//设置package包名称以及导入依赖的类
package com.example.auction.bidding.impl

import com.example.auction.bidding.api.BiddingService
import com.example.auction.item.api.ItemService
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import com.softwaremill.macwire._
import com.typesafe.conductr.bundlelib.lagom.scaladsl.ConductRApplicationComponents
import play.api.libs.ws.ahc.AhcWSComponents

abstract class BiddingApplication(context: LagomApplicationContext) extends LagomApplication(context)
  with AhcWSComponents
  with CassandraPersistenceComponents
  with LagomKafkaComponents {

  lazy val itemService = serviceClient.implement[ItemService]
  override lazy val lagomServer = serverFor[BiddingService](wire[BiddingServiceImpl])
  override lazy val jsonSerializerRegistry = BiddingSerializerRegistry

  // Initialise everything
  persistentEntityRegistry.register(wire[AuctionEntity])
  readSide.register(wire[AuctionSchedulerProcessor])
  wire[AuctionScheduler]
  wire[ItemServiceSubscriber]
}

class BiddingApplicationLoader extends LagomApplicationLoader {
  override def load(context: LagomApplicationContext) =
    new BiddingApplication(context) with ConductRApplicationComponents

  override def loadDevMode(context: LagomApplicationContext) =
    new BiddingApplication(context) with LagomDevModeComponents

  override def describeService = Some(readDescriptor[BiddingService])
} 
开发者ID:lagom,项目名称:online-auction-scala,代码行数:38,代码来源:BiddingServiceLoader.scala

示例13: executionContext

//设置package包名称以及导入依赖的类
package com.example.auction.item.impl

import com.example.auction.bidding.api.BiddingService
import com.example.auction.item.api.ItemService
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import com.softwaremill.macwire._
import com.typesafe.conductr.bundlelib.lagom.scaladsl.ConductRApplicationComponents
import play.api.Environment
import play.api.libs.ws.ahc.AhcWSComponents

import scala.concurrent.ExecutionContext

trait ItemComponents extends LagomServerComponents
  with CassandraPersistenceComponents {

  implicit def executionContext: ExecutionContext
  def environment: Environment

  override lazy val lagomServer = serverFor[ItemService](wire[ItemServiceImpl])
  lazy val itemRepository = wire[ItemRepository]
  lazy val jsonSerializerRegistry = ItemSerializerRegistry

  persistentEntityRegistry.register(wire[ItemEntity])
  readSide.register(wire[ItemEventProcessor])
}

abstract class ItemApplication(context: LagomApplicationContext) extends LagomApplication(context)
  with ItemComponents
  with AhcWSComponents
  with LagomKafkaComponents {

  lazy val biddingService = serviceClient.implement[BiddingService]

  wire[BiddingServiceSubscriber]
}

class ItemApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new ItemApplication(context) with LagomDevModeComponents

  override def load(context: LagomApplicationContext): LagomApplication =
    new ItemApplication(context) with ConductRApplicationComponents

  override def describeService = Some(readDescriptor[ItemService])
} 
开发者ID:lagom,项目名称:online-auction-scala,代码行数:49,代码来源:ItemApplication.scala

示例14: AddServiceLoader

//设置package包名称以及导入依赖的类
package com.orion.add.impl

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import com.orion.add.api.AddService
import com.softwaremill.macwire._
import play.api.libs.ws.ahc.AhcWSComponents


class AddServiceLoader extends LagomApplicationLoader{
  override def load(context: LagomApplicationContext): LagomApplication =
    new AddApplication(context) {
      override def serviceLocator: ServiceLocator = NoServiceLocator
    }

  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new AddApplication(context) with LagomDevModeComponents

  override def describeServices = List(
    readDescriptor[AddService]
  )
}

abstract class AddApplication(context: LagomApplicationContext)
  extends LagomApplication(context)
  with CassandraPersistenceComponents
  with LagomKafkaComponents
  with AhcWSComponents {

  override lazy val lagomServer = serverFor[AddService](wire[AddServiceImpl])
  override lazy val jsonSerializerRegistry = AddSerializerRegistry

  persistentEntityRegistry.register(wire[NumberEntity])
} 
开发者ID:utsavgupta,项目名称:add-lagom,代码行数:39,代码来源:AddServiceLoader.scala

示例15: executionContext

//设置package包名称以及导入依赖的类
package be.yannickdeturck.lagomshopscala.item.impl

import be.yannickdeturck.lagomshopscala.item.api.ItemService
import com.lightbend.lagom.internal.client.CircuitBreakerMetricsProviderImpl
import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.pubsub.PubSubComponents
import com.lightbend.lagom.scaladsl.server._
import com.softwaremill.macwire._
import play.api.libs.ws.ahc.AhcWSComponents
import play.api.{Environment, LoggerConfigurator}

import scala.concurrent.ExecutionContext


trait ItemComponents extends LagomServerComponents with CassandraPersistenceComponents with PubSubComponents {
  implicit def executionContext: ExecutionContext

  def environment: Environment

  override lazy val lagomServer: LagomServer = serverFor[ItemService](wire[ItemServiceImpl])
  lazy val itemRepository = wire[ItemRepository]
  override lazy val jsonSerializerRegistry = ItemSerializerRegistry

  persistentEntityRegistry.register(wire[ItemEntity])
  readSide.register(wire[ItemEventProcessor])
}

abstract class ItemApplication(context: LagomApplicationContext) extends LagomApplication(context)
  with ItemComponents
  with AhcWSComponents
  with LagomKafkaComponents {}

class ItemApplicationLoader extends LagomApplicationLoader {
  override def loadDevMode(context: LagomApplicationContext): LagomApplication = {
    // Workaround for logback.xml not being detected, see https://github.com/lagom/lagom/issues/534
    val environment = context.playContext.environment
    LoggerConfigurator(environment.classLoader).foreach {
      _.configure(environment)
    }
    // end workaround
    new ItemApplication(context) with LagomDevModeComponents
  }

  override def load(context: LagomApplicationContext): LagomApplication =
    new ItemApplication(context) {
      override lazy val circuitBreakerMetricsProvider = new CircuitBreakerMetricsProviderImpl(actorSystem)

      override def serviceLocator: ServiceLocator = NoServiceLocator
    }

  override def describeServices = List(
    readDescriptor[ItemService]
  )
} 
开发者ID:yannickdeturck,项目名称:lagom-shop-scala,代码行数:59,代码来源:ItemApplication.scala


注:本文中的com.lightbend.lagom.scaladsl.broker.kafka.LagomKafkaComponents类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。