public class OrbitContainer extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
OrbitContainer.ComponentState |
protected static class |
OrbitContainer.ContainerState |
| Constructor and Description |
|---|
OrbitContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Class<?> componentClass) |
<T> void |
addInstance(T instance) |
List<Object> |
components() |
<T> List<T> |
components(Class<T> actorClass) |
<T> T |
get(Class<T> componentClass) |
List<Class<?>> |
getClasses() |
protected OrbitContainer.ComponentState |
getState(Class<?> componentClass) |
void |
inject(Object object) |
protected void |
injectConfig(Object o) |
protected void |
injectConfig(Object o,
Field f) |
void |
join() |
void |
postConstruct(Object o) |
void |
setProperties(Map<String,Object> properties) |
void |
start()
Compiles a list of classes that will be stored inside this container:
Reads the configuration from the properties
Looks for component declarations in the classpath: META-INF/services/orbit/*
Instantiates all the components
Wires the components together by injecting fields and the configuration
Calls @PostConstructor on all components
Calls start on all components that implement Startable
|
void |
stop() |
public void join()
throws ExecutionException,
InterruptedException
public void add(Class<?> componentClass)
public <T> void addInstance(T instance)
protected void injectConfig(Object o, Field f) throws IllegalAccessException
IllegalAccessExceptionprotected void injectConfig(Object o) throws IllegalAccessException
IllegalAccessExceptionpublic void inject(Object object)
public void postConstruct(Object o)
public void start()
public void stop()
protected OrbitContainer.ComponentState getState(Class<?> componentClass)
public <T> T get(Class<T> componentClass)
Copyright © 2015. All rights reserved.