• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Scala CassandraPersistenceComponents类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Lagomneo4jsampleLoader

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

import com.inocybe.lagomneo4jsample.api.Lagomneo4jsampleService
import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
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

class Lagomneo4jsampleLoader extends LagomApplicationLoader {

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

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

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

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

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

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

  // Register the lagom-neo4j-sample persistent entity
  persistentEntityRegistry.register(wire[Lagomneo4jsampleEntity])
} 
开发者ID:botekchristophe,项目名称:lagom-neo4j-sample,代码行数:43,代码来源:Lagomneo4jsampleLoader.scala


示例2: 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


示例3: 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


示例4: LagomhandsondevelopmentLoader

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

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import play.api.libs.ws.ahc.AhcWSComponents
import com.example.lagomhandsondevelopment.api.LagomhandsondevelopmentService
import com.softwaremill.macwire._

class LagomhandsondevelopmentLoader extends LagomApplicationLoader {

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

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

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

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

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

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

  // Register the lagom-hands-on-development persistent entity
  persistentEntityRegistry.register(wire[LagomhandsondevelopmentEntity])
} 
开发者ID:negokaz,项目名称:lagom-hands-on-development.scala,代码行数:43,代码来源:LagomhandsondevelopmentLoader.scala


示例5: 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


示例6: HelloLoader

//设置package包名称以及导入依赖的类
package se.hultner.hello.impl

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import play.api.libs.ws.ahc.AhcWSComponents
import se.hultner.hello.api.HelloService
import com.softwaremill.macwire._

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

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

abstract class HelloApplication(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:Hultner,项目名称:hello_scala_microservices,代码行数:43,代码来源:HelloLoader.scala


示例7: PlayerApplication

//设置package包名称以及导入依赖的类
package com.chriswk.gameranker.player.impl

import com.chriswk.gameranker.player.api.PlayerService
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import play.api.libs.ws.ahc.AhcWSComponents
import com.softwaremill.macwire._

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

  override lazy val lagomServer = LagomServer.forServices(
    bindService[PlayerService].to(wire[PlayerServiceImpl])
  )

  persistentEntityRegistry.register(wire[PlayerEntity])
}

class PlayerApplicationLoader extends LagomApplicationLoader {
  override def load(context: LagomApplicationContext) = new PlayerApplication(context) {
    override def serviceLocator = NoServiceLocator
  }

  override def loadDevMode(context: LagomApplicationContext) =
    new PlayerApplication(context) with LagomDevModeComponents
} 
开发者ID:chriswk,项目名称:gameranker,代码行数:29,代码来源:PlayerApplicationLoader.scala


示例8: LagomshoppingLoader

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

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import play.api.libs.ws.ahc.AhcWSComponents
import com.example.lagomshopping.api.LagomshoppingService
import com.softwaremill.macwire._

class LagomshoppingLoader extends LagomApplicationLoader {

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

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

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

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

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

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

  // Register the LagomShopping persistent entity
  persistentEntityRegistry.register(wire[LagomshoppingEntity])
} 
开发者ID:code-star,项目名称:lagom-playground,代码行数:43,代码来源:LagomshoppingLoader.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 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


示例10: 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


示例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],
    JsonSerializer[OrderPlaced],
    JsonSerializer[PlaceOrder.type],
    JsonSerializer[Basket]
  )
} 
开发者ID:tommpy,项目名称:demo-lagom-checkout,代码行数:56,代码来源:BasketApplication.scala


示例12: 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


示例13: 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


示例14: 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


示例15: 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


示例16: 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


示例17: SsLoader

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

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
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.ss.ss.api.SsService
import play.api.libs.ws.ahc.AhcWSComponents

class SsLoader extends LagomApplicationLoader {

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

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

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

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

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

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

  // Register the ss persistent entity
  persistentEntityRegistry.register(wire[SsEntity])
} 
开发者ID:ytaras,项目名称:iot_lagom_poc,代码行数:43,代码来源:SsLoader.scala


示例18: MappingLoader

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

import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.api.{Descriptor, ServiceLocator}
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 com.ss.mapping.api.MappingService
import org.slf4j.LoggerFactory
import play.api.libs.ws.ahc.AhcWSComponents

import scala.collection.immutable.Seq


class MappingLoader extends LagomApplicationLoader {
  val logger = LoggerFactory.getLogger(getClass)
  override def loadDevMode(context: LagomApplicationContext): LagomApplication =
    new MappingApplication(context) with LagomDevModeComponents

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

  override def describeServices: Seq[Descriptor] = Seq(
    readDescriptor[MappingService]
  )
}

abstract class MappingApplication(context: LagomApplicationContext)
  extends LagomApplication(context)
    with CassandraPersistenceComponents
    with AhcWSComponents {
  override def jsonSerializerRegistry: JsonSerializerRegistry = {
    MappingSerializerRegistry
  }
  override def lagomServer: LagomServer = {
    LagomServer.forServices(
      bindService[MappingService].to(wire[MappingServiceImpl])
    )
  }
  readSide.register(wire[NodeReadEventsProcessor])
}

object MappingSerializerRegistry extends JsonSerializerRegistry {
  override def serializers: Seq[JsonSerializer[_]] = Seq(
    JsonSerializer[RegisterMapping],
    JsonSerializer[MappingRegistered],
    JsonSerializer[LoadMapping.type],
    JsonSerializer[UnregisterMapping.type],
    JsonSerializer[MappingUnregistered.type]
  )
} 
开发者ID:ytaras,项目名称:iot_lagom_poc,代码行数:56,代码来源:MappingLoader.scala


示例19: UserApplication

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

import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.api.ServiceLocator.NoServiceLocator
import com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraPersistenceComponents
import com.lightbend.lagom.scaladsl.server._
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import play.api.libs.ws.ahc.AhcWSComponents
import com.grossbit.user.api.{ResponseDone, User, UserService}
import com.grossbit.user.impl.UserEntity
import com.grossbit.user.impl.persistance.Command.{CreateUser, UpdateUser}
import com.grossbit.user.impl.persistance.state.UserState
import com.lightbend.lagom.scaladsl.playjson
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
import com.softwaremill.macwire._

import scala.collection.immutable.Seq


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

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

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

  // Register the User persistent entity
  persistentEntityRegistry.register(wire[UserEntity])
}

class UserLoader extends LagomApplicationLoader {

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

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

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



object UserSerializerRegistry extends JsonSerializerRegistry {
  override def serializers: Seq[JsonSerializer[_]] = Seq(
    JsonSerializer[UserState],
    JsonSerializer[User],
    JsonSerializer[CreateUser],
    JsonSerializer[UpdateUser],
    JsonSerializer[List[User]],
    JsonSerializer[ResponseDone]
  )
} 
开发者ID:sarathraj-coder,项目名称:lagommicroapp,代码行数:62,代码来源:UserLoader.scala


示例20: 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[Auct 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Scala Supervision类代码示例发布时间:2022-05-23
下一篇:
Scala HtmlFormat类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap