Package com.sun.sgs.service.store

Examples of com.sun.sgs.service.store.DataStore


      logger.log(Level.CONFIG,
           "Creating DataServiceImpl properties:{0}, " +
           "systemRegistry:{1}, txnProxy:{2}",
           properties, systemRegistry, txnProxy);
  }
  DataStore storeToShutdown = null;
  try {
      PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);
      appName = wrappedProps.getProperty(StandardProperties.APP_NAME);
      if (appName == null) {
    throw new IllegalArgumentException(
        "The " + StandardProperties.APP_NAME +
        " property must be specified");
      } else if (systemRegistry == null) {
    throw new NullPointerException(
        "The systemRegistry argument must not be null");
      } else if (txnProxy == null) {
    throw new NullPointerException(
        "The txnProxy argument must not be null");
      }
      debugCheckInterval = wrappedProps.getIntProperty(
    DEBUG_CHECK_INTERVAL_PROPERTY, Integer.MAX_VALUE);
      detectModifications = wrappedProps.getBooleanProperty(
    DETECT_MODIFICATIONS_PROPERTY, Boolean.TRUE);
      String dataStoreClassName = wrappedProps.getProperty(
    DATA_STORE_CLASS_PROPERTY);
      optimisticWriteLocks = wrappedProps.getBooleanProperty(
    OPTIMISTIC_WRITE_LOCKS, Boolean.FALSE);
      trackStaleObjects = wrappedProps.getBooleanProperty(
    TRACK_STALE_OBJECTS_PROPERTY, Boolean.FALSE);
      TaskScheduler taskScheduler =
    systemRegistry.getComponent(TaskScheduler.class);
      Identity taskOwner = txnProxy.getCurrentOwner();
      scheduler = new DelegatingScheduler(taskScheduler, taskOwner);
            NodeType nodeType =
                wrappedProps.getEnumProperty(StandardProperties.NODE_TYPE,
                                             NodeType.class,
                                             NodeType.singleNode);

      AccessCoordinator accessCoordinator =
    systemRegistry.getComponent(AccessCoordinator.class);     
      DataStore baseStore;
      if (dataStoreClassName != null) {
    baseStore = wrappedProps.getClassInstanceProperty(
        DATA_STORE_CLASS_PROPERTY, DataStore.class,
        new Class[] { Properties.class, AccessCoordinator.class },
        properties, accessCoordinator);
View Full Code Here


         ComponentRegistry systemRegistry,
         TransactionProxy txnProxy)
  throws Exception
    {
        logger.log(Level.CONFIG, "Creating DataServiceImpl");
  DataStore storeToShutdown = null;
  try {
      PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);
      appName = wrappedProps.getProperty(StandardProperties.APP_NAME);
      if (appName == null) {
    throw new IllegalArgumentException(
        "The " + StandardProperties.APP_NAME +
        " property must be specified");
      } else if (systemRegistry == null) {
    throw new NullPointerException(
        "The systemRegistry argument must not be null");
      } else if (txnProxy == null) {
    throw new NullPointerException(
        "The txnProxy argument must not be null");
      }
      debugCheckInterval = wrappedProps.getIntProperty(
    DEBUG_CHECK_INTERVAL_PROPERTY, Integer.MAX_VALUE);
      detectModifications = wrappedProps.getBooleanProperty(
    DETECT_MODIFICATIONS_PROPERTY, Boolean.TRUE);
      String dataStoreClassName = wrappedProps.getProperty(
    DATA_STORE_CLASS_PROPERTY);
      optimisticWriteLocks = wrappedProps.getBooleanProperty(
    OPTIMISTIC_WRITE_LOCKS, Boolean.FALSE);
      trackStaleObjects = wrappedProps.getBooleanProperty(
    TRACK_STALE_OBJECTS_PROPERTY, Boolean.FALSE);
            NodeType nodeType =
                wrappedProps.getEnumProperty(StandardProperties.NODE_TYPE,
                                             NodeType.class,
                                             NodeType.singleNode);

      DataStore baseStore;
      if (dataStoreClassName != null) {
    baseStore = wrappedProps.getClassInstanceProperty(
        DATA_STORE_CLASS_PROPERTY, DataStore.class,
        new Class[] { Properties.class, ComponentRegistry.class,
          TransactionProxy.class },
View Full Code Here

    /* -- Other methods -- */

    /** Gets a DataStore using the default properties. */
    protected DataStore getDataStore() throws Exception {
  DataStore store = new DataStoreProfileProducer(
      new DataStoreImpl(props, env.systemRegistry, txnProxy),
      DummyProfileCoordinator.getCollector());
        DummyProfileCoordinator.startProfiling();
  return store;
    }
View Full Code Here

    }

    /** Create a DataStoreClient. */
    @Override
    protected DataStore createDataStore(Properties props) throws Exception {
  DataStore store = new DataStoreProfileProducer(
      new DataStoreClient(props, systemRegistry, txnProxy),
      DummyProfileCoordinator.getCollector());
  DummyProfileCoordinator.startProfiling();
  return store;
    }
View Full Code Here

            throw new RuntimeException("Failed to create sub-dir: " + dataDir);
        }
        Properties props = createProperties(
            StandardProperties.APP_NAME, "Foo",
            StandardProperties.APP_ROOT, rootDir);
        DataStore testStore = createDataStore(props);
        testStore.shutdown();
    }
