|
9 | 9 | import io.eigr.functions.protocol.Protocol; |
10 | 10 | import io.eigr.functions.protocol.actors.ActorOuterClass.ActorId; |
11 | 11 | import io.eigr.spawn.api.Spawn; |
12 | | -import io.eigr.spawn.api.actors.Value; |
13 | 12 | import io.eigr.spawn.api.actors.ActorContext; |
14 | 13 | import io.eigr.spawn.api.actors.ActorFactory; |
| 14 | +import io.eigr.spawn.api.actors.Value; |
15 | 15 | import io.eigr.spawn.api.actors.workflows.SideEffect; |
16 | 16 | import io.eigr.spawn.api.exceptions.ActorInvocationException; |
17 | | -import io.eigr.spawn.api.extensions.SimpleDependencyInjector; |
18 | 17 | import io.eigr.spawn.internal.Entity; |
19 | 18 | import org.slf4j.Logger; |
20 | 19 | import org.slf4j.LoggerFactory; |
@@ -97,9 +96,9 @@ private Protocol.ActorInvocationResponse handleRequest(HttpExchange exchange) th |
97 | 96 | } |
98 | 97 |
|
99 | 98 | Any encodedValue; |
100 | | - if (Objects.isNull(valueResponse.getResponse())){ |
| 99 | + if (Objects.isNull(valueResponse.getResponse())) { |
101 | 100 | encodedValue = Any.pack(Protocol.Noop.getDefaultInstance()); |
102 | | - }else { |
| 101 | + } else { |
103 | 102 | encodedValue = Any.pack(valueResponse.getResponse()); |
104 | 103 | } |
105 | 104 |
|
@@ -150,7 +149,11 @@ private Optional<Value> callAction(String system, String actor, String parent, S |
150 | 149 |
|
151 | 150 | ActorContext actorContext; |
152 | 151 | if (context.hasState()) { |
153 | | - Object state = context.getState().unpack(entity.getStateType()); |
| 152 | + Any anyCtxState = context.getState(); |
| 153 | + log.debug("[{}] trying to get the state of the Actor {}. Parse Any type {} from State type {}", |
| 154 | + system, actor, anyCtxState, entity.getStateType().getSimpleName()); |
| 155 | + |
| 156 | + Object state = anyCtxState.unpack(entity.getStateType()); |
154 | 157 | actorContext = new ActorContext(this.spawn, state); |
155 | 158 | } else { |
156 | 159 | actorContext = new ActorContext(this.spawn); |
|
0 commit comments