Package org.olat.core.util.coordinate

Examples of org.olat.core.util.coordinate.SyncerExecutor


        // fire the appropriate event
        fireEvent(ureq, Event.DONE_EVENT);

        // update the user profile data
        CoordinatorManager.getCoordinator().getSyncer().doInSync(
          OresHelper.createOLATResourceableInstance(Identity.class, ProfileAndHomePageEditController.this.identityToModify.getKey()), new SyncerExecutor() {
            @SuppressWarnings("synthetic-access")
            public void execute() {
              UserManager um = UserManager.getInstance();
              ProfileAndHomePageEditController.this.identityToModify = (Identity) DBFactory.getInstance().loadObject(ProfileAndHomePageEditController.this.identityToModify);
              currentEmail = ProfileAndHomePageEditController.this.identityToModify.getUser().getProperty("email", null);
View Full Code Here


    // thread 1
    new Thread(new Runnable() {
      public void run() {
        try {
          // do something in sync
          CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor(){
            public void execute() {
              System.out.println("Thread-1: execute doInSync 1");
            }
          });//end syncerCallback
         
          // sleep
          sleep(10000);
         
          // do again do something in sync
          CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor(){
            public void execute() {
              System.out.println("Thread-1: execute doInSync 2");
            }
          });//end syncerCallback
          System.out.println("Thread-1: finished");
          statusList.add(Boolean.TRUE);
        } catch (Exception e) {
          exceptionHolder.add(e);
        } finally {
          try {
            DBFactory.getInstance().closeSession();
          } catch (Exception e) {
            // ignore
          };
       
      }}).start();
   
    // thread 2
    new Thread(new Runnable() {
      public void run() {
        try {
          // sleep
          sleep(5000);

          // do something in sync
          CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor(){
            public void execute() {
              System.out.println("Thread-2: execute doInSync 1");
            }
          });//end syncerCallback
         
          // sleep
          sleep(10000);
         
          // do again do something in sync
          CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor(){
            public void execute() {
              System.out.println("Thread-2: execute doInSync 2");
            }
          });//end syncerCallback
          System.out.println("Thread-2: finished");
View Full Code Here

    // 2. Do job with doInSync
    System.out.println("testDoInSyncPerformance: start test with doInSync");
    long startTimeDoInSync = System.currentTimeMillis();
    for (int i = 0; i<maxLoop ; i++) {
      CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor(){
        public void execute() {
          doTestPerformanceJob(re);
        }

      });//end syncerCallback
View Full Code Here

      // o_clusterREVIEW cg please review it - also where does the group.getMaxParticipants().equals("") come from??
      // and: why can't we just have a group here and a max participants count and an identity to enrol?
      // the group was chosen, so why do we need the groupNames and areaNames here???

      Codepoint.codepoint(EnrollmentManager.class, "beforeDoInSync");
      CoordinatorManager.getCoordinator().getSyncer().doInSync(group, new SyncerExecutor(){
        public void execute() {
          Tracing.logInfo("doEnroll start: group="+OresHelper.createStringRepresenting(group), identity.getName(), EnrollmentManager.class);
          Codepoint.codepoint(EnrollmentManager.class, "doInSync1");
          // 6_1_0-RC15: reload group object here another node might have changed this in the meantime
          BusinessGroup reloadedGroup = (BusinessGroup) DBFactory.getInstance().loadObject(group, true);         
View Full Code Here

      final CoursePropertyManager coursePropertyManager, WindowControl wControl, Translator trans) {
    if (Tracing.isDebugEnabled(this.getClass())) Tracing.logDebug("doCancelEnrollment", this.getClass());
    // 1. Remove group membership, fire events, do loggin etc.
    final BGConfigFlags flags = BGConfigFlags.createLearningGroupDefaultFlags();
   
    CoordinatorManager.getCoordinator().getSyncer().doInSync(enrolledGroup, new SyncerExecutor(){
      public void execute() {
        // Remove participant. This will also check if a waiting-list with auto-close-ranks is configurated
        // and move the users accordingly
        businessGroupManager.removeParticipantAndFireEvent(identity, identity, enrolledGroup, flags, false);
        Tracing.logInfo("doCancelEnrollment in group " + enrolledGroup, identity.getName() , EnrollmentManager.class);
View Full Code Here

  }

  public void doCancelEnrollmentInWaitingList(final Identity identity, final BusinessGroup enrolledWaitingListGroup, final ENCourseNode enNode,
      final CoursePropertyManager coursePropertyManager, WindowControl wControl, Translator trans) {
    // 1. Remove group membership, fire events, do loggin etc.
    CoordinatorManager.getCoordinator().getSyncer().doInSync(enrolledWaitingListGroup, new SyncerExecutor(){
      public void execute() {
        businessGroupManager.removeFromWaitingListAndFireEvent(identity, identity, enrolledWaitingListGroup, false);
        // 2. Remove enrollmentdate property
        // only remove last time date, not firsttime
        Property lastTime = coursePropertyManager.findCourseNodeProperty(enNode, identity, null,
View Full Code Here

  }

  public Project createAndSaveProjectFor(String title, String description, final Long projectBrokerId, BusinessGroup projectGroup) {
    OLATResourceable projectBrokerOres = OresHelper.createOLATResourceableInstance(this.getClass(),projectBrokerId);
    final Project project = new ProjectImpl(title, description, projectGroup, getProjectBroker(projectBrokerId));
    CoordinatorManager.getCoordinator().getSyncer().doInSync( projectBrokerOres, new SyncerExecutor() {
      public void execute() {
        DBFactory.getInstance().saveObject(project);
        ProjectBroker projectBroker = getOrLoadProjectBoker(projectBrokerId);
        projectBroker.getProjects().add(project);
        projectCache.update(projectBrokerId.toString(), projectBroker);
View Full Code Here

  }

  public void updateProject(final Project project) {
    final Long projectBrokerId = project.getProjectBroker().getKey();
    OLATResourceable projectBrokerOres = OresHelper.createOLATResourceableInstance(this.getClass(),projectBrokerId);
    CoordinatorManager.getCoordinator().getSyncer().doInSync( projectBrokerOres, new SyncerExecutor() {
      public void execute() {
        DBFactory.getInstance().updateObject(project);
        // invalide with removing from cache
        projectCache.remove(projectBrokerId.toString());
      }
View Full Code Here

   */
  public void deleteProject(final Project project, final boolean deleteGroup, final CourseEnvironment courseEnv, final CourseNode cNode) {
    log.debug("start deleteProject project=" + project);
    final Long projectBrokerId = project.getProjectBroker().getKey();
    OLATResourceable projectBrokerOres = OresHelper.createOLATResourceableInstance(this.getClass(),projectBrokerId);
    CoordinatorManager.getCoordinator().getSyncer().doInSync( projectBrokerOres, new SyncerExecutor() {
      public void execute() {
        // delete first candidate-group, project-group will be deleted after deleting project
        SecurityGroup candidateGroup = project.getCandidateGroup();
        if ( (courseEnv != null) && (cNode != null) ) {
          deleteAllAttachmentFilesOfProject(project, courseEnv, cNode);
View Full Code Here

    }
  }
 
  public void signOutFormAllCandidateList(final List<Identity> chosenIdentities, final Long projectBrokerId) {
    OLATResourceable projectBrokerOres = OresHelper.createOLATResourceableInstance(this.getClass(),projectBrokerId);
    CoordinatorManager.getCoordinator().getSyncer().doInSync( projectBrokerOres, new SyncerExecutor() {
      public void execute() {
        ProjectBroker projectBroker = getOrLoadProjectBoker(projectBrokerId);
        for (Iterator iterator = projectBroker.getProjects().iterator(); iterator.hasNext();) {
          Project project = (Project) iterator.next();
          // loop over all identities
View Full Code Here

TOP

Related Classes of org.olat.core.util.coordinate.SyncerExecutor

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.