@Override public Collection<Entity> getEntities() { if (isInitialManagementContextReal()) { return initialManagementContext.getEntityManager().getEntities(); } else { return Collections.emptyList(); } }
public void setManagementContext(ManagementContextInternal val) { this.initialManagementContext = checkNotNull(val, "initialManagementContext"); this.entityManager = new NonDeploymentEntityManager(val); this.locationManager = new NonDeploymentLocationManager(val); this.accessManager = new NonDeploymentAccessManager(val); this.usageManager = new NonDeploymentUsageManager(val); }
@Override public <T extends Entity> T createEntity(Map<?,?> config, Class<T> type) { return createEntity(EntitySpec.create(type).configure(config)); }
public NonDeploymentManagementContext(AbstractEntity entity, NonDeploymentManagementContextMode mode) { this.entity = checkNotNull(entity, "entity"); this.mode = checkNotNull(mode, "mode"); qsm = new QueueingSubscriptionManager(); subscriptionContext = new BasicSubscriptionContext(qsm, entity); executionContext = new NonDeploymentExecutionContext(); entityManager = new NonDeploymentEntityManager(null); locationManager = new NonDeploymentLocationManager(null); accessManager = new NonDeploymentAccessManager(null); usageManager = new NonDeploymentUsageManager(null); }
@Override public EntityTypeRegistry getEntityTypeRegistry() { if (isInitialManagementContextReal()) { return initialManagementContext.getEntityManager().getEntityTypeRegistry(); } else { throw new IllegalStateException("Non-deployment context "+this+" (with no initial management context supplied) is not valid for this operation."); } }
@Override public Iterable<Entity> getEntitiesInApplication(Application application) { if (isInitialManagementContextReal()) { return initialManagementContext.getEntityManager().getEntitiesInApplication(application); } else { return Collections.emptyList(); } }
@Override public <T extends Entity> T createEntity(EntitySpec<T> spec) { if (isInitialManagementContextReal()) { return initialManagementContext.getEntityManager().createEntity(spec); } else { throw new IllegalStateException("Non-deployment context "+this+" (with no initial management context supplied) is not valid for this operation."); } }
@Override public Entity getEntity(String id) { if (isInitialManagementContextReal()) { return initialManagementContext.getEntityManager().getEntity(id); } else { return null; } }