APISonar


org.structr.net.peer.Peer.log

> org > structr > net > peer > Peer > log
org APIs structr APIs net APIs peer APIs Peer APIs log APIs

Example 1
private Peer peer                     = null;

	public void setProperty(final RepositoryObject sharedObject, final String key, final Object value) throws TimeoutException {

		peer.log("Set(", sharedObject.getUuid(), ", ", key, ", ", value, ")");

		final Set set = new Set(peer.getUuid(), sharedObject, pte.next(), transactionId, key, value);

		peer.registerCallback(set.getId(), this);
		peer.broadcast(set);

		waitForCallback(set.getId(), timeoutValue);
	}
Example 2
private Peer peer                     = null;

	public void commit() throws TimeoutException {

		peer.log("Commit(", transactionId, ")");

		final Commit commit = new Commit(peer.getUuid(), transactionOwner, transactionId);

		peer.registerCallback(commit.getId(), this);
		peer.broadcast(commit);

		waitForCallback(commit.getId(), timeoutValue);
	}
Example 3
public void onMessage(Peer peer, PeerInfo sender) {

		if (!peer.getUuid().equals(getSender())) {

			final RepositoryObject obj = peer.getRepository().getObject(objectId);
			if (obj == null || obj.getLastModificationTime().before(lastModificationDate)) {

				peer.log("GetHistory(", objectId, ")");

				peer.broadcast(new GetHistory(peer.getUuid(), getSender(), objectId, PseudoTime.now(peer)));
			}
		}
	}