public void setup() { super.setup(); ExpressionBuilder employees = new ExpressionBuilder(); expression = employees.get("firstName").equal("Charles"); expression = expression.and(employees.get("lastName").equal("Chanley")); // ensure our employee is in one of the distributed caches DistributedServer server = (DistributedServer) DistributedServersModel.getDistributedServers().get(0); Object result = server.getDistributedSession().readObject(Employee.class, expression); ((Employee) result).getManagedEmployees(); ((Employee) result).getPhoneNumbers(); ((Employee) result).getAddress(); ((Employee) result).getManager(); ((Employee) result).getProjects(); ((Employee) result).getResponsibilitiesList(); }
public void setup() { super.setup(); ExpressionBuilder employees = new ExpressionBuilder(); this.expression = employees.get("firstName").equal("Andy"); this.expression = this.expression.and(employees.get("lastName").equal("McDurmont")); // ensure our employee is in one of the distributed caches DistributedServer server = (DistributedServer) DistributedServersModel.getDistributedServers().get(0); this.distributedEmployee = (IsolatedEmployee) server.getDistributedSession().readObject(IsolatedEmployee.class, this.expression); this.listener = new SessionEventAdapter() { public void preMergeUnitOfWorkChangeSet(SessionEvent event) { sentChanges = true; } }; server.getDistributedSession().getEventManager().addListener(this.listener); this.sentChanges = false; }
public void reset() { super.reset(); DistributedServer server = (DistributedServer) DistributedServersModel.getDistributedServers().get(0); server.getDistributedSession().getEventManager().removeListener(this.listener); }