Package com.sun.sgs.impl.sharedutil

Examples of com.sun.sgs.impl.sharedutil.PropertiesWrapper


        super(props, registry, proxy, logger);


        logger.log(Level.CONFIG, "Creating UniverseService properties:{0}",
                   props);
        PropertiesWrapper wrappedProps = new PropertiesWrapper(props);

        // read properties
        cellLoadCount = wrappedProps.getIntProperty(CELL_LOAD_PROP,
                                                    CELL_LOAD_DEFAULT);

        // create the transaction context factory
        ctxFactory = new TransactionContextFactoryImpl(proxy);
View Full Code Here


        super(props, registry, proxy, logger);


        logger.log(Level.CONFIG, "Creating CellExportService properties:{0}",
                   props);
        PropertiesWrapper wrappedProps = new PropertiesWrapper(props);

        // read property values
        exportOnStartup = wrappedProps.getProperty(EXPORT_ON_STARTUP_PROP);

        // create the transaction context factory
        ctxFactory = new TransactionContextFactoryImpl(proxy);

        try {
View Full Code Here

  throws IOException, NotBoundException
    {
  super(accessCoordinator, logger, abortLogger);
  logger.log(Level.CONFIG, "Creating DataStoreClient properties:{0}",
       properties);
  PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);
        NodeType nodeType =
                wrappedProps.getEnumProperty(StandardProperties.NODE_TYPE,
                                             NodeType.class,
                                             NodeType.singleNode);
        boolean serverStart = nodeType != NodeType.appNode;
        if (serverStart) {
            // we default to localHost;  this is useful for starting
            // single node systems
            String localHost = InetAddress.getLocalHost().getHostName();
            serverHost = wrappedProps.getProperty(
                SERVER_HOST_PROPERTY,
                wrappedProps.getProperty(
                    StandardProperties.SERVER_HOST, localHost));
        } else {
            // a server host most be specified
            serverHost = wrappedProps.getProperty(
                SERVER_HOST_PROPERTY,
                wrappedProps.getProperty(
                    StandardProperties.SERVER_HOST));
            if (serverHost == null) {
                throw new IllegalArgumentException(
                                           "A server host must be specified");
            }
        }
  int specifiedServerPort = wrappedProps.getIntProperty(
      SERVER_PORT_PROPERTY, DEFAULT_SERVER_PORT, serverStart ? 0 : 1,
      65535);
  maxTxnTimeout = wrappedProps.getLongProperty(
      MAX_TXN_TIMEOUT_PROPERTY, DEFAULT_MAX_TXN_TIMEOUT, 1,
      Long.MAX_VALUE);
  if (serverStart) {
      try {
    localServer = new DataStoreServerImpl(properties);
View Full Code Here

                                  ComponentRegistry registry)
    {

  lastWindowStart = System.currentTimeMillis();

  PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);
  windowSize = wrappedProps.getIntProperty(
      ProfileListener.WINDOW_SIZE_PROPERTY, DEFAULT_WINDOW_SIZE);
  average = wrappedProps.getIntProperty(
      AVERAGE_PROPERTY, DEFAULT_AVERAGE);

  maRunTime = new MovingAverage(average);
  maFailed = new MovingAverage(average);
  maReadyCount = new MovingAverage(average);
View Full Code Here

    {

  taskCount = 0;
  profileSamples = new HashMap<String, Histogram>();

  windowSize = new PropertiesWrapper(properties).
      getIntProperty(ProfileListener.WINDOW_SIZE_PROPERTY,
                           DEFAULT_WINDOW_SIZE);
    }
View Full Code Here

     */
    public SnapshotProfileListener(Properties properties, Identity owner,
                                   ComponentRegistry registry)
        throws IOException
    {
        PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);

        int port = wrappedProps.getIntProperty(PORT_PROPERTY, DEFAULT_PORT);
        networkReporter = new NetworkReporter(port);

        long reportPeriod =
            wrappedProps.getLongProperty(PERIOD_PROPERTY, DEFAULT_PERIOD);
        handle = registry.getComponent(TaskScheduler.class).
            scheduleRecurringTask(new SnapshotRunnable(reportPeriod), owner,
                                  System.currentTimeMillis() + reportPeriod,
                                  reportPeriod);
        handle.start();
View Full Code Here

       Scheduler scheduler)
    {
  super(accessCoordinator, logger, abortLogger);
  logger.log(
      Level.CONFIG, "Creating DataStoreImpl properties:{0}", properties);
  PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);
  String specifiedDirectory =
      wrappedProps.getProperty(DIRECTORY_PROPERTY);
  if (specifiedDirectory == null) {
      String rootDir =
    properties.getProperty(StandardProperties.APP_ROOT);
      if (rootDir == null) {
    throw new IllegalArgumentException(
        "A value for the property " + StandardProperties.APP_ROOT +
        " must be specified");
      }
      specifiedDirectory = rootDir + File.separator + DEFAULT_DIRECTORY;
  }
  /*
   * Use an absolute path to avoid problems on Windows.
   * -tjb@sun.com (02/16/2007)
   */
  directory = new File(specifiedDirectory).getAbsolutePath();
  txnInfoTable = getTxnInfoTable(TxnInfo.class);
  DbTransaction dbTxn = null;
  boolean done = false;
  try {
      File directoryFile = new File(specifiedDirectory).getAbsoluteFile();
            if (!directoryFile.exists()) {
                logger.log(Level.INFO, "Creating database directory : " +
                           directoryFile.getAbsolutePath());
                if (!directoryFile.mkdirs()) {
                    throw new DataStoreException("Unable to create database " +
                                                 "directory : " +
                                                 directoryFile.getName());
                }
      }
            env = wrappedProps.getClassInstanceProperty(
                    ENVIRONMENT_CLASS_PROPERTY,
                    DEFAULT_ENVIRONMENT_CLASS,
                    DbEnvironment.class,
                    new Class<?>[]{
                        String.class, Properties.class, Scheduler.class
View Full Code Here

     */
    public SnapshotParticipantListener(Properties properties, Identity owner,
                                       ComponentRegistry registry)
  throws IOException
    {
  PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);

        participantMap = new HashMap<String, ParticipantCounts>();

        int port = wrappedProps.getIntProperty(PORT_PROPERTY, DEFAULT_PORT);
        networkReporter = new NetworkReporter(port);

        long reportPeriod =
            wrappedProps.getLongProperty(PERIOD_PROPERTY, DEFAULT_PERIOD);
        handle = registry.getComponent(TaskScheduler.class).
            scheduleRecurringTask(new ParticipantRunnable(), owner,
                                  System.currentTimeMillis() + reportPeriod,
                                  reportPeriod);
        handle.start();
View Full Code Here

        this.registry = registry;

        logger.log(Level.CONFIG, "Creating SecurityService properties: {0}",
                   props);
        PropertiesWrapper wrappedProps = new PropertiesWrapper(props);

        // create the transaction context factory
        ctxFactory = new TransactionContextFactory<CellResourceContext>(proxy, NAME) {
            @Override
            protected CellResourceContext createContext(Transaction txn) {
View Full Code Here

        this.registry = registry;

        logger.log(Level.CONFIG, "Creating SecurityService properties: {0}",
                   props);
        PropertiesWrapper wrappedProps = new PropertiesWrapper(props);

        // create the transaction context factory
        ctxFactory = new TransactionContextFactoryImpl(proxy);

        try {
View Full Code Here

TOP

Related Classes of com.sun.sgs.impl.sharedutil.PropertiesWrapper

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.