Index: party/src/main/java/geniusweb/party/Capabilities.java
===================================================================
--- party/src/main/java/geniusweb/party/Capabilities.java	(revision 53)
+++ party/src/main/java/geniusweb/party/Capabilities.java	(revision 1)
@@ -5,9 +5,9 @@
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+
+import geniusweb.references.ProtocolRef;
+
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
-
-import geniusweb.profile.Profile;
-import geniusweb.references.ProtocolRef;
 
 /**
@@ -17,48 +17,22 @@
 public class Capabilities {
 	/**
-	 * List of supported protocol names
+	 * List of supported protocols
 	 */
-	private final Set<String> behaviours;
-	/**
-	 * The profile classes that are supported
-	 */
-	private final Set<Class<? extends Profile>> profiles;
+	private final Set<ProtocolRef> protocols;
 
 	/**
 	 * 
-	 * @param behaviours the {@link ProtocolRef} that a Party can handle, as
-	 *                   returned by NegoProtocol.getRef()
-	 * @param profiles   the {@link Profile} classes that Party acan handle
+	 * @param protocols the protocols that a Party can handle
 	 */
 	@JsonCreator
-	public Capabilities(@JsonProperty("behaviours") Set<String> behaviours,
-			@JsonProperty("profiles") Set<Class<? extends Profile>> profiles) {
-		if (behaviours == null) {
-			throw new IllegalArgumentException("behaviours==null");
+	public Capabilities(@JsonProperty("protocols") Set<ProtocolRef> protocols) {
+		if (protocols == null) {
+			throw new IllegalArgumentException("protocols==null");
 		}
-		for (Class<? extends Profile> prof : profiles) {
-			if (!Profile.class.isAssignableFrom(prof))
-				throw new IllegalArgumentException(
-						"profile " + prof + " must be a subclass of Profile");
-		}
-		this.behaviours = behaviours;
-		this.profiles = profiles;
+		this.protocols = protocols;
 	}
 
-	/**
-	 * 
-	 * @return the behaviours (protocols) that are supported
-	 */
-	public Set<String> getBehaviours() {
-		return behaviours;
-	}
-
-	/**
-	 * 
-	 * @return the profile classes that are supported
-	 * 
-	 */
-	public Set<Class<? extends Profile>> getProfiles() {
-		return profiles;
+	public Set<ProtocolRef> getProtocols() {
+		return protocols;
 	}
 
@@ -68,7 +42,5 @@
 		int result = 1;
 		result = prime * result
-				+ ((behaviours == null) ? 0 : behaviours.hashCode());
-		result = prime * result
-				+ ((profiles == null) ? 0 : profiles.hashCode());
+				+ ((protocols == null) ? 0 : protocols.hashCode());
 		return result;
 	}
@@ -83,13 +55,8 @@
 			return false;
 		Capabilities other = (Capabilities) obj;
-		if (behaviours == null) {
-			if (other.behaviours != null)
+		if (protocols == null) {
+			if (other.protocols != null)
 				return false;
-		} else if (!behaviours.equals(other.behaviours))
-			return false;
-		if (profiles == null) {
-			if (other.profiles != null)
-				return false;
-		} else if (!profiles.equals(other.profiles))
+		} else if (!protocols.equals(other.protocols))
 			return false;
 		return true;
@@ -98,5 +65,5 @@
 	@Override
 	public String toString() {
-		return "Capabilities[" + profiles + "," + behaviours + "]";
+		return "Capabilities[" + "Protocols=" + protocols + "]";
 	}
 
Index: party/src/main/java/geniusweb/party/DefaultParty.java
===================================================================
--- party/src/main/java/geniusweb/party/DefaultParty.java	(revision 53)
+++ party/src/main/java/geniusweb/party/DefaultParty.java	(revision 1)
@@ -2,6 +2,6 @@
 
 import geniusweb.actions.Action;
-import geniusweb.connection.ConnectionEnd;
-import geniusweb.inform.Inform;
+import geniusweb.connection.Connection;
+import geniusweb.party.inform.Inform;
 import tudelft.utilities.listener.Listener;
 import tudelft.utilities.logging.ReportToLogger;
@@ -13,5 +13,5 @@
  */
 public abstract class DefaultParty implements Party, Listener<Inform> {
-	private ConnectionEnd<Inform, Action> connection = null;
+	private Connection<Inform, Action> connection = null;
 	protected Reporter reporter;
 
@@ -25,5 +25,5 @@
 
 	@Override
-	public void connect(ConnectionEnd<Inform, Action> connection) {
+	public void connect(Connection<Inform, Action> connection) {
 		this.connection = connection;
 		connection.addListener(this);
@@ -34,5 +34,4 @@
 		if (connection != null) {
 			connection.removeListener(this);
-			connection.close();
 			this.connection = null;
 		}
@@ -48,5 +47,5 @@
 	 *         connected.
 	 */
-	public ConnectionEnd<Inform, Action> getConnection() {
+	public Connection<Inform, Action> getConnection() {
 		return connection;
 	}
Index: party/src/main/java/geniusweb/party/Party.java
===================================================================
--- party/src/main/java/geniusweb/party/Party.java	(revision 53)
+++ party/src/main/java/geniusweb/party/Party.java	(revision 1)
@@ -3,6 +3,5 @@
 import geniusweb.actions.Action;
 import geniusweb.connection.Connectable;
-import geniusweb.connection.ConnectionEnd;
-import geniusweb.inform.Inform;
+import geniusweb.party.inform.Inform;
 
 /**
@@ -15,24 +14,7 @@
  * your class may also be created only to call the getCapabilities function.
  * 
- * <h2>Short outline</h2> After the party is created (empty constructor) it is
- * first connected through a call to connect (from the {@link Connectable}
- * interface). The party can subscribe to receive {@link Inform} objects using
- * {@link ConnectionEnd#addListener(tudelft.utilities.listener.Listener)}. The
- * party can also send its actions using {@link ConnectionEnd#send(Object)}.
- * 
- * The {@link ConnectionEnd} allows the party to receive Inform objects and send
- * action objects.
- * 
- * Incoming Inform objects (eg "Settings" containing the profile, and
- * "yourturn") are notified to the party throught he notifyChange() call to the
- * party.
- * <p>
- * Outgoing Action objects (eg "Offer") are sent using the send() command.
- * 
- * Most parties extend {@link DefaultParty} to handle these connection details.
  * <p>
  * Technical details: normally a Party will be spawned inside a PartiesFactory,
- * and incoming/outgoing calls are routed through a websocket there. But in
- * testing the Connectable is often mocked.
+ * and incoming/outgoing calls are routed through a websocket there.
  * 
  */
@@ -52,13 +34,7 @@
 
 	/**
-	 * When this is called, the party must free up all its claimed resources
-	 * (memory, CPU, files, etc) immediately. This call can come in at any time
-	 * (when a negotiation is aborted early), even while your party is still
-	 * working on something else. Other parties for the next session may be
-	 * started within a few seconds after this request to your party. The exact
-	 * time is decided by the partyserver you use but typically 2 seconds. Not
-	 * respecting this call and continue using the system resources will
-	 * deteriorate performance of other parties running on the same machine,
-	 * which may be against the assignment/competition rules.
+	 * When this is called, the party should free up its resources and terminate
+	 * its threads. This call may come in at any time, eg when a negotiation is
+	 * aborted.
 	 */
 	void terminate();
Index: party/src/main/java/geniusweb/party/inform/ActionDone.java
===================================================================
--- party/src/main/java/geniusweb/party/inform/ActionDone.java	(revision 1)
+++ party/src/main/java/geniusweb/party/inform/ActionDone.java	(revision 1)
@@ -0,0 +1,53 @@
+package geniusweb.party.inform;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import geniusweb.actions.Action;
+
+/**
+ * Informs that someone did an action
+ */
+public class ActionDone implements Inform {
+
+	private final Action action;
+
+	@JsonCreator
+	public ActionDone(@JsonProperty("action") Action action) {
+		this.action = action;
+	}
+
+	public Action getAction() {
+		return action;
+	}
+
+	@Override
+	public String toString() {
+		return "ActionDone[" + action + "]";
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + ((action == null) ? 0 : action.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		ActionDone other = (ActionDone) obj;
+		if (action == null) {
+			if (other.action != null)
+				return false;
+		} else if (!action.equals(other.action))
+			return false;
+		return true;
+	}
+}
Index: party/src/main/java/geniusweb/party/inform/Finished.java
===================================================================
--- party/src/main/java/geniusweb/party/inform/Finished.java	(revision 1)
+++ party/src/main/java/geniusweb/party/inform/Finished.java	(revision 1)
@@ -0,0 +1,61 @@
+package geniusweb.party.inform;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import geniusweb.issuevalue.Bid;
+
+/**
+ * Informs that the session is finished, and also contains the bid that was
+ * agreed on.
+ *
+ */
+public class Finished implements Inform {
+	private final Bid agreedBid;
+
+	/**
+	 * The session finished (can be for any reason).
+	 * 
+	 * @param agreedBid the bid that was finally agreed on; null if no
+	 *                  agreement.
+	 */
+	@JsonCreator
+	public Finished(@JsonProperty("agreedBid") Bid agreedBid) {
+		this.agreedBid = agreedBid;
+	}
+
+	public Bid getAgreement() {
+		return agreedBid;
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result
+				+ ((agreedBid == null) ? 0 : agreedBid.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		Finished other = (Finished) obj;
+		if (agreedBid == null) {
+			if (other.agreedBid != null)
+				return false;
+		} else if (!agreedBid.equals(other.agreedBid))
+			return false;
+		return true;
+	}
+
+	@Override
+	public String toString() {
+		return "Finished[" + agreedBid + "]";
+	}
+}
Index: party/src/main/java/geniusweb/party/inform/Inform.java
===================================================================
--- party/src/main/java/geniusweb/party/inform/Inform.java	(revision 1)
+++ party/src/main/java/geniusweb/party/inform/Inform.java	(revision 1)
@@ -0,0 +1,23 @@
+package geniusweb.party.inform;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+
+import geniusweb.party.Party;
+
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
+/**
+ * base class of all information sent to the {@link Party}
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
+@JsonSubTypes({ @JsonSubTypes.Type(value = ActionDone.class),
+		@JsonSubTypes.Type(value = Inform.class),
+		@JsonSubTypes.Type(value = Settings.class),
+		@JsonSubTypes.Type(value = Finished.class),
+		@JsonSubTypes.Type(value = YourTurn.class) })
+@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
+public interface Inform {
+
+}
Index: party/src/main/java/geniusweb/party/inform/Settings.java
===================================================================
--- party/src/main/java/geniusweb/party/inform/Settings.java	(revision 1)
+++ party/src/main/java/geniusweb/party/inform/Settings.java	(revision 1)
@@ -0,0 +1,104 @@
+package geniusweb.party.inform;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import geniusweb.actions.PartyId;
+import geniusweb.progress.Progress;
+import geniusweb.references.ProfileRef;
+import geniusweb.references.ProtocolRef;
+
+/**
+ * Informs a party about all settings for the upcoming negotiation session. This
+ * should be sent to a party one time, so that the party knows the situation.
+ *
+ */
+public class Settings implements Inform {
+	private ProfileRef profile;
+	private ProtocolRef protocol;
+	private Progress progress;
+	private PartyId id;
+
+	@JsonCreator
+	public Settings(@JsonProperty("id") PartyId id,
+			@JsonProperty("profile") ProfileRef profile,
+			@JsonProperty("protocol") ProtocolRef protocol,
+			@JsonProperty("progress") Progress progress) {
+		if (profile == null || protocol == null || progress == null) {
+			throw new IllegalArgumentException(
+					"party, profile, protocol and progress must be not null.");
+		}
+		this.profile = profile;
+		this.protocol = protocol;
+		this.progress = progress;
+		this.id = id;
+	}
+
+	public ProfileRef getProfile() {
+		return profile;
+	}
+
+	public ProtocolRef getProtocol() {
+		return protocol;
+	}
+
+	public Progress getProgress() {
+		return progress;
+	}
+
+	public PartyId getID() {
+		return id;
+	}
+
+	@Override
+	public String toString() {
+		return "Settings[" + id + "," + profile + "," + protocol + ","
+				+ progress + "]";
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + ((id == null) ? 0 : id.hashCode());
+		result = prime * result + ((profile == null) ? 0 : profile.hashCode());
+		result = prime * result
+				+ ((progress == null) ? 0 : progress.hashCode());
+		result = prime * result
+				+ ((protocol == null) ? 0 : protocol.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		Settings other = (Settings) obj;
+		if (id == null) {
+			if (other.id != null)
+				return false;
+		} else if (!id.equals(other.id))
+			return false;
+		if (profile == null) {
+			if (other.profile != null)
+				return false;
+		} else if (!profile.equals(other.profile))
+			return false;
+		if (progress == null) {
+			if (other.progress != null)
+				return false;
+		} else if (!progress.equals(other.progress))
+			return false;
+		if (protocol == null) {
+			if (other.protocol != null)
+				return false;
+		} else if (!protocol.equals(other.protocol))
+			return false;
+		return true;
+	}
+
+}
Index: party/src/main/java/geniusweb/party/inform/YourTurn.java
===================================================================
--- party/src/main/java/geniusweb/party/inform/YourTurn.java	(revision 1)
+++ party/src/main/java/geniusweb/party/inform/YourTurn.java	(revision 1)
@@ -0,0 +1,28 @@
+package geniusweb.party.inform;
+
+/**
+ * Informs a party that he has the turn and can choose the next action.
+ */
+public class YourTurn implements Inform {
+
+	@Override
+	public int hashCode() {
+		return 1;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		return true;
+	}
+
+	@Override
+	public String toString() {
+		return "YourTurn";
+	}
+}
