@Override protected LocalManagementContext newTestManagementContext() { ResourceUtils ru = new ResourceUtils(this); File jar = createJar(ru); File catalog = createCatalog(ru, jar); BrooklynProperties properties = BrooklynProperties.Factory.newEmpty(); properties.put(BrooklynServerConfig.BROOKLYN_CATALOG_URL, catalog.toURI().toString()); return LocalManagementContextForTests.builder(true) .useProperties(properties) .disableOsgi(false) .build(); }
public LocalManagementContext buildUnstarted() { LocalManagementContext unstarted; BrooklynProperties properties = this.properties != null ? this.properties : BrooklynProperties.Factory.newDefault(); if (this.emptyCatalog) { properties.putIfAbsent( BrooklynServerConfig.BROOKLYN_CATALOG_URL, ManagementContextInternal.EMPTY_CATALOG_URL); } if (!enablePersistenceBackups) { properties.putIfAbsent( BrooklynServerConfig.PERSISTENCE_BACKUPS_REQUIRED_ON_DEMOTION, false); properties.putIfAbsent( BrooklynServerConfig.PERSISTENCE_BACKUPS_REQUIRED_ON_PROMOTION, false); properties.putIfAbsent(BrooklynServerConfig.PERSISTENCE_BACKUPS_REQUIRED, false); } if (forLive) { unstarted = new LocalManagementContext(properties); } else { unstarted = LocalManagementContextForTests.builder(true) .useProperties(properties) .disableOsgi(!enableOsgi) .build(); } objectStore.injectManagementContext(unstarted); objectStore.prepareForSharedUse( PersistMode.AUTO, (haMode == null ? HighAvailabilityMode.DISABLED : haMode)); BrooklynMementoPersisterToObjectStore newPersister = new BrooklynMementoPersisterToObjectStore( objectStore, unstarted.getBrooklynProperties(), classLoader); ((RebindManagerImpl) unstarted.getRebindManager()).setPeriodicPersistPeriod(persistPeriod); unstarted .getRebindManager() .setPersister(newPersister, PersistenceExceptionHandlerImpl.builder().build()); // set the HA persister, in case any children want to use HA unstarted .getHighAvailabilityManager() .setPersister( new ManagementPlaneSyncRecordPersisterToObjectStore( unstarted, objectStore, classLoader)); return unstarted; }
protected LocalManagementContext newManagementContext() { // loads properties, by default, but not OSGi or anything else return LocalManagementContextForTests.builder(true).useDefaultProperties().build(); }