Package org.apache.openjpa.slice

Examples of org.apache.openjpa.slice.Slice


  public DistributedJDBCConfiguration getConfiguration() {
      return (DistributedJDBCConfiguration)super.getConfiguration();
  }
 
  public Slice addSlice(String name, Map properties) {
      Slice slice = ((DistributedJDBCConfigurationImpl)getConfiguration()).addSlice(name, properties);
        ClassLoader loader = AccessController.doPrivileged(J2DoPrivHelper.getContextClassLoaderAction());
        synchronizeMappings(loader, (JDBCConfiguration)slice.getConfiguration());
        Collection<Broker> brokers = getOpenBrokers();
        for (Broker broker : brokers) {
            ((DistributedBroker)broker).getDistributedStoreManager().addSlice(slice);
        }
      return slice;
View Full Code Here


    public DistributedJDBCStoreManager(DistributedJDBCConfiguration conf) {
        super();
        _conf = conf;
        _slices = new ArrayList<SliceStoreManager>();
        List<Slice> slices = conf.getSlices(Slice.Status.ACTIVE);
        Slice masterSlice = conf.getMasterSlice();
        for (Slice slice : slices) {
            SliceStoreManager store = new SliceStoreManager(slice);
            _slices.add(store);
            if (slice == masterSlice) {
                _master = store;
View Full Code Here

        String unit = getPersistenceUnitName(original);
        for (String key : sliceNames) {
            JDBCConfiguration child = new JDBCConfigurationImpl();
            child.fromProperties(createSliceProperties(original, key));
            child.setId(unit+DOT+key);
            Slice slice = new Slice(key, child);
            _slices.add(slice);
            if (log.isTraceEnabled())
                log.trace(_loc.get("slice-configuration", key, child
                        .toProperties(false)));
        }
View Full Code Here

        List<String> sliceNames = findSlices(original);
        if (sliceNames.isEmpty()) {
            throw new UserException(_loc.get("slice-none-configured"));
        }
        for (String key : sliceNames) {
            Slice slice = newSlice(key, original);
            _slices.add(slice);
        }
        setMaster(original);
    }
View Full Code Here

    protected Slice newSlice(String key, Map original) {
        JDBCConfiguration child = new JDBCConfigurationImpl();
        child.fromProperties(createSliceProperties(original, key));
        child.setId(unit+DOT+key);
        setDiagnosticContext(child, unit+DOT+key);
        Slice slice = new Slice(key, child);
        if (log.isTraceEnabled())
            log.trace(_loc.get("slice-configuration", key, child
                    .toProperties(false)));
        return slice;
    }
View Full Code Here

        for (Object key : newProps.keySet()) {
            if (!String.class.isInstance(key)
             && key.toString().startsWith(prefix))
                throw new UserException(_loc.get("slice-add-wrong-key", key));
        }
        Slice slice = getSlice(name);
        if (slice != null)
            throw new UserException(_loc.get("slice-exists", name));
        Map<String,String> original = super.toProperties(true);
        original.putAll(newProps);
         slice = newSlice(name, original);
View Full Code Here

  public DistributedJDBCConfiguration getConfiguration() {
      return (DistributedJDBCConfiguration)super.getConfiguration();
  }
 
  public Slice addSlice(String name, Map properties) {
      Slice slice = getConfiguration().addSlice(name, properties);
        ClassLoader loader = AccessController.doPrivileged(
            J2DoPrivHelper.getContextClassLoaderAction());
        synchronizeMappings(loader, (JDBCConfiguration)slice.
                getConfiguration());
      return slice;
  }
View Full Code Here

    public DistributedJDBCStoreManager(DistributedJDBCConfiguration conf) {
        super();
        _conf = conf;
        _slices = new ArrayList<SliceStoreManager>();
        List<Slice> slices = conf.getSlices(Slice.Status.ACTIVE);
        Slice masterSlice = conf.getMasterSlice();
        for (Slice slice : slices) {
            SliceStoreManager store = new SliceStoreManager(slice);
            _slices.add(store);
            if (slice == masterSlice) {
                _master = store;
View Full Code Here

        child.setId(getId()+DOT+key);
        setDiagnosticContext(child);
        child.setMappingDefaults(this.getMappingDefaultsInstance());
        child.setDataCacheManager(this.getDataCacheManagerInstance());
        child.setMetaDataRepository(this.getMetaDataRepositoryInstance());
        Slice slice = new Slice(key, child);
        Log log = getConfigurationLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get("slice-configuration", key, child
                    .toProperties(false)));
        return slice;
View Full Code Here

        for (Object key : newProps.keySet()) {
            if (!String.class.isInstance(key)
             && key.toString().startsWith(prefix))
                throw new UserException(_loc.get("slice-add-wrong-key", key));
        }
        Slice slice = getSlice(name);
        if (slice != null)
            throw new UserException(_loc.get("slice-exists", name));
        Map<String,String> original = super.toProperties(true);
        original.putAll(newProps);
         slice = newSlice(name, original);
View Full Code Here

TOP

Related Classes of org.apache.openjpa.slice.Slice

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.