@Override public <T extends Location> T createLocation(Map<?, ?> config, Class<T> type) { if (isInitialManagementContextReal()) { return initialManagementContext.getLocationManager().createLocation(config, type); } else { throw new IllegalStateException("Non-deployment context "+this+" is not valid for this operation: cannot create "+type); } }
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); }
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 Location manage(Location loc) { if (isInitialManagementContextReal()) { return initialManagementContext.getLocationManager().manage(loc); } else { throw new IllegalStateException("Non-deployment context "+this+" is not valid for this operation: cannot manage "+loc); } }
@Override public Collection<Location> getLocations() { if (isInitialManagementContextReal()) { return initialManagementContext.getLocationManager().getLocations(); } else { return Collections.emptyList(); } }
@Override public <T extends Location> T createLocation(LocationSpec<T> spec) { if (isInitialManagementContextReal()) { return initialManagementContext.getLocationManager().createLocation(spec); } else { throw new IllegalStateException("Non-deployment context "+this+" is not valid for this operation: cannot create "+spec); } }
@Override public void unmanage(Location loc) { if (isInitialManagementContextReal()) { initialManagementContext.getLocationManager().unmanage(loc); } else { throw new IllegalStateException("Non-deployment context "+this+" is not valid for this operation: cannot unmanage "+loc); } }
@Override public Location getLocation(String id) { if (isInitialManagementContextReal()) { return initialManagementContext.getLocationManager().getLocation(id); } else { return null; } }