Package org.eclipse.osgi.storagemanager

Examples of org.eclipse.osgi.storagemanager.StorageManager


    StateManager.DEBUG_PLATFORM_ADMIN = options.getBooleanOption(OPTION_PLATFORM_ADMIN, false);
    StateManager.DEBUG_PLATFORM_ADMIN_RESOLVER = options.getBooleanOption(OPTION_PLATFORM_ADMIN_RESOLVER, false);
  }

  protected StorageManager initFileManager(File baseDir, String lockMode, boolean readOnly) throws IOException {
    StorageManager sManager = new StorageManager(baseDir, lockMode, readOnly);
    try {
      sManager.open(!readOnly);
    } catch (IOException ex) {
      if (Debug.DEBUG && Debug.DEBUG_GENERAL) {
        Debug.println("Error reading framework metadata: " + ex.getMessage()); //$NON-NLS-1$
        Debug.printStackTrace(ex);
      }
View Full Code Here


    Location parentConfiguration = null;
    Location currentConfiguration = LocationManager.getConfigurationLocation();
    if (currentConfiguration != null && (parentConfiguration = currentConfiguration.getParentLocation()) != null) {
      try {
        File stateLocationDir = new File(parentConfiguration.getURL().getFile(), FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME);
        StorageManager newFileManager = initFileManager(stateLocationDir, "none", true); //$NON-NLS-1$);
        for (int i = 0; i < storageFiles.length; i++)
          storageFiles[i] = newFileManager.lookup(fileNames[i], false);
        newFileManager.close();
      } catch (IOException ex) {
        if (Debug.DEBUG && Debug.DEBUG_GENERAL) {
          Debug.println("Error reading state file " + ex.getMessage()); //$NON-NLS-1$
          Debug.printStackTrace(ex);
        }
View Full Code Here

      Location currentConfiguration = LocationManager.getConfigurationLocation();
      Location parentConfiguration = null;
      if (currentConfiguration != null && (parentConfiguration = currentConfiguration.getParentLocation()) != null) {
        try {
          File bundledataLocationDir = new File(parentConfiguration.getURL().getFile(), FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME);
          StorageManager newStorageManager = initFileManager(bundledataLocationDir, "none", true); //$NON-NLS-1$
          storageStream = newStorageManager.getInputStream(fileName);
          newStorageManager.close();
        } catch (MalformedURLException e1) {
          // This will not happen since all the URLs are derived by us
          // and we are GODS!
        } catch (IOException e1) {
          // That's ok we will regenerate the .bundleData
View Full Code Here

  private State internalReadState(StateImpl toRestore, File stateDirectory, long expectedTimestamp) throws IOException {
    File stateFile = new File(stateDirectory, StateReader.STATE_FILE);
    File lazyFile = new File(stateDirectory, StateReader.LAZY_FILE);
    if (!stateFile.exists() || !lazyFile.exists()) {
      StorageManager storageManager = new StorageManager(stateDirectory, "none", true); //$NON-NLS-1$
      try {
        // if the directory is pointing at the configuration directory then the base files will not exist
        storageManager.open(true);
        // try using the storage manager to find the managed state files (bug 143255)
        File managedState = storageManager.lookup(StateReader.STATE_FILE, false);
        File managedLazy = storageManager.lookup(StateReader.LAZY_FILE, false);
        if (managedState != null && managedLazy != null) {
          stateFile = managedState;
          lazyFile = managedLazy;
        }
      } finally {
        storageManager.close();
      }
    }
    StateReader reader = new StateReader(stateFile, lazyFile, false);
    if (!reader.loadState(toRestore, expectedTimestamp))
      return null;
View Full Code Here

  private State internalReadState(StateImpl toRestore, File stateDirectory, long expectedTimestamp) throws IOException {
    File stateFile = new File(stateDirectory, StateReader.STATE_FILE);
    File lazyFile = new File(stateDirectory, StateReader.LAZY_FILE);
    if (!stateFile.exists() || !lazyFile.exists()) {
      StorageManager storageManager = new StorageManager(stateDirectory, "none", true); //$NON-NLS-1$
      try {
        // if the directory is pointing at the configuration directory then the base files will not exist
        storageManager.open(true);
        // try using the storage manager to find the managed state files (bug 143255)
        File managedState = storageManager.lookup(StateReader.STATE_FILE, false);
        File managedLazy = storageManager.lookup(StateReader.LAZY_FILE, false);
        if (managedState != null && managedLazy != null) {
          stateFile = managedState;
          lazyFile = managedLazy;
        }
      } finally {
        storageManager.close();
      }
    }
    StateReader reader = new StateReader(stateFile, lazyFile, false);
    if (!reader.loadState(toRestore, expectedTimestamp))
      return null;
View Full Code Here

    StateManager.DEBUG_PLATFORM_ADMIN = options.getBooleanOption(OPTION_PLATFORM_ADMIN, false);
    StateManager.DEBUG_PLATFORM_ADMIN_RESOLVER = options.getBooleanOption(OPTION_PLATFORM_ADMIN_RESOLVER, false);
  }

  protected StorageManager initFileManager(File baseDir, String lockMode, boolean readOnly) throws IOException {
    StorageManager sManager = new StorageManager(baseDir, lockMode, readOnly);
    try {
      sManager.open(!readOnly);
    } catch (IOException ex) {
      if (Debug.DEBUG_GENERAL) {
        Debug.println("Error reading framework metadata: " + ex.getMessage()); //$NON-NLS-1$
        Debug.printStackTrace(ex);
      }
View Full Code Here

    Location parentConfiguration = null;
    Location currentConfiguration = LocationManager.getConfigurationLocation();
    if (currentConfiguration != null && (parentConfiguration = currentConfiguration.getParentLocation()) != null) {
      try {
        File stateLocationDir = new File(parentConfiguration.getURL().getFile(), FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME);
        StorageManager newFileManager = initFileManager(stateLocationDir, "none", true); //$NON-NLS-1$);
        for (int i = 0; i < storageFiles.length; i++)
          storageFiles[i] = newFileManager.lookup(fileNames[i], false);
        newFileManager.close();
      } catch (IOException ex) {
        if (Debug.DEBUG_GENERAL) {
          Debug.println("Error reading state file " + ex.getMessage()); //$NON-NLS-1$
          Debug.printStackTrace(ex);
        }
View Full Code Here

      Location currentConfiguration = LocationManager.getConfigurationLocation();
      Location parentConfiguration = null;
      if (currentConfiguration != null && (parentConfiguration = currentConfiguration.getParentLocation()) != null) {
        try {
          File bundledataLocationDir = new File(parentConfiguration.getURL().getFile(), FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME);
          StorageManager newStorageManager = initFileManager(bundledataLocationDir, "none", true); //$NON-NLS-1$
          storageStream = newStorageManager.getInputStream(fileName);
          newStorageManager.close();
        } catch (MalformedURLException e1) {
          // This will not happen since all the URLs are derived by us
          // and we are GODS!
        } catch (IOException e1) {
          // That's ok we will regenerate the .bundleData
View Full Code Here

  private State internalReadState(StateImpl toRestore, File stateDirectory, long expectedTimestamp) throws IOException {
    File stateFile = new File(stateDirectory, StateReader.STATE_FILE);
    File lazyFile = new File(stateDirectory, StateReader.LAZY_FILE);
    if (!stateFile.exists() || !lazyFile.exists()) {
      StorageManager storageManager = new StorageManager(stateDirectory, "none", true); //$NON-NLS-1$
      try {
        // if the directory is pointing at the configuration directory then the base files will not exist
        storageManager.open(true);
        // try using the storage manager to find the managed state files (bug 143255)
        File managedState = storageManager.lookup(StateReader.STATE_FILE, false);
        File managedLazy = storageManager.lookup(StateReader.LAZY_FILE, false);
        if (managedState != null && managedLazy != null) {
          stateFile = managedState;
          lazyFile = managedLazy;
        }
      } finally {
        storageManager.close();
      }
    }
    StateReader reader = new StateReader(stateFile, lazyFile, false);
    if (!reader.loadState(toRestore, expectedTimestamp))
      return null;
View Full Code Here

    StateManager.DEBUG_PLATFORM_ADMIN = options.getBooleanOption(OPTION_PLATFORM_ADMIN, false);
    StateManager.DEBUG_PLATFORM_ADMIN_RESOLVER = options.getBooleanOption(OPTION_PLATFORM_ADMIN_RESOLVER, false);
  }

  protected StorageManager initFileManager(File baseDir, String lockMode, boolean readOnly) {
    StorageManager sManager = new StorageManager(baseDir, lockMode, readOnly);
    try {
      sManager.open(!readOnly);
    } catch (IOException ex) {
      if (Debug.DEBUG && Debug.DEBUG_GENERAL) {
        Debug.println("Error reading framework metadata: " + ex.getMessage()); //$NON-NLS-1$
        Debug.printStackTrace(ex);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.storagemanager.StorageManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.