本文整理汇总了Java中com.lightbend.lagom.javadsl.persistence.PersistentEntityRef类的典型用法代码示例。如果您正苦于以下问题:Java PersistentEntityRef类的具体用法?Java PersistentEntityRef怎么用?Java PersistentEntityRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PersistentEntityRef类属于com.lightbend.lagom.javadsl.persistence包,在下文中一共展示了PersistentEntityRef类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: hello
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
public ServiceCall<NotUsed, String> hello(String id) {
return request -> {
// Look up the hello world entity for the given ID.
PersistentEntityRef<HelloCommand> ref = persistentEntityRegistry.refFor(HelloEntity.class, id);
// Ask the entity the Hello command.
return ref.ask(new Hello(id, Optional.empty()));
};
}
开发者ID:MarioAriasC,项目名称:lagomkotlin,代码行数:9,代码来源:HelloServiceImpl.java
示例2: useGreeting
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
public ServiceCall<GreetingMessage, Done> useGreeting(String id) {
return request -> {
// Look up the hello world entity for the given ID.
PersistentEntityRef<HelloCommand> ref = persistentEntityRegistry.refFor(HelloEntity.class, id);
// Tell the entity to use the greeting name specified.
return ref.ask(new UseGreetingMessage(request.message));
};
}
开发者ID:MarioAriasC,项目名称:lagomkotlin,代码行数:10,代码来源:HelloServiceImpl.java
示例3: addLeg
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
@Override
public ServiceCall<String, Leg, Done> addLeg() {
return (id, request) -> {
CompletionStage<Cargo> response = registrationService.getRegistration().invoke(request.getCargoId(), NotUsed.getInstance());
PersistentEntityRef<ShippingCommand> itinerary = persistentEntityRegistry.refFor(ItineraryEntity.class, id);
return itinerary.ask(AddLeg.of(request));
};
}
开发者ID:lagom,项目名称:activator-lagom-cargotracker,代码行数:9,代码来源:ShippingServiceImpl.java
示例4: createItinerary
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
@Override
public ServiceCall<NotUsed, Itinerary, Done> createItinerary() {
return (id, request) -> {
// Look up the itinerary for the given ID.
PersistentEntityRef<ShippingCommand> itinerary =
persistentEntityRegistry.refFor(ItineraryEntity.class, request.getId());
// Tell the entity to use the greeting message specified.
return itinerary.ask(CreateItinerary.of(request));
};
}
开发者ID:lagom,项目名称:activator-lagom-cargotracker,代码行数:11,代码来源:ShippingServiceImpl.java
示例5: register
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
/**
* Register Cargo service call
*
* @return
*/
@Override
public ServiceCall<NotUsed, Cargo, Done> register() {
return (id, request) -> {
/* Publish received entity into topic named "Topic" */
PubSubRef<Cargo> topic = topics.refFor(TopicId.of(Cargo.class, "topic"));
topic.publish(request);
log.info("Cargo ID: {}.", request.getId());
/* Look up the Cargo entity for the given ID. */
PersistentEntityRef<RegistrationCommand> ref =
persistentEntityRegistry.refFor(CargoEntity.class, request.getId());
/* Tell the entity to use the Cargo information in the request. */
return ref.ask(RegisterCargo.of(request));
};
}
开发者ID:lagom,项目名称:activator-lagom-cargotracker,代码行数:20,代码来源:RegistrationServiceImpl.java
示例6: hello
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
@Override
public ServiceCall<NotUsed, String> hello(String id) {
return request -> {
// Look up the hello world entity for the given ID.
PersistentEntityRef<HelloCommand> ref = persistentEntityRegistry.refFor(HelloEntity.class, id);
// Ask the entity the Hello command.
return ref.ask(new Hello(id, Optional.empty()));
};
}
开发者ID:jvz,项目名称:lagom-example,代码行数:10,代码来源:HelloServiceImpl.java
示例7: useGreeting
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
@Override
public ServiceCall<GreetingMessage, Done> useGreeting(String id) {
return request -> {
// Look up the hello world entity for the given ID.
PersistentEntityRef<HelloCommand> ref = persistentEntityRegistry.refFor(HelloEntity.class, id);
// Tell the entity to use the greeting message specified.
return ref.ask(new UseGreetingMessage(request.message));
};
}
开发者ID:jvz,项目名称:lagom-example,代码行数:11,代码来源:HelloServiceImpl.java
示例8: refFor
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
private PersistentEntityRef<InventoryCommand> refFor(UUID id) {
return registry
.refFor(InventoryEntity.class, "main-warehouse-" + id.toString());
}
开发者ID:ignasi35,项目名称:lagom-java-workshop,代码行数:5,代码来源:InventoryServiceImpl.java
示例9: refFor
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
private PersistentEntityRef<BasketCommand> refFor(UUID id) {
return registry.refFor(BasketEntity.class, id.toString());
}
开发者ID:ignasi35,项目名称:lagom-java-workshop,代码行数:4,代码来源:BasketServiceImpl.java
示例10: friendEntityRef
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
private PersistentEntityRef<FriendCommand> friendEntityRef(String userId) {
PersistentEntityRef<FriendCommand> ref = persistentEntities.refFor(FriendEntity.class, userId);
return ref;
}
开发者ID:lagom,项目名称:lagom-java-chirper-example,代码行数:5,代码来源:FriendServiceImpl.java
示例11: favoriteEntityRef
import com.lightbend.lagom.javadsl.persistence.PersistentEntityRef; //导入依赖的package包/类
private PersistentEntityRef<FavoriteCommand> favoriteEntityRef(String userId) {
return this.persistentEntities.refFor(FavoriteEntity.class, userId);
}
开发者ID:negokaz,项目名称:lagom-hands-on-development,代码行数:4,代码来源:FavoriteServiceImpl.java
注:本文中的com.lightbend.lagom.javadsl.persistence.PersistentEntityRef类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论