private Object myDoubleAction(EntityView view) { MyEntity me = (MyEntity) getEntity(view.getEntityReference()); MyEntity togo = me.copy(); togo.setNumber(togo.getNumber() * 2); return new ActionReturn( new EntityData(view.getEntityReference().toString(), togo.getStuff(), togo), (String) null); }
public Object executeActions( EntityView entityView, String action, Map<String, Object> actionParams, OutputStream outputStream) { Object result = null; if ("double".equals(action)) { result = myDoubleAction(entityView); } else if ("xxx".equals(action)) { MyEntity me = (MyEntity) getEntity(entityView.getEntityReference()); me.extra = "xxx"; me.setStuff("xxx"); myEntities.put(me.getId(), me); } else if ("clear".equals(action)) { myEntities.clear(); } return result; }