@Override public EntityDriverManager getEntityDriverManager() { checkInitialManagementContextReal(); return initialManagementContext.getEntityDriverManager(); }
@Override public Iterable<URL> getBaseClassPathForScanning() { checkInitialManagementContextReal(); return initialManagementContext.getBaseClassPathForScanning(); }
@Override public void setBaseClassPathForScanning(Iterable<URL> urls) { checkInitialManagementContextReal(); initialManagementContext.setBaseClassPathForScanning(urls); }
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 Set<ApplicationUsage> getApplicationUsage(Predicate<? super ApplicationUsage> filter) { if (isInitialManagementContextReal()) { return initialManagementContext.getUsageManager().getApplicationUsage(filter); } else { throw new IllegalStateException("Non-deployment context "+this+" is not valid for this operation"); } } }
@Override public BrooklynProperties getBrooklynProperties() { checkInitialManagementContextReal(); return initialManagementContext.getBrooklynProperties(); }
@Override public void terminate() { if (isInitialManagementContextReal()) { initialManagementContext.terminate(); } else { // no-op; the non-deployment management context has nothing needing terminated } }
@Override public RebindManager getRebindManager() { // There was a race where EffectorUtils on invoking an effector calls: // mgmtSupport.getEntityChangeListener().onEffectorCompleted(eff); // but where the entity/app may be being unmanaged concurrently (e.g. calling app.stop()). // So now we allow the change-listener to be called. if (isInitialManagementContextReal()) { return initialManagementContext.getRebindManager(); } else { return new NonDeploymentRebindManager(); } }
@Override public long getTotalEffectorInvocations() { if (isInitialManagementContextReal()) { return initialManagementContext.getTotalEffectorInvocations(); } else { return 0; } }
@Override public synchronized Collection<Application> getApplications() { return getEntityManager().getApplications(); }
@Override public DownloadResolverManager getEntityDownloadsManager() { checkInitialManagementContextReal(); return initialManagementContext.getEntityDownloadsManager(); }
@Override public BrooklynStorage getStorage() { checkInitialManagementContextReal(); return initialManagementContext.getStorage(); }
@Override public BrooklynCatalog getCatalog() { checkInitialManagementContextReal(); return initialManagementContext.getCatalog(); }
@Override public ClassLoader getBaseClassLoader() { checkInitialManagementContextReal(); return initialManagementContext.getBaseClassLoader(); }
@Override public void addEntitySetListener(CollectionChangeListener<Entity> listener) { checkInitialManagementContextReal(); initialManagementContext.addEntitySetListener(listener); }
@Override public void removeEntitySetListener(CollectionChangeListener<Entity> listener) { checkInitialManagementContextReal(); initialManagementContext.removeEntitySetListener(listener); }
public void prePreManage(Location location) { getLocationManager().prePreManage(location); }
@Override public StringConfigMap getConfig() { checkInitialManagementContextReal(); return initialManagementContext.getConfig(); }
@Override public LocationRegistry getLocationRegistry() { checkInitialManagementContextReal(); return initialManagementContext.getLocationRegistry(); }
@Override public void addEntitySetListener(CollectionChangeListener<Entity> listener) { getEntityManager().addEntitySetListener(listener); }