Package plugins.Freetalk.tasks

Examples of plugins.Freetalk.tasks.PersistentTaskManager


    try {   
      board = getBoardByName(name);
    }
    catch(NoSuchBoardException e) {
      PersistentTaskManager tm = mFreetalk.getTaskManager();
      synchronized(tm) {
      synchronized(Persistent.transactionLock(db)) {
      try {
        board = new Board(name, description, false);
        board.initializeTransient(mFreetalk);
        board.storeWithoutCommit();
        if(logDEBUG) Logger.debug(this, "Created board " + name);
        board.checkedCommit(this);
       
        tm.storeTaskWithoutCommit(new NewBoardTask(board));
      }
      catch(RuntimeException ex) {
        Persistent.checkedRollbackAndThrow(db, this, ex);
        throw ex; // Satisfy the compiler
      }
View Full Code Here


    synchronized(this) {
      m.storeAndCommit();
    }

    if(mFreetalk != null) {
      PersistentTaskManager taskManager = mFreetalk.getTaskManager();
      if(taskManager != null)
        taskManager.onOwnMessagePosted(m);
    }
   
    /* We do not add the message to the boards it is posted to because the user should only see the message if it has been downloaded
     * successfully. This helps the user to spot problems: If he does not see his own messages we can hope that he reports a bug */
   
 
View Full Code Here

   * Deletes all identities whose mLastReceivedFromWoT field does not match the ID of the last fetch (which is stored in mLast(Own)IdentityFetchID)
   */
  @SuppressWarnings("unchecked")
  private void garbageCollectIdentities(boolean ownIdentities) {
    final MessageManager messageManager = mFreetalk.getMessageManager();
    final PersistentTaskManager taskManager = mFreetalk.getTaskManager();
   
    synchronized(this) {
      // We must abort garbage collection if an identity fetch is in progress since the mLast(Own)IdentityFetchID which we use to delete
      // identities is updated AFTER the fetch has succeeded but the IDs which are stored in the identities are updated sequentially
      // in single transactions. So if we GC'ed while a fetch was in progress, we would delete lots of identities because their fetch ID
View Full Code Here

   * I have absolutely NO idea why Bombe does happen to have a duplicate identity, I see no code path which could cause this.
   * TODO: Get rid of this function if nobody reports a duplicate for some time - the function was added at 2011-01-10
   */
  private synchronized void deleteDuplicateIdentities() {
    WoTMessageManager messageManager = mFreetalk.getMessageManager();
    PersistentTaskManager taskManager = mFreetalk.getTaskManager();
   
    synchronized(messageManager) {
    synchronized(taskManager) {
    synchronized(Persistent.transactionLock(db)) {
      try {
View Full Code Here

      page = mPM.getPageNode(Freetalk.PLUGIN_TITLE, ctx);
    page.addCustomStyleSheet(Freetalk.PLUGIN_URI + "/css/freetalk.css");
    page.content.addAttribute("class", "freetalk");

    if(mOwnIdentity != null && !(this instanceof TaskPage)) {
      PersistentTaskManager taskManager = mFreetalk.getTaskManager();
     
      // TODO: Use a timeout here when trying to acquire the lock, the tasks are being displayed on every page anyway, so it does not matter if they are not
      // being displayed once due to the task manager being locked.
      synchronized(taskManager) {
        for(PersistentTask task :taskManager.getVisibleTasks(mOwnIdentity))
          task.display(mWebInterface).addToPage(page.content);
      }
    }
   
    addToPage(page.content);
View Full Code Here

    if(mConfig.getDatabaseFormatVersion() != Freetalk.DATABASE_FORMAT_VERSION)
      throw new RuntimeException("The Freetalk plugin's database format is newer than the Freetalk plugin which is being used.");
   
    mIdentityManager = new WoTIdentityManager(this);
    mMessageManager = new WoTMessageManager(this);
    mTaskManager = new PersistentTaskManager(this, db);
  }
View Full Code Here

   
    if(logDEBUG) Logger.debug(this, "Creating message manager...");
    mMessageManager = new WoTMessageManager(db, mIdentityManager, this, mPluginRespirator);
   
    if(logDEBUG) Logger.debug(this, "Creating task manager...");
    mTaskManager = new PersistentTaskManager(this, db);
   
    upgradeDatabase();
   
    // We only do this if debug logging is enabled since the integrity verification cannot repair anything anyway,
    // if the user does not read his logs there is no need to check the integrity.
View Full Code Here

TOP

Related Classes of plugins.Freetalk.tasks.PersistentTaskManager

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.