/** * Returns true if the persisted version is compatible with the * current version of this storage hook. The default implementation * returns true if the specified version is identical to the current * version. Implementations must override this method if they * want to support other (older) versions for migration purposes. * @param version the persisted version * @return true if the persisted version is compatible with * the current version. */ public boolean isCompatibleWith(int version) { return getStorageVersion() == version; }
/** * Returns true if the persisted version is compatible with the * current version of this storage hook. The default implementation * returns true if the specified version is identical to the current * version. Implementations must override this method if they * want to support other (older) versions for migration purposes. * @param version the persisted version * @return true if the persisted version is compatible with * the current version. */ public boolean isCompatibleWith(int version) { return getStorageVersion() == version; }
/** * Returns true if the persisted version is compatible with the * current version of this storage hook. The default implementation * returns true if the specified version is identical to the current * version. Implementations must override this method if they * want to support other (older) versions for migration purposes. * @param version the persisted version * @return true if the persisted version is compatible with * the current version. */ public boolean isCompatibleWith(int version) { return getStorageVersion() == version; }
/** * Returns true if the persisted version is compatible with the * current version of this storage hook. The default implementation * returns true if the specified version is identical to the current * version. Implementations must override this method if they * want to support other (older) versions for migration purposes. * @param version the persisted version * @return true if the persisted version is compatible with * the current version. */ public boolean isCompatibleWith(int version) { return getStorageVersion() == version; }
/** * Returns true if the persisted version is compatible with the * current version of this storage hook. The default implementation * returns true if the specified version is identical to the current * version. Implementations must override this method if they * want to support other (older) versions for migration purposes. * @param version the persisted version * @return true if the persisted version is compatible with * the current version. */ public boolean isCompatibleWith(int version) { return getStorageVersion() == version; }
/** * Returns true if the persisted version is compatible with the * current version of this storage hook. The default implementation * returns true if the specified version is identical to the current * version. Implementations must override this method if they * want to support other (older) versions for migration purposes. * @param version the persisted version * @return true if the persisted version is compatible with * the current version. */ public boolean isCompatibleWith(int version) { return getStorageVersion() == version; }
private void saveStorageHookData(DataOutputStream out, List<Generation> generations) throws IOException { List<StorageHookFactory<?, ?, ?>> factories = getConfiguration().getHookRegistry().getStorageHookFactories(); out.writeInt(factories.size()); for (StorageHookFactory<?, ?, ?> factory : factories) { out.writeUTF(factory.getKey()); out.writeInt(factory.getStorageVersion()); // create a temporary in memory stream so we can figure out the length ByteArrayOutputStream tempBytes = new ByteArrayOutputStream(); DataOutputStream temp = new DataOutputStream(tempBytes); try { Object saveContext = factory.createSaveContext(); for (Generation generation : generations) { if (generation.getBundleInfo().getBundleId() == 0) { continue; // ignore system bundle } @SuppressWarnings({"rawtypes", "unchecked"}) StorageHook<Object, Object> hook = generation.getStorageHook((Class) factory.getClass()); hook.save(saveContext, temp); } } finally { temp.close(); } out.writeInt(tempBytes.size()); out.write(tempBytes.toByteArray()); } }
private void saveStorageHookData(DataOutputStream out, List<Generation> generations) throws IOException { List<StorageHookFactory<?, ?, ?>> factories = getConfiguration().getHookRegistry().getStorageHookFactories(); out.writeInt(factories.size()); for (StorageHookFactory<?, ?, ?> factory : factories) { out.writeUTF(factory.getKey()); out.writeInt(factory.getStorageVersion()); // create a temporary in memory stream so we can figure out the length ByteArrayOutputStream tempBytes = new ByteArrayOutputStream(); DataOutputStream temp = new DataOutputStream(tempBytes); try { Object saveContext = factory.createSaveContext(); for (Generation generation : generations) { if (generation.getBundleInfo().getBundleId() == 0) { continue; // ignore system bundle } @SuppressWarnings({"rawtypes", "unchecked"}) StorageHook<Object, Object> hook = generation.getStorageHook((Class) factory.getClass()); hook.save(saveContext, temp); } } finally { temp.close(); } out.writeInt(tempBytes.size()); out.write(tempBytes.toByteArray()); } }
private void saveStorageHookData(DataOutputStream out, List<Generation> generations) throws IOException { List<StorageHookFactory<?, ?, ?>> factories = getConfiguration().getHookRegistry().getStorageHookFactories(); out.writeInt(factories.size()); for (StorageHookFactory<?, ?, ?> factory : factories) { out.writeUTF(factory.getKey()); out.writeInt(factory.getStorageVersion()); // create a temporary in memory stream so we can figure out the length ByteArrayOutputStream tempBytes = new ByteArrayOutputStream(); DataOutputStream temp = new DataOutputStream(tempBytes); try { Object saveContext = factory.createSaveContext(); for (Generation generation : generations) { if (generation.getBundleInfo().getBundleId() == 0) { continue; // ignore system bundle } @SuppressWarnings({"rawtypes", "unchecked"}) StorageHook<Object, Object> hook = generation.getStorageHook((Class) factory.getClass()); hook.save(saveContext, temp); } } finally { temp.close(); } out.writeInt(tempBytes.size()); out.write(tempBytes.toByteArray()); } }
private void saveStorageHookData(DataOutputStream out, List<Generation> generations) throws IOException { List<StorageHookFactory<?, ?, ?>> factories = getConfiguration().getHookRegistry().getStorageHookFactories(); out.writeInt(factories.size()); for (StorageHookFactory<?, ?, ?> factory : factories) { out.writeUTF(factory.getKey()); out.writeInt(factory.getStorageVersion()); // create a temporary in memory stream so we can figure out the length ByteArrayOutputStream tempBytes = new ByteArrayOutputStream(); DataOutputStream temp = new DataOutputStream(tempBytes); try { Object saveContext = factory.createSaveContext(); for (Generation generation : generations) { if (generation.getBundleInfo().getBundleId() == 0) { continue; // ignore system bundle } @SuppressWarnings({"rawtypes", "unchecked"}) StorageHook<Object, Object> hook = generation.getStorageHook((Class) factory.getClass()); hook.save(saveContext, temp); } } finally { temp.close(); } out.writeInt(tempBytes.size()); out.write(tempBytes.toByteArray()); } }
private void saveStorageHookData(DataOutputStream out, List<Generation> generations) throws IOException { List<StorageHookFactory<?, ?, ?>> factories = getConfiguration().getHookRegistry().getStorageHookFactories(); out.writeInt(factories.size()); for (StorageHookFactory<?, ?, ?> factory : factories) { out.writeUTF(factory.getKey()); out.writeInt(factory.getStorageVersion()); // create a temporary in memory stream so we can figure out the length ByteArrayOutputStream tempBytes = new ByteArrayOutputStream(); DataOutputStream temp = new DataOutputStream(tempBytes); try { Object saveContext = factory.createSaveContext(); for (Generation generation : generations) { if (generation.getBundleInfo().getBundleId() == 0) { continue; // ignore system bundle } @SuppressWarnings({"rawtypes", "unchecked"}) StorageHook<Object, Object> hook = generation.getStorageHook((Class) factory.getClass()); hook.save(saveContext, temp); } } finally { temp.close(); } out.writeInt(tempBytes.size()); out.write(tempBytes.toByteArray()); } }
private void saveStorageHookData(DataOutputStream out, List<Generation> generations) throws IOException { List<StorageHookFactory<?, ?, ?>> factories = getConfiguration().getHookRegistry().getStorageHookFactories(); out.writeInt(factories.size()); for (StorageHookFactory<?, ?, ?> factory : factories) { out.writeUTF(factory.getKey()); out.writeInt(factory.getStorageVersion()); // create a temporary in memory stream so we can figure out the length ByteArrayOutputStream tempBytes = new ByteArrayOutputStream(); DataOutputStream temp = new DataOutputStream(tempBytes); try { Object saveContext = factory.createSaveContext(); for (Generation generation : generations) { if (generation.getBundleInfo().getBundleId() == 0) { continue; // ignore system bundle } @SuppressWarnings({"rawtypes", "unchecked"}) StorageHook<Object, Object> hook = generation.getStorageHook((Class) factory.getClass()); hook.save(saveContext, temp); } } finally { temp.close(); } out.writeInt(tempBytes.size()); out.write(tempBytes.toByteArray()); } }