Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lifecycle graftting #130

Merged
merged 10 commits into from
Oct 5, 2019
Merged

Conversation

junkdog
Copy link
Collaborator

@junkdog junkdog commented Aug 1, 2019

tests

DebugPlugin tests run with graftt agent; maven downloads it and puts the agent under target/ - tests will only work from within the idea if mvn test (or later) has run once, as intellij doesn't care much about maven plugins and their behavior - but it does pick up the agent args from maven.

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.6</version>
    <configuration>
        <argLine>-javaagent:${graftt.agent}=cp:${graftt.transplants}</argLine>
        <useSystemClassLoader>false</useSystemClassLoader>
    </configuration>
</plugin>

running as a user

As a user, the crux here is that the JVM must start with -javaagent:<graft-agent.jar>. Maybe we should provide a script or something to automatically download the most recent agent?

In the tests, it's solved by relying on maven plugins. I guess something similar could be done for gradle.

other stuff

new module for the transplants: contrib-plugin-lifecycle-transplants. pretty similar-looking to the previous ones. some things are done slightly differently, but I don't think I've changed any behavior.

@junkdog junkdog changed the title Lifecycle graftting (approaching mergeable) Lifecycle graftting Aug 2, 2019
@junkdog
Copy link
Collaborator Author

junkdog commented Aug 3, 2019

Noticed phases aren't emitted, I'll take a look.

public class LifecycleListenerManager extends BaseSystem implements ArtemisPhaseListener {
    private LifecycleListenerMultiplexer listeners = new LifecycleListenerMultiplexer();

    @Override
    public void onPhase(World w, Phase phase) {
        if (phase == Phase.PRE_INITIALIZE) {
            // world on system isn't available at this point in the lifecycle.
            registerEntityLifecycleListeners(w.getSystems());
        }
    }

@junkdog
Copy link
Collaborator Author

junkdog commented Aug 3, 2019

Hmm, were was PhaSe.PRE_INITIALIZE sent? I can't find it in either junkdog/artemis-odb#575 or on develop.

@DaanVanYperen DaanVanYperen merged commit d49d490 into DaanVanYperen:develop Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants