start sequence writes the ID of the XADataLogger to identify the content
of the logger

@param dataRecorder
DataRecorder that uses /operates on the current physical
logger
779138
private void writeStartSequence(IXADataRecorder dataRecorder)
			throws IOException, InterruptedException {

		LogRecordWriter writer = new LogRecordWriter();
		writer.writeLong(dataRecorder.getXADataRecorderId());
		dataRecorder.writeRollbackData(writer.toByteArray());
	}
99229
public void log() {
    if (logger != null) {
      if (registry != null) {
        if (isClient()) {
          recordClientMetrics();
        } else {
          recordServerMetrics();
        }
      }
      if (inflightId != null) {
        logger.inflightRequests(inflightId).decrementAndGet();
      }

      logger.log(this);
    } else {
      reset();
    }
  }
387519
protected void publish(final LogRecord record) {
    if(record instanceof ProgressLogRecord) {
      ProgressLogRecord preg = (ProgressLogRecord) record;
      Progress prog = preg.getProgress();
      JProgressBar pbar = getOrCreateProgressBar(prog);
      updateProgressBar(prog, pbar);
      if(prog.isComplete()) {
        removeProgressBar(prog, pbar);
      }
      if(prog.isComplete() || prog instanceof StepProgress) {
        publishTextRecord(record);
      }
    }
    else {
      publishTextRecord(record);
    }
  }
1096074
@Override
   public void release() {
    	rewind();
        try {
            this.dataLogger.prepareForWrite(this.getXADataRecorderId());
        } catch (Exception e) {
            throw new DelegatedRuntimeException(e);
        }

   	 if (dataRecorderLifycycleListner != null) {
            this.dataRecorderLifycycleListner.recorderDataRecorderReleased(this);
        }

    }
542060
void start(Handler<ConnectionOutputBatch> startHandler) {
    connection.doBatchStart(id, args);
    this.startHandler = startHandler;
  }
1230869
@Override
  public void write(JdbcEntryData record) throws IOException {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Writing " + record);
    }
    try {
      this.commands.insert(this.databaseName, this.tableName, record);
      this.recordWrittenCount++;
    } catch (Exception e) {
      this.failed = true;
      throw new RuntimeException(e);
    }
  }
1317089
@Override
  public void publish(LogRecord record) {
    // Convert Log
    Throwable throwable = record.getThrown();
    if (throwable != null) {
      synchronized (ExceptionRepositoryAsMetrics.INSTANCE) {
        // We would not include the message if already exceeded the exceptions limit
        if (ExceptionRepositoryAsMetrics.INSTANCE.getExceptionsCount() >= exceptionsLimit) {
          droppedExceptionsCount.incr();
          return;
        }

        // Convert the record
        StringWriter sink = new StringWriter();
        throwable.printStackTrace(new PrintWriter(sink, true));
        String trace = sink.toString();

        Metrics.ExceptionData.Builder exceptionDataBuilder =
            ExceptionRepositoryAsMetrics.INSTANCE.getExceptionInfo(trace);
        exceptionDataBuilder.setCount(exceptionDataBuilder.getCount() + 1);
        exceptionDataBuilder.setLasttime(new Date().toString());
        exceptionDataBuilder.setStacktrace(trace);

        // Can cause NPE and crash HI
        //exceptionDataBuilder.setLogging(record.getMessage());

        if (record.getMessage() == null) {
          exceptionDataBuilder.setLogging("");
        } else {
          exceptionDataBuilder.setLogging(record.getMessage());
        }
      }
    }
  }
406496
private void startStorageAdapter() throws Exception {
        // create the storage adapter that will write our metrics/inventory data to backend storage on server
        this.storageAdapter = new HawkularStorageAdapter();
        this.storageAdapter.initialize(
                feedId,
                configuration.getStorageAdapter(),
                diagnostics,
                httpClientBuilder);

        // provide our storage adapter to the proxies - allows external apps to use them to store its own data
        inventoryStorageProxy.setStorageAdapter(storageAdapter);

        // log our own diagnostic reports
        this.diagnosticsReporter = JBossLoggingReporter.forRegistry(this.diagnostics.getMetricRegistry())
                .convertRatesTo(TimeUnit.SECONDS)
                .convertDurationsTo(TimeUnit.MILLISECONDS)
                .outputTo(Logger.getLogger(getClass()))
                .withLoggingLevel(LoggingLevel.DEBUG)
                .build();

        if (this.configuration.getDiagnostics().isEnabled()) {
            diagnosticsReporter.start(this.configuration.getDiagnostics().getInterval(),
                    this.configuration.getDiagnostics().getTimeUnits());
        }
    }
