public STMVerticle () { transactionalObject = theContainer.create(new SampleLockable(10)); System.out.println("Object name: "+theContainer.getIdentifier(transactionalObject)); AtomicAction A = new AtomicAction(); /* * Flush state to disk (for this example). */ A.begin(); transactionalObject.increment(); A.commit(); }
RecoverableContainer<?> cont = ((OptimisticLockManagerProxy<?>) proxy).getContainer(); toReturn = new Container(cont); RecoverableContainer<?> cont = ((LockManagerProxy<?>) proxy).getContainer(); toReturn = new Container(cont);
throw new LockException("Transactional object is null!"); throw new LockException("Could not locate method "+method); timeout = theMethod.getAnnotation(Timeout.class).period(); retry = theMethod.getAnnotation(Retry.class).count(); cachedLock = new LockInformation(lockType, timeout, retry); _cachedMethods.put(method, cachedLock); int result = _txObject.setlock((_optimistic ? new OptimisticLock(cachedLock._lockType) : new Lock(cachedLock._lockType)), cachedLock._retry, cachedLock._timeout); throw new LockException(Thread.currentThread()+" could not set "+LockMode.stringForm(cachedLock._lockType)+" lock. Got: "+LockResult.stringForm(result)); AtomicAction.resume(currentTx); throw new TransactionException("Failed to commit container transaction!", status);
Container<Sample> theContainer = new Container<Sample>("Demo", Container.TYPE.PERSISTENT, Container.MODEL.SHARED); Sample obj1 = theContainer.create(new SampleLockable(10)); map.put(LEADER, theContainer.getIdentifier(obj1).toString()); vertx.deployVerticle(new SampleVerticle2()); System.out.println("Object name: "+theContainer.getIdentifier(obj1));
public synchronized boolean save_state (OutputObjectState os, int ot) if (!super.save_state(os, ot)) return false; res = saveState(os); ex.printStackTrace(); // TODO logging res = packPrimitive(afield, os); res = packObjectType(afield, os);
public synchronized boolean restore_state (InputObjectState os, int ot) if (!super.restore_state(os, ot)) return false; res = restoreState(os); ex.printStackTrace(); // TODO logging res = unpackPrimitive(afield, os); res = unpackObjectType(afield, os);
res = restoreState(os); ex.printStackTrace(); // TODO logging res = unpackArray(afield, os); res = unpackPrimitive(afield, os); res = unpackObjectType(afield, os);
res = saveState(os); ex.printStackTrace(); // TODO logging res = packArray(afield, os); res = packPrimitive(afield, os); res = packObjectType(afield, os);
public void start() Container<Sample> theContainer = new Container<Sample>("Demo", Container.TYPE.PERSISTENT, Container.MODEL.SHARED); String uidName = map.get(ClientVerticle.LEADER); Sample obj1 = theContainer.clone(new SampleLockable(10), new Uid(uidName)); AtomicAction A = new AtomicAction(); int value = -1;
checkValidity(superClass); throw new InvalidAnnotationException("WARNING: both save_state and restore_state are not present!");
checkValidity(superClass); throw new InvalidAnnotationException("WARNING: both save_state and restore_state are not present!");
public void start() { vertx.eventBus().consumer("ping-address", message -> { //Now send some data for (int i = 0; i < 10; i++) { int value = STMVerticle.value(); message.reply("pong! "+value); logger.info("Sent back pong "+value); } }); logger.info("STMVerticle started"); }
public void start() Container<Sample> theContainer = new Container<>("Demo", Container.TYPE.PERSISTENT, Container.MODEL.SHARED); String uidName = map.get(ClientVerticle.LEADER); Sample obj1 = theContainer.clone(new SampleLockable(10), new Uid(uidName)); AtomicAction A = new AtomicAction(); int value = -1;