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) |
protected void |
injectField(OrbitContainer.ComponentState state,
Field f) |
protected void |
injectState(OrbitContainer.ComponentState state) |
boolean |
isLocateServices() |
void |
join() |
void |
postConstruct(Object o) |
void |
setLocateServices(boolean locateServices) |
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 setLocateServices(boolean locateServices)
public boolean isLocateServices()
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
IllegalAccessExceptionprotected void injectField(OrbitContainer.ComponentState state, Field f) throws IllegalArgumentException, IllegalAccessException
public void inject(Object object)
protected void injectState(OrbitContainer.ComponentState state)
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.