96196
public void printStartRecordGridData(PrintWriter out, int iPrintOptions)
    {
        out.println(Utility.startTag(XMLTags.DETAIL));
        out.println(Utility.startTag(XMLTags.FILE));
    }
786032
@Override
  public void start()
  {
    LOGGER.debug("Start Loading");
    // validate parameters
    validateParameters();

    if (_op == null)
    {
      this.abort(new ConnectionError("Loader started with no operation"));
      return;
    }

    initDateFormats();

    initQueues();

    if (_is_first_start_call)
    {
      // is this the first start call?

      try
      {
        if (_startTransaction)
        {
          LOGGER.debug("Begin Transaction");
          _processConn.createStatement().execute("begin transaction");
        }
        else
        {
          LOGGER.debug("No Transaction started");
        }
      }
      catch (SQLException ex)
      {
        abort(new Loader.ConnectionError("Failed to start Transaction",
                                         Utils.getCause(ex)));
      }

      if (_truncate)
      {
        truncateTargetTable();
      }

      try
      {
        if (_before != null)
        {
          LOGGER.debug("Running Execute Before SQL");
          _processConn.createStatement().execute(_before);
        }
      }
      catch (SQLException ex)
      {
        abort(new Loader.ConnectionError(
            String.format("Execute Before SQL failed to run: %s", _before),
            Utils.getCause(ex)));
      }
    }
  }
37462
@SuppressWarnings("unused")
  final void startRecording() {
    if (firstTime) {
      Object obj;
      doStartRecording();
      obj = new Object();
      AllocationStats stats = stopRecording(1);
      if (stats.getAllocationCount() != 1 || stats.getAllocationSize() < 1) {
        throw new IllegalStateException(
            String.format("The allocation recording infrastructure appears to be broken. "
                + "Expected to find exactly one allocation of a java/lang/Object instead found %s",
                stats));
      }
      firstTime = false;
    }
    doStartRecording();
  }
1118359
public void storeRecord(RepositoryLogRecord record) {
		if (isClosed) {
			throw new IllegalStateException("This instance of the exporter is already closed");
		}
		if (!isInitialized) {
			throw new IllegalStateException("This instance of the exporter does not have header information yet");
		}
		String formatRecord = formatter.formatRecord(record);
		out.print(formatRecord);
		out.print(formatter.getLineSeparator());
	}
766651
public void startDocument() throws ODataRenderException {

        outputStream = new ByteArrayOutputStream();
        try {
            xmlWriter = xmlOutputFactory.createXMLStreamWriter(outputStream, UTF_8.name());
            xmlWriter.writeStartDocument(UTF_8.name(), XML_VERSION);
            xmlWriter.setPrefix(METADATA, ODATA_METADATA_NS);
        } catch (XMLStreamException e) {
            LOG.error("Not possible to start stream XML");
            throw new ODataRenderException("Not possible to start stream XML: ", e);
        }
    }
101133
public void startLogging(RequestLogger logger) {
    ResourceServices services = getServices();
    if (services != null)
      services.startLogging(logger);
  }
