Tabnine Logo
BrooklynServerPaths.newMainPersistencePathResolver
Code IndexAdd Tabnine to your IDE (free)

How to use
newMainPersistencePathResolver
method
in
org.apache.brooklyn.core.server.BrooklynServerPaths

Best Java code snippets using org.apache.brooklyn.core.server.BrooklynServerPaths.newMainPersistencePathResolver (Showing top 5 results out of 315)

origin: org.apache.brooklyn/brooklyn-core

/**
 * @param optionalSuppliedValue
 *     An optional value which has been supplied explicitly
 * @param brooklynProperties
 *     The properties map where the persistence path should be looked up if not supplied,
 *     along with finding the brooklyn.base.dir if needed (using file system persistence
 *     with a relative path)
 * @param optionalObjectStoreLocationSpec
 *     If a location spec is supplied, this will return a container name suitable for use
 *     with the given object store based on brooklyn.persistence.dir; if null this method
 *     will return a full file system path, relative to the brooklyn.base.dir if the
 *     configured brooklyn.persistence.dir is not absolute
 * @return The container name or full path for where persist state should be kept
 * @deprecated since 0.7.0 use {@link BrooklynServerPaths#newMainPersistencePathResolver(ManagementContext)} */
@Deprecated
public static String resolvePersistencePath(String optionalSuppliedValue, StringConfigMap brooklynProperties, String optionalObjectStoreLocationSpec) {
  return BrooklynServerPaths.newMainPersistencePathResolver(brooklynProperties).location(optionalObjectStoreLocationSpec).dir(optionalSuppliedValue).resolve();
}

origin: org.apache.brooklyn/brooklyn-launcher

@Override
protected void checkPersistenceContainerNameIsDefault() {
  String expected = BrooklynServerPaths.newMainPersistencePathResolver(BrooklynProperties.Factory.newEmpty()).location(null).dir(null).resolve();
  checkPersistenceContainerNameIs(expected);
}
origin: org.apache.brooklyn/brooklyn-core

/** Creates a {@link PersistenceObjectStore} for use with a specified set of modes. */
public static PersistenceObjectStore newPersistenceObjectStore(ManagementContext managementContext,
    String locationSpecString, String locationContainer, PersistMode persistMode, HighAvailabilityMode highAvailabilityMode) {
  PersistenceObjectStore destinationObjectStore;
  locationContainer = BrooklynServerPaths.newMainPersistencePathResolver(managementContext).location(locationSpecString).dir(locationContainer).resolve();
  LocationSpec<?> locationSpec = Strings.isBlank(locationSpecString) ?
    LocationSpec.create(LocalhostMachineProvisioningLocation.class) :
      managementContext.getLocationRegistry().getLocationSpec(locationSpecString).get();
    
  Location location = managementContext.getLocationManager().createLocation(locationSpec
      .configure(LocalLocationManager.CREATE_UNMANAGED, true));
  if (!(location instanceof LocationWithObjectStore)) {
    throw new IllegalArgumentException("Destination location "+location+" does not offer a persistent store");
  }
  destinationObjectStore = ((LocationWithObjectStore)location).newPersistenceObjectStore(locationContainer);
  
  destinationObjectStore.injectManagementContext(managementContext);
  destinationObjectStore.prepareForSharedUse(persistMode, highAvailabilityMode);
  return destinationObjectStore;
}
origin: org.apache.brooklyn/brooklyn-launcher-common

  persistenceLocation = brooklynProperties.getConfig(BrooklynServerConfig.PERSISTENCE_LOCATION_SPEC);
persistenceDir = BrooklynServerPaths.newMainPersistencePathResolver(brooklynProperties).location(persistenceLocation).dir(persistenceDir).resolve();
objectStore = BrooklynPersistenceUtils.newPersistenceObjectStore(managementContext, persistenceLocation, persistenceDir, 
  persistMode, highAvailabilityMode);
origin: org.apache.brooklyn/brooklyn-launcher

private void initManagementContextAndPersistence(String persistenceDir) {
  BrooklynProperties brooklynProperties = BrooklynProperties.Factory.builderDefault().build();
  brooklynProperties.put(BrooklynServerConfig.MGMT_BASE_DIR.getName(), "");
  brooklynProperties.put(BrooklynServerConfig.OSGI_CACHE_DIR, "target/" + BrooklynServerConfig.OSGI_CACHE_DIR.getDefaultValue());
  mgmt = LocalManagementContextForTests.newInstance(brooklynProperties);
  mgmts.add(mgmt);
  
  persistenceDir = BrooklynServerPaths.newMainPersistencePathResolver(brooklynProperties).dir(persistenceDir).resolve();
  PersistenceObjectStore objectStore = BrooklynPersistenceUtils.newPersistenceObjectStore(mgmt, null, persistenceDir,
      PersistMode.AUTO, HighAvailabilityMode.HOT_STANDBY);
  BrooklynMementoPersisterToObjectStore persister = new BrooklynMementoPersisterToObjectStore(
      objectStore, mgmt);
  RebindManager rebindManager = mgmt.getRebindManager();
  PersistenceExceptionHandler persistenceExceptionHandler = PersistenceExceptionHandlerImpl.builder().build();
  ((RebindManagerImpl) rebindManager).setPeriodicPersistPeriod(Duration.ONE_SECOND);
  rebindManager.setPersister(persister, persistenceExceptionHandler);
  ((RebindManagerImpl) rebindManager).forcePersistNow();
}
org.apache.brooklyn.core.serverBrooklynServerPathsnewMainPersistencePathResolver

Popular methods of BrooklynServerPaths

  • getMgmtBaseDir
  • getOsgiCacheDir
  • newBackupPersistencePathResolver
  • getBrooklynWebTmpDir
  • getOsgiCacheDirCleanedIfNeeded
  • isOsgiCacheForCleaning
  • resolveAgainstBaseDir

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now