Skip to content

Dependency Injection Annotation #85

@aikar

Description

@aikar

Provide a way for the command manager to receive dependencies and provide standard dependency injection abilities

Such as

manager.addDependency(Plugin.class, plugin);
manager.addDependency(MyPlugin.class, plugin);
manager.addDependency(MyObjectManager.class, objManager);

public MyCommandClass extends BaseCommand {
    @Dependency MyPlugin plugin;
    @Dependency MyObjectManager manager;
    // ... commands
}

On registration, ACF can fulfill the dependencies as provided, as commonly seen in more featured dependency injection frameworks.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions