Examples of BackingStoreException


Examples of java.util.prefs.BackingStoreException

                keys.add( sa.getUpId() );
            }
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
        }

        return keys.toArray( EMPTY_STRINGS );
    }
View Full Code Here

Examples of java.util.prefs.BackingStoreException

  private void checkException() throws BackingStoreException {
    switch (result) {
    case NORMAL:
      return;
    case backingException:
      throw new BackingStoreException("test");
    case runtimeException:
      throw new MockRuntimeException("test");
    }
  }
View Full Code Here

Examples of java.util.prefs.BackingStoreException

            }
          }
          catch (final Exception e)
          {
            UncaughtExceptionsModel.getInstance().addException(e);
            throw new BackingStoreException("Failed to write config " + target); //$NON-NLS-1$
          }
        }
      }
    }
  }
View Full Code Here

Examples of java.util.prefs.BackingStoreException

    if (pathForNode.exists())
    {
      final File target = new File(pathForNode, "prefs.properties");//NON-NLS
      if (target.delete() == false)
      {
        throw new BackingStoreException("Unable to delete node-backend");
      }
      if (pathForNode.delete() == false)
      {
        throw new BackingStoreException("Unable to delete node-backend");
      }
    }
  }
View Full Code Here

Examples of java.util.prefs.BackingStoreException

      return encoded.toString();
    }
    catch (NumberFormatException nfe)
    {
      nfe.printStackTrace();
      throw new BackingStoreException("Failed to decode name: " + path);
    }
  }
View Full Code Here

Examples of org.apache.sis.util.collection.BackingStoreException

        if (object instanceof Statistics[]) try {
            format((Statistics[]) object, toAppendTo);
            return toAppendTo;
        } catch (IOException e) {
            // Same exception handling than in the super-class.
            throw new BackingStoreException(e);
        } else {
            return super.format(object, toAppendTo, pos);
        }
    }
View Full Code Here

Examples of org.apache.sis.util.collection.BackingStoreException

            /*
             * Should never happen when writing into a StringBuffer, unless the user
             * override the format(Object, Appendable) method. We do not rethrown an
             * AssertionError because of this possibility.
             */
            throw new BackingStoreException(e);
        }
        return toAppendTo;
    }
View Full Code Here

Examples of org.apache.sis.util.collection.BackingStoreException

            final Properties props = new Properties();
            try {
                props.load(in);
                in.close();
            } catch (IOException e) {
                throw new BackingStoreException(e);
            } catch (IllegalArgumentException e) {
                throw new BackingStoreException(e);
            }
            typeForNames = new HashMap<Object,Object>(props);
        }
        final Object value = typeForNames.get(identifier);
        if (value == null || value instanceof Class<?>) {
View Full Code Here

Examples of org.glassfish.enterprise.ha.store.BackingStoreException

                            new Class[]{Properties.class});
                    factory = (BackingStoreFactory)
                            con.newInstance(regInfo.props);
                    factories.put(type, factory);
                } catch (NoSuchMethodException nme) {
                    throw new BackingStoreException(nme.getMessage(), nme.getCause());
                } catch (InvocationTargetException ite) {
                    throw new BackingStoreException(ite.getMessage(), ite.getCause());
                }
            } else {
                throw new BackingStoreException("Backing store for " +
                        "persistence-type " + type + " is not registered.");
            }
        }
        return factory;
    }
View Full Code Here

Examples of org.glassfish.ha.store.api.BackingStoreException

            persistenceStoreType = "noop";
            try {
                factory = habitat.getComponent(BackingStoreFactory.class, persistenceStoreType);
            } catch (Exception ex2) {
                _logger.log(Level.WARNING, "Could not instantiate backing store factory for type: " + persistenceStoreType, ex2);
                throw new BackingStoreException("Could not instantiate BackingStore Factory for persistence type: " + persistenceStoreType, ex);
            }
        }

        BackingStoreConfiguration<Serializable, SimpleMetadata> conf = new BackingStoreConfiguration<Serializable, SimpleMetadata>();
        String storeName = ejbDescriptor.getName() + "-" + ejbDescriptor.getUniqueId() + "-BackingStore";

        _logger.log(Level.INFO, "StatefulContainerBuilder.buildStoreManager() storeName: " + storeName);
       
        String subDirName = "";

        subDirName += ejbDescriptor.getName() + "-" + ejbDescriptor.getUniqueId();
       
        conf.setShortUniqueName(""+ejbDescriptor.getUniqueId()).setStoreName(storeName)
                .setStoreType(persistenceStoreType)
                .setBaseDirectory(new File(ejbContainerConfig.getSessionStore(), subDirName))
                .setKeyClazz(Serializable.class)
                .setValueClazz(SimpleMetadata.class)
                .setClassLoader(StatefulContainerBuilder.class.getClassLoader());


        Map<String, Object> vendorMap = conf.getVendorSpecificSettings();
        vendorMap.put("local.caching", true);
        vendorMap.put("start.gms", false);
        vendorMap.put("async.replication", asyncReplication);
        vendorMap.put("broadcast.remove.expired", false);
        vendorMap.put("value.class.is.thread.safe", true);
        vendorMap.put("key.transformer", keyGen);

        if (gmsAdapterService != null) {
            GMSAdapter gmsAdapter = gmsAdapterService.getGMSAdapter();
            if (gmsAdapter != null) {
                conf.setClusterName(gmsAdapter.getClusterName());
                conf.setInstanceName(gmsAdapter.getModule().getInstanceName());
            }
        }


        try {
            sfsbContainer.setSfsbHaPersistenceType(persistenceStoreType);
            this.backingStore = factory.createBackingStore(conf);
        } catch (Exception ex) {
            _logger.log(Level.WARNING, "Could not instantiate BackingStore for persistence type: " + persistenceStoreType, ex);
            throw new BackingStoreException("Could not instantiate BackingStore for persistence type: " + persistenceStoreType, ex);
        }
        _logger.log(Level.WARNING, "StatefulContainerbuilder instantiated store: " +
            backingStore + "; ha-enabled: " + HAEnabled + " ==> " + conf);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.