View Full Code Here

  return createDataStore(props);
    }

    /** Creates a DataStore using the specified properties. */
    protected DataStore createDataStore(Properties props) throws Exception {
  DataStore store = new DataStoreProfileProducer(
      new DataStoreImpl(props, systemRegistry, txnProxy),
      DummyProfileCoordinator.getCollector());
  DummyProfileCoordinator.startProfiling();
  return store;
    }
View Full Code Here

  }
        props.setProperty(StandardProperties.NODE_TYPE, nodeType);
  props.setProperty(DataStoreNetPackage + ".server.host", host);
  props.setProperty(DataStoreNetPackage + ".server.port",
        String.valueOf(port));
  DataStore store = new DataStoreProfileProducer(
      new DataStoreClient(props, env.systemRegistry, txnProxy),
      DummyProfileCoordinator.getCollector());
  DummyProfileCoordinator.startProfiling();
  return store;
    }
View Full Code Here

         ComponentRegistry systemRegistry,
         TransactionProxy txnProxy)
  throws Exception
    {
        logger.log(Level.CONFIG, "Creating DataServiceImpl");
  DataStore storeToShutdown = null;
  try {
      PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);
      appName = wrappedProps.getProperty(StandardProperties.APP_NAME);
      if (appName == null) {
    throw new IllegalArgumentException(
        "The " + StandardProperties.APP_NAME +
        " property must be specified");
      } else if (systemRegistry == null) {
    throw new NullPointerException(
        "The systemRegistry argument must not be null");
      } else if (txnProxy == null) {
    throw new NullPointerException(
        "The txnProxy argument must not be null");
      }
      this.txnProxy = txnProxy;
      debugCheckInterval = wrappedProps.getIntProperty(
    DEBUG_CHECK_INTERVAL_PROPERTY, Integer.MAX_VALUE);
      detectModifications = wrappedProps.getBooleanProperty(
    DETECT_MODIFICATIONS_PROPERTY, Boolean.TRUE);
      String dataStoreClassName = wrappedProps.getProperty(
    DATA_STORE_CLASS_PROPERTY);
      optimisticWriteLocks = wrappedProps.getBooleanProperty(
    OPTIMISTIC_WRITE_LOCKS, Boolean.FALSE);
      trackStaleObjects = wrappedProps.getBooleanProperty(
    TRACK_STALE_OBJECTS_PROPERTY, Boolean.FALSE);
            NodeType nodeType =
                wrappedProps.getEnumProperty(StandardProperties.NODE_TYPE,
                                             NodeType.class,
                                             NodeType.singleNode);

      DataStore baseStore;
      if (dataStoreClassName != null) {
    baseStore = wrappedProps.getClassInstanceProperty(
        DATA_STORE_CLASS_PROPERTY, DataStore.class,
        new Class[] { Properties.class, ComponentRegistry.class,
          TransactionProxy.class },
View Full Code Here

    {
        Field storeField = DataServiceImpl.class.getDeclaredField("store");
        storeField.setAccessible(true);
  DataStoreProfileProducer profileWrapper =
      (DataStoreProfileProducer) storeField.get(service);
  DataStore dataStore = profileWrapper.getDataStore();
  if (dataStore instanceof DataStoreClient) {
      DataStoreClient dsClient = (DataStoreClient) dataStore;
      Field serverPortField =
    DataStoreClient.class.getDeclaredField("serverPort");
      serverPortField.setAccessible(true);
View Full Code Here

    }

    /** Create a {@link CachingDataStore}. */
    @Override
    protected DataStore createDataStore(Properties props) throws Exception {
  DataStore store = new DataStoreProfileProducer(
      new CachingDataStore(props, systemRegistry, txnProxy),
      DummyProfileCoordinator.getCollector());
  DummyProfileCoordinator.startProfiling();
  store.ready();
  return store;
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.service.store.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.