A lightweight Inversion of Control (IoC) Container and Components framework
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.externalToolBuilders
src/main/java/org/macroing/cit/ioc
.classpath
.gitignore
.project
COPYING
COPYING.LESSER
README.md
build.xml

README.md

CIT - IOC (v. 0.0.1)

CIT IOC is a lightweight Inversion of Control (IoC) Container and Components framework.

This framework is part of the Common Infrastructure Tools (CIT) project hosted by Macroing.org.

Supported Features

  • Provides two APIs; the Container API and the Components API.
  • Provides a mechanism to load Components. This includes a java.util.ServiceLoader implementation.
  • Provides a mechanism to sort the start and stop orders of Components.
  • Provides a mechanism to filter out Components eligible to start.
  • Provides a mechanism to configure the Components that should start.
  • Provides observers for both the Container API and the Components API.

Examples

import org.macroing.cit.ioc.component.Component;
import org.macroing.cit.ioc.container.ComponentConfigurator;
import org.macroing.cit.ioc.container.ComponentFilter;
import org.macroing.cit.ioc.container.ComponentLoader;
import org.macroing.cit.ioc.container.ComponentSorter;
import org.macroing.cit.ioc.container.Container;
import org.macroing.cit.ioc.container.ContainerObserver;

public class MyApplication {
    public static void main(String[] args) {
        Container container = new Container();
        container.addComponentConfigurator(new MyComponentConfigurator());//A functional interface.
        container.addComponentFilter(new MyComponentFilter());//A functional interface.
        container.addComponentLoader(new MyComponentLoader());//A functional interface.
        container.addComponentSorter(new MyComponentSorter());//A functional interface.
        container.addContainerObserver(new MyContainerObserver());//An adapter implementation exists for convenience.
        container.start();
        container.stop();
    }
}

Dependencies

Note

This framework has not been properly released yet. This means, even though it says it's version 1.0.0 in the build.xml file and all Java source code files, it should not be treated as such. When this framework gets released, it will be tagged and available on the "releases" page.