brooklyn.entity.rebind.RebindContextImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-core Show documentation
Show all versions of brooklyn-core Show documentation
Entity implementation classes, events, and other core elements
package brooklyn.entity.rebind;
import java.util.Map;
import brooklyn.entity.Entity;
import brooklyn.location.Location;
import brooklyn.policy.Policy;
import com.google.common.collect.Maps;
public class RebindContextImpl implements RebindContext {
private final Map entities = Maps.newLinkedHashMap();
private final Map locations = Maps.newLinkedHashMap();
private final Map policies = Maps.newLinkedHashMap();
private final ClassLoader classLoader;
public RebindContextImpl(ClassLoader classLoader) {
this.classLoader = classLoader;
}
public void registerEntity(String id, Entity entity) {
entities.put(id, entity);
}
public void registerLocation(String id, Location location) {
locations.put(id, location);
}
public void registerPolicy(String id, Policy policy) {
policies.put(id, policy);
}
@Override
public Entity getEntity(String id) {
return entities.get(id);
}
@Override
public Location getLocation(String id) {
return locations.get(id);
}
@Override
public Policy getPolicy(String id) {
return policies.get(id);
}
@Override
public Class> loadClass(String className) throws ClassNotFoundException {
return classLoader.loadClass(className);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy