Package prause.toolbox.hibernate

Examples of prause.toolbox.hibernate.PersistentProperties


  public class DefaultStateSave implements ImportWorker.StateSaver {
    private DefaultStateSave() {
    }

    public synchronized void setValue(String key, Serializable value) {
      PersistentProperties values = PersistentProperties.loadOrCreate("importerWorkerState");
      ByteArrayOutputStream buf = new ByteArrayOutputStream();
      try {
        ObjectOutputStream oos = new ObjectOutputStream(buf);
        oos.writeObject(value);
        oos.flush();
        values.setProperty(key, Base64.encode(buf.toByteArray()));
      } catch (IOException e) {
        logger.error("Internal error, this cannot happen?!", e);
      }
    }
View Full Code Here


        logger.error("Internal error, this cannot happen?!", e);
      }
    }

    public synchronized Serializable getValue(String key) {
      PersistentProperties values = PersistentProperties.loadOrCreate("importerWorkerState");
      String value = values.getProperty(key);
      if (value == null) {
        return null;
      }
      ByteArrayInputStream bais = new ByteArrayInputStream(Base64.decode(value));
      try {
View Full Code Here

TOP

Related Classes of prause.toolbox.hibernate.PersistentProperties

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.