Package de.bamberg.ha.api.cluster

Examples of de.bamberg.ha.api.cluster.ClusterManager


//  }


  public String login() {
    log.debug("trying to login");
    ClusterManager clusterManager=clusterManagerFactory.getClusterManager();
    Session newSession=new Session();
    newSession=(Session) clusterManager.distribute(newSession);
    String sessionid=newSession.getId();
    return sessionid;
  }
View Full Code Here


    return sessionid;
  }
 
  @DistributedExecution (DistributedExecutionTarget.KEY_OWNER)
  public void logout(String sessionID) {
    ClusterManager clusterManager=clusterManagerFactory.getClusterManager();
    System.out.println(clusterManager.getLocalMember()+":"+sessionID);
    Session session=(Session) clusterManager.get(sessionID, Session.class);
    if (session!=null) {
      clusterManager.remove(session);
    } else {
      throw new IllegalArgumentException("session not found");
    }
  }
View Full Code Here

public class ClusterManagerTest {

  @Test
  public void test() throws Exception {
    ClusterManager manager=ClusterManagerFactoryImpl.getInstance().getClusterManager();
    TestClusterEntity e1=new TestClusterEntity();
    e1=(TestClusterEntity)manager.distribute(e1);
    assertNotNull(e1);
    assertNotNull(e1.getId());
   
    TestClusterEntity e2=(TestClusterEntity) manager.get(e1.getId(),TestClusterEntity.class);
    assertNotNull(e2);
    assertEquals(e2.getId(),e1.getId());
  }
View Full Code Here

TOP

Related Classes of de.bamberg.ha.api.cluster.ClusterManager

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.