614396
function startRecording() {
  if (room !== undefined) {
    if (!recording) {
      room.startRecording(localStream, (id) => {
        recording = true;
        recordingId = id;
      });
    } else {
      room.stopRecording(recordingId);
      recording = false;
    }
  }
}
876073
public void start() throws PersistenceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start");

        String logFileName        = null;
        String permanentStoreFileName = null;
        String temporaryStoreFileName = null;

        String logFileProperty = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_LOG_FILE_NAME,
                                                 MessageStoreConstants.PROP_OBJECT_MANAGER_LOG_FILE_NAME_DEFAULT);
        String logPrefix       = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_LOG_FILE_PREFIX,
                                                 _configuration.getObjectManagerLogDirectory());
        String logSizeStr      = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_LOG_FILE_SIZE, null);

        long logSize = _configuration.getObjectManagerLogSize();
        if (logSizeStr != null) logSize = Long.parseLong(logSizeStr);

        // Permanent Object Store properties
        String permanentStoreProperty       = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_NAME,
                                                              MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_NAME_DEFAULT);
        String permanentStorePrefix         = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_PREFIX,
                                                              _configuration.getObjectManagerPermanentStoreDirectory());

        // Temporary Object Store properties
        String temporaryStoreProperty       = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_NAME,
                                                              MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_NAME_DEFAULT);
        String temporaryStorePrefix         = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_PREFIX,
                                                              _configuration.getObjectManagerTemporaryStoreDirectory());
        // 727994
        // Set _hasRedeliveryCountColumn to true because unlike datastore where we
        // check if redelivery count column exist or not we dont have to do the
        // same check for filestore as that column will be automatically available
        // depending upon the version of WAS
        // Persisting RedeliveryCount feature was introduced from WAS v8.5 onwards
        _ms.setRedeliveryCountColumn(true);

        // Defect 496893
        // First we need to start up our ObjectManager instance. We will retry this
        // for a pre-determined time period in order to allow for connectivity problems
        // to the file store files.
        boolean connected = false;
        long   retryLimit = System.currentTimeMillis() + _timeouts.getRetryTimeLimit();
        // Defect 549131
        // Set our starting flag so that we can detect if we are asked to 
        // stop while attempting to start the ObjectManager.
        _starting = true;
        do
        {
            // The directory creation needs to be in the retry loop as if we can't connect
            // once then the directory would never get created and may cause us to fail to
            // find our path even if the disc is available.
            logPrefix = createDirectoryPath(logPrefix);

            if (logPrefix.endsWith(File.separator))
            {
                logFileName = logPrefix+logFileProperty;
            }
            else
            {
                logFileName = logPrefix+File.separator+logFileProperty;
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { 
            	SibTr.debug(this, tc, "User directory for ObjectManager log file defined: "+logPrefix);
            	SibTr.debug(this, tc, "The file store is attempting to initalise its log file:" + logFileName);
            }

            // As we do not know earlier whether we have access to our file system we need to do
            // our path name creation at this point. It still does not save us if our store
            // files and log file are on completely seperately network accessible locations
            // but it is slightly safer than doing it before the log starts up.
            permanentStorePrefix = createDirectoryPath(permanentStorePrefix);
            temporaryStorePrefix = createDirectoryPath(temporaryStorePrefix);

            // Figure out the real file names where we expect to find the permanent and temporary stores.
            // We use them to build the ObjectStoreLocations map to pass into the ObjectManager.
            if (permanentStorePrefix.endsWith(File.separator))
            {
                permanentStoreFileName = permanentStorePrefix+permanentStoreProperty;
            }
            else
            {
                permanentStoreFileName = permanentStorePrefix+File.separator+permanentStoreProperty;
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Filename for ObjectManager permanent store is: "+permanentStoreFileName);

            if (temporaryStorePrefix.endsWith(File.separator))
            {
                temporaryStoreFileName = temporaryStorePrefix+temporaryStoreProperty;
            }
            else
            {
                temporaryStoreFileName = temporaryStorePrefix+File.separator+temporaryStoreProperty;
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Filename for ObjectManager temporary store is: "+temporaryStoreFileName);

            // Populate the Map of ObjectStoreLocations
            storeLocations.put(PERMANENT_STORE_NAME, permanentStoreFileName);
            storeLocations.put(TEMPORARY_STORE_NAME, temporaryStoreFileName);

            try
            {
                // Defect 549131
                // Synchronize with the stop thread at this point so that one 
                // of two things happen:
                //  1) The stop thread gets in first. We need to avoid starting an object
                //     manager altogether.
                //  2) The start thread gets in first. The stop thread needs to wait so
                //     that its stop processing has the handle to the objectmanager to 
                //     call stop on.
                synchronized(this)
                {
                    if (_starting)
                    {
                        // Do we need to start from an empty file store or can
                        // we startup using an existing set of data?
                        // Either way, we need to register ourselves for any event callbacks.
                        if (_configuration.isCleanPersistenceOnStart())
                        {
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Clean starting the Persistence Layer.");
        
                            _objectManager = new ObjectManager(logFileName, ObjectManager.LOG_FILE_TYPE_CLEAR, storeLocations, new ObjectManagerEventCallback[]{this});
                        }
                        else
                        {
                            _objectManager = new ObjectManager(logFileName, ObjectManager.LOG_FILE_TYPE_FILE, storeLocations, new ObjectManagerEventCallback[]{this});
                        }

                        connected = true;
                    }
                }

            }
            catch (PermanentIOException pioe)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(pioe, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:397:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unable to start ObjectManager instance!", pioe);
                SibTr.error(tc, "FILE_STORE_UNEXPECTED_IO_EXCEPTION_SIMS1592");
                // This will drop through to the retry wait below.
            }
            catch (LogFileInUseException lfiue)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(lfiue, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:404:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unable to start ObjectManager instance!", lfiue);
                SibTr.error(tc, "FILE_STORE_LOG_FILE_IN_USE_SIMS1579");
                // This will drop through to the retry wait below.
            }
            catch (NonExistentLogFileException nelfe)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(nelfe, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:411:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unable to start ObjectManager instance!", nelfe);
                SibTr.error(tc, "FILE_STORE_CANNOT_FIND_LOG_FILE_SIMS1580", logFileName);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                throw new SeverePersistenceException("Unable to locate the file path: " + nelfe.getMessage(), nelfe);
            }
            catch (ObjectManagerException ome)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:418:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unexpected exception caught initializing file store!", ome);
                SibTr.error(tc, "FILE_STORE_UNEXPECTED_INITIALISATION_EXCEPTION_SIMS1591");
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                throw new SeverePersistenceException("Unexpected exception caught initializing file store: "+ome.getMessage(), ome);
            }

            // Defect 549131
            // Only go into the retry wait if we are still starting
            if (!connected && _starting)
            {
                // Have we taken longer to create the ObjectManager than our alloted
                // retry period?
                long currentTime = System.currentTimeMillis();
                if (currentTime < retryLimit)
                {
                    SibTr.info(tc, "FILE_STORE_PROBLEM_INITIALISING_LOG_SIMS1582");

                    // If we still have time to retry then we need to wait a while to
                    // avoid a hot loop and then try again.
                    try
                    {
                        synchronized(this)
                        {
                            wait(_timeouts.getRetryWaitTime());
                        }
                    }
                    catch (InterruptedException ie)
                    {
                        // No FFDC Code Needed.
                    }
                }
                else
                {
                    SibTr.error(tc, "FILE_STORE_INITIALISATION_RETRY_LIMIT_EXCEEDED_SIMS1583");

                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                    throw new SeverePersistenceException("Retry time limit reached when starting file store!");
                }
            }
        // Defect 549131
        // If we were already waiting when the stop request came in our
        // notify should pop us out at which point this check will drop
        // us out of the while loop.
        } while (!connected && _starting); 

        // Defect 549131
        // Carry on starting up only if we have not been asked to stop.
        if (_starting)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "The file store has initialised successfully.");
    
            // Note that the the OMgr is now up and running, so we do care if it stops
            _omgrStarted = true;
    
            // Now we need to open our ObjectStores and find our Anchor object.
            // Figure out the size properties
            // Permanent Object Store properties
            String minimumPermanentStoreSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_MINIMUM_SIZE, null);
            String maximumPermanentStoreSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_MAXIMUM_SIZE, null);
    
            long minimumPermanentStoreSize = _configuration.getObjectManagerMinimumPermanentStoreSize();
            if (minimumPermanentStoreSizeStr != null) minimumPermanentStoreSize = Long.parseLong(minimumPermanentStoreSizeStr);
            long maximumPermanentStoreSize = _configuration.getObjectManagerMaximumPermanentStoreSize();
            if (maximumPermanentStoreSizeStr != null) maximumPermanentStoreSize = Long.parseLong(maximumPermanentStoreSizeStr);
    
            boolean isPermanentStoreSizeUnlimited = _configuration.isObjectManagerPermanentStoreSizeUnlimited();
    
            // Temporary Object Store properties
            String minimumTemporaryStoreSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_MINIMUM_SIZE, null);
            String maximumTemporaryStoreSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_MAXIMUM_SIZE, null);
    
            long minimumTemporaryStoreSize = _configuration.getObjectManagerMinimumTemporaryStoreSize();
            if (minimumTemporaryStoreSizeStr != null) minimumTemporaryStoreSize = Long.parseLong(minimumTemporaryStoreSizeStr);
            long maximumTemporaryStoreSize = _configuration.getObjectManagerMaximumTemporaryStoreSize();
            if (maximumTemporaryStoreSizeStr != null) maximumTemporaryStoreSize = Long.parseLong(maximumTemporaryStoreSizeStr);
    
            boolean isTemporaryStoreSizeUnlimited = _configuration.isObjectManagerTemporaryStoreSizeUnlimited();

            // common properties
            String storeFullWaitForCheckPointStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_STORE_FULL_WAIT_FOR_CHECKPOINT,
                                                                   MessageStoreConstants.PROP_OBJECT_MANAGER_STORE_FULL_WAIT_FOR_CHECKPOINT_DEFAULT);
            boolean storeFullWaitForCheckPoint = Boolean.parseBoolean(storeFullWaitForCheckPointStr);


            // Defect 533310
            // Read the object store object cache size properties
            String permanentStoreObjectCacheSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_CACHE_SIZE, 
                                                                      MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_CACHE_SIZE_DEFAULT);
    
            int permanentStoreObjectCacheSize = Integer.parseInt(permanentStoreObjectCacheSizeStr);
    
            String temporaryStoreObjectCacheSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_CACHE_SIZE, 
                                                                      MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_CACHE_SIZE_DEFAULT);
    
            int temporaryStoreObjectCacheSize = Integer.parseInt(temporaryStoreObjectCacheSizeStr);
    
            Transaction transaction = null;
    
            try
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "The file store is attempting to start its permanent store (" + PERMANENT_STORE_NAME + ") and temporary store (" + TEMPORARY_STORE_NAME + ")");
    
                // Defect 298902
                // If we are warm started then we should find an existing
                // set of object stores. If we are cold started then we
                // need to create them.
                if (_objectManager.warmStarted())
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Object Manager Warm Started");
    
                    try
                    {
                        // If we have an 'oldPermanentStoreName' we'll need to open that
                        // and rename it, otherwise we just open the 'proper' name.
                        if (oldPermanentStore == null)
                        {
                            _permanentStore = _objectManager.getObjectStore(PERMANENT_STORE_NAME);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Permanent Store Found");
                        }
                        else
                        {
                            _permanentStore = _objectManager.getObjectStore(oldPermanentStore);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Old Permanent Store Found");
                            _permanentStore.setName(PERMANENT_STORE_NAME);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Old Permanent Store Renamed");
                        }
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                            SibTr.debug(this, tc, "The file stores permanent store has been started successfully.");
    
                        // If we have an 'oldTemporaryStoreName' we'll need to open that
                        // and rename it, otherwise we just open the 'proper' name.
                        if (oldTemporaryStore == null)
                        {
                            _temporaryStore = _objectManager.getObjectStore(TEMPORARY_STORE_NAME);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Temporary Store Found");
                        }
                        else
                        {
                            _temporaryStore = _objectManager.getObjectStore(oldTemporaryStore);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Old Temporary Store Found");
                            _temporaryStore.setName(TEMPORARY_STORE_NAME);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Old Temporary Store Renamed");
                        }

                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                            SibTr.debug(this, tc, "The file stores temporary store has been started successfully.");
    
                        // Set the size of our files.
                        setFileSizesAfterRestart(false,
                                                 minimumPermanentStoreSize, maximumPermanentStoreSize, isPermanentStoreSizeUnlimited,
                                                 minimumTemporaryStoreSize, maximumTemporaryStoreSize, isTemporaryStoreSizeUnlimited,
                                                 logSize);
                    }
                    catch (UnknownObjectStoreException uose)
                    {
                        com.ibm.ws.ffdc.FFDCFilter.processException(uose, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:572:1.81.1.6", this);
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "ObjectStore not found after warm start!", uose);
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                        throw new SeverePersistenceException("ObjectStore not found after warm start!");
                    }
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Object Manager Cold Started");
    
                    // Create the permanent store.
                    _permanentStore = new SingleFileObjectStore(PERMANENT_STORE_NAME, _objectManager, ObjectStore.STRATEGY_KEEP_ALWAYS);
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    	SibTr.debug(this, tc, "The file stores permanent store has been started successfully.");
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Permanent Store Created");
    
                    // Create the temporary store.                                        // Defect 291558, empty this store on restart
                    _temporaryStore = new SingleFileObjectStore(TEMPORARY_STORE_NAME, _objectManager, ObjectStore.STRATEGY_KEEP_UNTIL_NEXT_OPEN);
                    
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    	SibTr.debug(this, tc, "The file stores temporary store has been started successfully.");
                    
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Temporary Store Created");
    
                    // Set the size of our files.
                    setFileSizesAfterRestart(true,
                                             minimumPermanentStoreSize, maximumPermanentStoreSize, isPermanentStoreSizeUnlimited,
                                             minimumTemporaryStoreSize, maximumTemporaryStoreSize, isTemporaryStoreSizeUnlimited,
                                             logSize);
                }

                // set the storeFullWaitForCheckpoint property
                _permanentStore.setStoreFullWaitForCheckPoint(storeFullWaitForCheckPoint);
                _temporaryStore.setStoreFullWaitForCheckPoint(storeFullWaitForCheckPoint);

                // Defect 533310
                // Set the cache sizes on the object stores
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Permanent store object cache size set to: "+permanentStoreObjectCacheSize);
                ((SingleFileObjectStore)_permanentStore).setCachedManagedObjectsSize(permanentStoreObjectCacheSize);
    
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Temporary store object cache size set to: "+temporaryStoreObjectCacheSize);
                ((SingleFileObjectStore)_temporaryStore).setCachedManagedObjectsSize(temporaryStoreObjectCacheSize);
    
    
                // Once we have our ObjectStore references we now need our
                // Anchor object. If we have cold started or done a clean warm
                // start then we need to create the Anchor. If not we should
                // find it in the ObjectManager.
                _anchorToken = _objectManager.getNamedObject("Anchor", null);
    
                if (_anchorToken != null)
                {
                    _anchor = (Anchor)_anchorToken.getManagedObject();
    
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Stored Anchor Found");
                }
                else
                {
                    // If we didn't manage to create the Anchor last time
                    // then we need to do it now.
                    transaction = _objectManager.getTransaction();
    
                    // Create and allocate a new Anchor.
                    _anchor      = new Anchor();
                    _anchorToken = _permanentStore.allocate(_anchor);
    
                    // Add Anchor to transaction.
                    transaction.add(_anchor);
    
                    // Add Anchor's token to the ObjectManager as a named object.
                    _objectManager.putNamedObject("Anchor", _anchorToken, transaction);
    
                    transaction.commit(false);
    
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Stored Anchor Created");
                }
            }
            catch (ObjectManagerException ome)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:647:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unexpected exception caught starting permanent and temporary stores!", ome);
    
                if (transaction != null)
                {
                    try
                    {
                        // Clean up our ObjectManager work.
                        transaction.backout(false);
                    }
                    catch (ObjectManagerException e)
                    {
                        com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:659:1.81.1.6", this);
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Exception caught backing out persistent message store startup work!", e);
                    }
                }
    
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                throw new SeverePersistenceException("Unexpected exception caught starting permanent and temporary stores: "+ome.getMessage(), ome);
            }
    
            // Check the ME_UUID and update our INC_UUID.
            // If we are successful then carry on with startup.
            if (checkAndUpdateMEOwner(_meOwner))
            {
                // Start the unique key generator manager.
                _uniqueKeyManager.start(_anchor, _objectManager, _permanentStore);
    
                // Defect 530772
                // Create the batching context factory.
                _batchingContextFactory = new BatchingContextFactoryImpl(_objectManager, _temporaryStore);
    
                // Create and start the spill dispatcher.
                _spillDispatcher = new SpillDispatcher(_ms, _batchingContextFactory);
                _spillDispatcher.start();
    
                // Defect 363755
                // Only become available once we have finished starting.
                _available = true;
                
                if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "The file store has started successfully.");
            }
        } // if (_starting)
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Startup processing halted as a stop was requested!");
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
            throw new PersistenceException("Startup processing halted as a stop was requested!");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
    }
389885
public void startRecording() {
        if (mState != STATE.INITIALIZED) {
            Log.e(TAG, "startRecording called in invalid state. Ignoring");
            return;
        }
        synchronized (mReadyForFrameFence) {
            mFrameNum = 0;
            mRecording = true;
            mState = STATE.RECORDING;
        }
    }