Closed wwerner closed 4 years ago
From what I can see, io.vlingo.actors.World#stageNamed(java.lang.String, java.lang.Class<? extends io.vlingo.actors.Stage>, io.vlingo.actors.AddressFactory)
is the only place where a Stage
is registered with World
.
Creating the Stage
like this stage = Grid.startWith(world, new GridAddressFactory(IdentityGeneratorType.RANDOM),Schemata.StageName);
does not make the World
aware of the new stage. This has the effect that an additional Stage
with a wrong AddressFactory
is created, leading to, e.g.
java.lang.NumberFormatException: For input string: "9542cc78-fe9c-4c08-95a5-b89b9b5306d5"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.parseLong(Long.java:631)
at io.vlingo.actors.BasicAddressFactory.from(BasicAddressFactory.java:35)
at io.vlingo.schemata.model.Context.with(Context.java:40)
at io.vlingo.schemata.model.Context.with(Context.java:31)
at io.vlingo.schemata.resource.ContextResource.defineWith(ContextResource.java:55)
at io.vlingo.schemata.resource.ContextResourceTest.testThatContextIsDefined(ContextResourceTest.java:31)
Whithout knowing why Grid
's c'tor was made private, I'm not sure about the right way to resolve this.
Options:
1) Simply make Grid.<init>
public
again. I did this locally so I can continue and can push it if this is the correct solution.
2) Re-write io.vlingo.actors.World#stageNamed(java.lang.String, java.lang.Class<? extends io.vlingo.actors.Stage>, io.vlingo.actors.AddressFactory)
not to use the constructor. I'd guess this could spread widely through the platform and would require additional changes.
3) Allow for adding Stage
s to an existing World
and using that from io.vlingo.lattice.grid.Grid#startWith(io.vlingo.actors.World, io.vlingo.actors.AddressFactory, java.lang.String)
Any wisdom to share, @VaughnVernon?
@wwerner I made the ctor private in favor of a factory method but overlooked that dependency. The fix is committed in vlingo-lattice. (Sorry forgot to #59 on it.)
Since the update to
0.9.1-RC2
, most unit tests in schemata fail with the exception below.It seems the
Grid
c'tor has been replaced by static factory methods in this version as of https://github.com/vlingo/vlingo-lattice/commit/d1de410aeae8b8be6ae5650ff6d8820c73bb52ae which is still used inactors.World
: https://github.com/vlingo/vlingo-actors/blob/master/src/main/java/io/vlingo/actors/World.java#L430