Package org.apache.jackrabbit.core.data

Examples of org.apache.jackrabbit.core.data.DataStore


            log.error("Error while closing Version Manager.", e);
        }

        repDescriptors.clear();

        DataStore dataStore = context.getDataStore();
        if (dataStore != null) {
            try {
                // close the datastore
                dataStore.close();
            } catch (DataStoreException e) {
                log.error("error while closing datastore", e);
            }
        }
View Full Code Here


                    Node child = children.item(i);
                    if (child.getNodeType() == Node.ELEMENT_NODE
                            && DATA_STORE_ELEMENT.equals(child.getNodeName())) {
                        BeanConfig bc =
                            parseBeanConfig(parent, DATA_STORE_ELEMENT);
                        DataStore store = bc.newInstance(DataStore.class);
                        store.init(directory);
                        return store;
                    }
                }
                return null;
            }
View Full Code Here

            // Create item state cache manager
            context.setItemStateCacheFactory(
                    new ManagedMLRUItemStateCacheFactory(cacheMgr));

            DataStore dataStore = repConfig.getDataStore();
            if (dataStore != null) {
                context.setDataStore(dataStore);
            }

            context.setWorkspaceManager(new WorkspaceManager(this));
View Full Code Here

            log.error("Error while closing Version Manager.", e);
        }

        repDescriptors.clear();

        DataStore dataStore = context.getDataStore();
        if (dataStore != null) {
            try {
                // close the datastore
                dataStore.close();
            } catch (DataStoreException e) {
                log.error("error while closing datastore", e);
            }
        }
View Full Code Here

    private Logger log = LoggerFactory.getLogger(getClass());

    private DataStore dataStore;

    protected void activate(ComponentContext context, Map<String, Object> config) throws RepositoryException {
        DataStore ds = createDataStore(context, config);

        String homeDir = lookup(context, PROP_HOME);
        if (homeDir != null) {
            log.info("Initializing the DataStore with homeDir [{}]", homeDir);
        }
        PropertiesUtil.populate(ds, config, false);
        ds.init(homeDir);
        this.dataStore = new DataStoreBlobStore(ds);

        Dictionary<String, String> props = new Hashtable<String, String>();
        props.put(Constants.SERVICE_PID, ds.getClass().getName());

        reg = context.getBundleContext().registerService(new String[]{
                DataStore.class.getName(),
                BlobStore.class.getName(),
                GarbageCollectableBlobStore.class.getName()
View Full Code Here

            private BlobStore getBlobStore() {

                try {
                    String className = System.getProperty("dataStore");
                    if(className != null){
                        DataStore ds = Class.forName(className).asSubclass(DataStore.class).newInstance();
                        PropertiesUtil.populate(ds, getConfig(), false);
                        ds.init(null);
                        blobStore = new DataStoreBlobStore(ds);
                    }
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
View Full Code Here

            // Create item state cache manager
            context.setItemStateCacheFactory(
                    new ManagedMLRUItemStateCacheFactory(cacheMgr));

            DataStore dataStore = repConfig.getDataStore();
            if (dataStore != null) {
                context.setDataStore(dataStore);
            }

            context.setWorkspaceManager(new WorkspaceManager(this));
View Full Code Here

            log.error("Error while closing Version Manager.", e);
        }

        repDescriptors.clear();

        DataStore dataStore = context.getDataStore();
        if (dataStore != null) {
            try {
                // close the datastore
                dataStore.close();
            } catch (DataStoreException e) {
                log.error("error while closing datastore", e);
            }
        }
View Full Code Here

    private Logger log = LoggerFactory.getLogger(getClass());

    private DataStore dataStore;

    protected void activate(ComponentContext context, Map<String, Object> config) throws RepositoryException {
        DataStore ds = createDataStore(context, config);
        boolean encodeLengthInId = PropertiesUtil.toBoolean(config.get(PROP_ENCODE_LENGTH), true);
        int cacheSizeInMB = PropertiesUtil.toInteger(config.get(PROP_CACHE_SIZE), DataStoreBlobStore.DEFAULT_CACHE_SIZE);
        String homeDir = lookup(context, PROP_HOME);
        if (homeDir != null) {
            log.info("Initializing the DataStore with homeDir [{}]", homeDir);
        }
        PropertiesUtil.populate(ds, config, false);
        ds.init(homeDir);
        this.dataStore = new DataStoreBlobStore(ds, encodeLengthInId, cacheSizeInMB);
        PropertiesUtil.populate(dataStore, config, false);

        Dictionary<String, String> props = new Hashtable<String, String>();
        props.put(Constants.SERVICE_PID, ds.getClass().getName());

        reg = context.getBundleContext().registerService(new String[]{
                BlobStore.class.getName(),
                GarbageCollectableBlobStore.class.getName()
        }, dataStore , props);
View Full Code Here

    @Test
    public void testInlineBinary() throws DataStoreException, IOException {
        int maxInlineSize = 300;

        DataStore mockedDS = mock(DataStore.class);
        when(mockedDS.getMinRecordLength()).thenReturn(maxInlineSize);
        DataStoreBlobStore ds = new DataStoreBlobStore(mockedDS);

        byte[] data = new byte[maxInlineSize];
        new Random().nextBytes(data);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.data.DataStore

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.