public class Container extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Container.ComponentState |
static class |
Container.ContainerState |
| Constructor and Description |
|---|
Container() |
| 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() |
Container.ContainerState |
getContainerState() |
protected Container.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 componentMap
Wires the componentMap together by injecting fields and the configuration
Calls @PostConstructor on all componentMap
Calls start on all componentMap 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 Container.ComponentState getState(Class<?> componentClass)
public <T> T get(Class<T> componentClass)
public Container.ContainerState getContainerState()
Copyright © 2015 Electronic Arts Inc. All rights reserved.