Index: trunk/src/main/java/omq/common/broker/Broker.java
===================================================================
--- trunk/src/main/java/omq/common/broker/Broker.java	(revision 77)
+++ trunk/src/main/java/omq/common/broker/Broker.java	(revision 83)
@@ -16,4 +16,5 @@
 import omq.common.util.ParameterQueue;
 import omq.common.util.Serializer;
+import omq.exception.AlreadyBoundException;
 import omq.exception.InitBrokerException;
 import omq.exception.RemoteException;
@@ -30,4 +31,11 @@
 import com.rabbitmq.client.ShutdownSignalException;
 
+/**
+ * A "broker" allows a new connection to a RabbitMQ server. Under this
+ * connection it can have binded object and proxies.
+ * 
+ * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
+ * 
+ */
 public class Broker {
 
@@ -65,4 +73,9 @@
 	}
 
+	/**
+	 * This method stops the broker's connection and all the threads created
+	 * 
+	 * @throws Exception
+	 */
 	public void stopBroker() throws Exception {
 		logger.warn("Stopping broker");
@@ -84,5 +97,4 @@
 		environment = null;
 		remoteObjs = null;
-		// Serializer.removeSerializers();
 	}
 
@@ -95,4 +107,9 @@
 	}
 
+	/**
+	 * This method close the broker's connection
+	 * 
+	 * @throws IOException
+	 */
 	public void closeConnection() throws IOException {
 		logger.warn("Clossing connection");
@@ -103,4 +120,5 @@
 
 	/**
+	 * Return the broker's channel
 	 * 
 	 * @return Broker's channel
@@ -121,4 +139,14 @@
 	}
 
+	/**
+	 * Returns the remote object for specified reference.
+	 * 
+	 * @param reference
+	 *            - Binding name
+	 * @param contract
+	 *            - Remote Interface
+	 * @return newProxy
+	 * @throws RemoteException
+	 */
 	@SuppressWarnings("unchecked")
 	public synchronized <T extends Remote> T lookup(String reference, Class<T> contract) throws RemoteException {
@@ -126,6 +154,5 @@
 
 			if (!clientStarted) {
-				initClient(environment);
-				clientStarted = true;
+				initClient();
 			}
 
@@ -144,4 +171,16 @@
 	}
 
+	/**
+	 * Returns the remote object for specified reference. This function returns
+	 * an special type of proxy, every method invoked will be multi and
+	 * asynchronous.
+	 * 
+	 * @param reference
+	 *            - Binding name
+	 * @param contract
+	 *            - Remote Interface
+	 * @return newProxy
+	 * @throws RemoteException
+	 */
 	@SuppressWarnings("unchecked")
 	public synchronized <T extends Remote> T lookupMulti(String reference, Class<T> contract) throws RemoteException {
@@ -161,9 +200,43 @@
 	}
 
-	public void bind(String reference, RemoteObject remote) throws RemoteException {
+	/**
+	 * Binds the reference to the specified remote object. This function uses
+	 * the broker's environment
+	 * 
+	 * @param reference
+	 *            - Binding name
+	 * @param remote
+	 *            - RemoteObject to bind
+	 * @throws RemoteException
+	 *             If the remote operation failed
+	 * @throws AlreadyBoundException
+	 *             If name is already bound.
+	 */
+	public void bind(String reference, RemoteObject remote) throws RemoteException, AlreadyBoundException {
 		bind(reference, remote, environment);
 	}
 
-	public void bind(String reference, RemoteObject remote, Properties env) throws RemoteException {
+	/**
+	 * Binds the reference to the specified remote object. This function uses
+	 * the broker's environment
+	 * 
+	 * @param reference
+	 *            - Binding name
+	 * @param remote
+	 *            - RemoteObject to bind
+	 * @param env
+	 *            - RemoteObject environment. You can set how many threads will
+	 *            be listen to the reference, the multiqueue name and the
+	 *            properties of the object queue and multiqueue
+	 * @throws RemoteException
+	 *             If the remote operation failed
+	 * @throws AlreadyBoundException
+	 *             If name is already bound.
+	 */
+	public void bind(String reference, RemoteObject remote, Properties env) throws RemoteException, AlreadyBoundException {
+		if (remoteObjs.containsKey(reference)) {
+			throw new AlreadyBoundException(reference);
+		}
+		// Try to start the remtoeObject listeners
 		try {
 			remote.startRemoteObject(reference, this, env);
@@ -174,4 +247,15 @@
 	}
 
+	/**
+	 * Unbinds a remoteObject from its reference and kills all the threads
+	 * created.
+	 * 
+	 * @param reference
+	 *            - Binding name
+	 * @throws RemoteException
+	 *             If the remote operation failed
+	 * @throws IOException
+	 *             If there are problems while killing the threads
+	 */
 	public void unbind(String reference) throws RemoteException, IOException {
 		if (remoteObjs.containsKey(reference)) {
@@ -184,19 +268,14 @@
 	}
 
-	public void rebind(String name, Remote obj) throws RemoteException {
-
-	}
-
-	/**
-	 * This method ensures the client will have only one ResponseListener and
-	 * only one EventDispatcher. Both with the same environment.
-	 * 
-	 * @param environment
-	 * @throws Exception
-	 */
-	private synchronized void initClient(Properties environment) throws Exception {
+	/**
+	 * This method ensures the client will have only one ResponseListener.
+	 * 
+	 * @throws Exception
+	 */
+	private synchronized void initClient() throws Exception {
 		if (responseListener == null) {
 			responseListener = new ResponseListener(this);
 			responseListener.start();
+			clientStarted = true;
 		}
 	}
Index: trunk/src/main/java/omq/common/message/Request.java
===================================================================
--- trunk/src/main/java/omq/common/message/Request.java	(revision 77)
+++ trunk/src/main/java/omq/common/message/Request.java	(revision 83)
@@ -3,4 +3,13 @@
 import java.io.Serializable;
 
+/**
+ * Serializable request information. This class is used to send the information
+ * to the server. It has information about which method is wanted to invoke, its
+ * parameters, its correlation id and if a response is needed -asynchronous
+ * method-.
+ * 
+ * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
+ * 
+ */
 public class Request implements Serializable {
 
@@ -20,4 +29,5 @@
 	private transient int retries;
 
+	// This constructor is used by kryo
 	public Request() {
 	}
@@ -38,8 +48,38 @@
 	}
 
+	/**
+	 * This method creates a new synchronous request
+	 * 
+	 * @param id
+	 *            - correlation id of this invocation
+	 * @param method
+	 *            - method name wanted to call
+	 * @param params
+	 *            - parameters of this method
+	 * @return - new SyncRequest
+	 */
 	public static Request newSyncRequest(String id, String method, Object[] params) {
 		return new Request(id, method, false, params);
 	}
 
+	/**
+	 * This method creates a new synchronous request
+	 * 
+	 * @param id
+	 *            - correlation id of this invocation
+	 * @param method
+	 *            - method name wanted to call
+	 * @param params
+	 *            - parameters of this method
+	 * @param retries
+	 *            - How many retries will be done
+	 * @param timeout
+	 *            - Timeout for every retry
+	 * @param multi
+	 *            - If the method is multi
+	 * @param wait
+	 *            - If the method is multi how many responses will be listened
+	 * @return - new SyncRequest
+	 */
 	public static Request newSyncRequest(String id, String method, Object[] params, int retries, long timeout, boolean multi, int wait) {
 		Request req = new Request(id, method, false, params, multi);
@@ -50,4 +90,17 @@
 	}
 
+	/**
+	 * This method creates a new asynchronous request
+	 * 
+	 * @param id
+	 *            - correlation id of this invocation
+	 * @param method
+	 *            - method name wanted to call
+	 * @param params
+	 *            - parameters of this method
+	 * @param multi
+	 *            - If the method is multi
+	 * @return new AsyncRequest
+	 */
 	public static Request newAsyncRequest(String id, String method, Object[] params, boolean multi) {
 		return new Request(id, method, true, params, multi);
Index: trunk/src/main/java/omq/common/message/Response.java
===================================================================
--- trunk/src/main/java/omq/common/message/Response.java	(revision 77)
+++ trunk/src/main/java/omq/common/message/Response.java	(revision 83)
@@ -5,4 +5,13 @@
 import omq.exception.OmqException;
 
+/**
+ * Serializable response information. This class is used to send the information
+ * to the client proxy. It has information about which remoteObject has invoked
+ * the method and its correlation id. This class also has the result of the
+ * invoke if everything has gone fine in the server or an error otherwise.
+ * 
+ * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
+ * 
+ */
 public class Response implements Serializable {
 
@@ -17,7 +26,20 @@
 	private String idOmq;
 
+	// Used by kryo
 	public Response() {
 	}
 
+	/**
+	 * Creates a new Response object to be serialized
+	 * 
+	 * @param id
+	 *            - correlation id of the invoke
+	 * @param idOmq
+	 *            - objectmq's identifier -bind reference-
+	 * @param result
+	 *            - result of the invocation
+	 * @param error
+	 *            - error thrown by the invocation
+	 */
 	public Response(String id, String idOmq, Object result, OmqException error) {
 		this.id = id;
Index: trunk/src/main/java/omq/common/util/OmqConnectionFactory.java
===================================================================
--- trunk/src/main/java/omq/common/util/OmqConnectionFactory.java	(revision 77)
+++ trunk/src/main/java/omq/common/util/OmqConnectionFactory.java	(revision 83)
@@ -13,4 +13,5 @@
 
 /**
+ * This class creates RabbitMQ connections
  * 
  * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
@@ -23,4 +24,14 @@
 	private static int connectionTimeout = 2 * 1000;
 
+	/**
+	 * If this class is wanted to use as a singleton class this is the init
+	 * function
+	 * 
+	 * @param env
+	 *            - environment that sets the properties needed by RabbitMQ
+	 * @throws KeyManagementException
+	 * @throws NoSuchAlgorithmException
+	 * @throws IOException
+	 */
 	public static void init(Properties env) throws KeyManagementException, NoSuchAlgorithmException, IOException {
 		if (connection == null) {
@@ -29,4 +40,12 @@
 	}
 
+	/**
+	 * This function returns a working connection.
+	 * 
+	 * @param env
+	 *            - used if it's necessary to create a new connection
+	 * @return workingConnection
+	 * @throws Exception
+	 */
 	public static Connection getNewWorkingConnection(Properties env) throws Exception {
 		Connection connection = null;
@@ -50,4 +69,16 @@
 	}
 
+	/**
+	 * This function creates a new rabbitmq connection using the properties set
+	 * in env
+	 * 
+	 * @param env
+	 *            - Properties needed to create a new connection: username,
+	 *            password, rabbit_host, rabbit_port, enable_ssl (optional)
+	 * @return new Connection
+	 * @throws IOException
+	 * @throws KeyManagementException
+	 * @throws NoSuchAlgorithmException
+	 */
 	public static Connection getNewConnection(Properties env) throws IOException, KeyManagementException, NoSuchAlgorithmException {
 		// Get login info of rabbitmq
@@ -59,5 +90,5 @@
 		int port = Integer.parseInt(env.getProperty(ParameterQueue.RABBIT_PORT));
 
-		boolean ssl = Boolean.parseBoolean(env.getProperty(ParameterQueue.ENABLE_SSL));
+		boolean ssl = Boolean.parseBoolean(env.getProperty(ParameterQueue.ENABLE_SSL, "false"));
 
 		// Start a new connection and channel
@@ -78,4 +109,10 @@
 	}
 
+	/**
+	 * This method creates a new channel if the singleton pattern is used
+	 * 
+	 * @return new Channel
+	 * @throws IOException
+	 */
 	public static Channel getNewChannel() throws IOException {
 		Channel channel = connection.createChannel();
Index: trunk/src/main/java/omq/common/util/ParameterQueue.java
===================================================================
--- trunk/src/main/java/omq/common/util/ParameterQueue.java	(revision 77)
+++ trunk/src/main/java/omq/common/util/ParameterQueue.java	(revision 83)
@@ -2,4 +2,5 @@
 
 /**
+ * This class is used to create new environments.
  * 
  * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
@@ -7,8 +8,4 @@
  */
 public class ParameterQueue {
-
-	/*
-	 * Properties environment
-	 */
 
 	/**
@@ -69,7 +66,4 @@
 	public static String MESSAGE_TTL_IN_QUEUES = "omq.message_ttl_queue";
 
-	// TODO persistent messages? the messages will be saved in the disk if this
-	// flag is set true
-
 	/**
 	 * Set if the system will use ssl
@@ -111,5 +105,5 @@
 
 	/**
-	 * Time in milis
+	 * Time in milis by default is set in a minute
 	 */
 	public static long DEFAULT_TIMEOUT = 1 * 1000 * 60;
Index: trunk/src/main/java/omq/common/util/Serializer.java
===================================================================
--- trunk/src/main/java/omq/common/util/Serializer.java	(revision 77)
+++ trunk/src/main/java/omq/common/util/Serializer.java	(revision 83)
@@ -15,10 +15,12 @@
 /**
  * 
+ * Serializer enables to serialize the requests and the responses of the
+ * remoteObjects. This class is used to have the same serializer object a not to
+ * create new instances every time they are needed.
+ * 
  * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
  * 
  */
 public class Serializer {
-	// private static final Logger logger =
-	// Logger.getLogger(Serializer.class.getName());
 	public static final String KRYO = "kryo";
 	public static final String JAVA = "java";
Index: trunk/src/main/java/omq/common/util/Serializers/GsonImp.java
===================================================================
--- trunk/src/main/java/omq/common/util/Serializers/GsonImp.java	(revision 77)
+++ trunk/src/main/java/omq/common/util/Serializers/GsonImp.java	(revision 83)
@@ -15,4 +15,10 @@
 import com.google.gson.JsonParser;
 
+/**
+ * Json serialize implementation. It uses the Gson libraries.
+ * 
+ * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
+ * 
+ */
 public class GsonImp implements ISerializer {
 	private final Gson gson = new Gson();
Index: trunk/src/main/java/omq/common/util/Serializers/ISerializer.java
===================================================================
--- trunk/src/main/java/omq/common/util/Serializers/ISerializer.java	(revision 77)
+++ trunk/src/main/java/omq/common/util/Serializers/ISerializer.java	(revision 83)
@@ -7,4 +7,6 @@
 
 /**
+ * An ISerializer object can serialize any kind of objects and deserialize
+ * Requests and Responses.
  * 
  * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
@@ -12,8 +14,39 @@
  */
 public interface ISerializer {
+	/**
+	 * Serialize
+	 * 
+	 * @param obj
+	 *            - object to serialize
+	 * @return objectSerialized
+	 * @throws SerializerException
+	 *             - If the serialization failed
+	 */
 	public byte[] serialize(Object obj) throws SerializerException;
 
+	/**
+	 * Deserialize a Request
+	 * 
+	 * @param bytes
+	 *            - serialized request
+	 * @param obj
+	 *            - remoteObject which is receiving requests
+	 * @return request
+	 * @throws SerializerException
+	 *             - If the serialization failed
+	 */
 	public Request deserializeRequest(byte[] bytes, RemoteObject obj) throws SerializerException;
 
+	/**
+	 * Deserialize a Response
+	 * 
+	 * @param bytes
+	 *            serialized response
+	 * @param type
+	 *            - return type expected
+	 * @return response
+	 * @throws SerializerException
+	 *             - If the serialization failed
+	 */
 	public Response deserializeResponse(byte[] bytes, Class<?> type) throws SerializerException;
 }
Index: trunk/src/main/java/omq/common/util/Serializers/JavaImp.java
===================================================================
--- trunk/src/main/java/omq/common/util/Serializers/JavaImp.java	(revision 77)
+++ trunk/src/main/java/omq/common/util/Serializers/JavaImp.java	(revision 83)
@@ -12,4 +12,5 @@
 
 /**
+ * Java serialize implementation. It uses the default java serialization.
  * 
  * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
Index: trunk/src/main/java/omq/common/util/Serializers/KryoImp.java
===================================================================
--- trunk/src/main/java/omq/common/util/Serializers/KryoImp.java	(revision 77)
+++ trunk/src/main/java/omq/common/util/Serializers/KryoImp.java	(revision 83)
@@ -13,4 +13,5 @@
 
 /**
+ * Kryo serializerimplementation. It uses the Kryo libraries.
  * 
  * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
Index: trunk/src/main/java/omq/common/util/Zipper.java
===================================================================
--- trunk/src/main/java/omq/common/util/Zipper.java	(revision 77)
+++ trunk/src/main/java/omq/common/util/Zipper.java	(revision 83)
@@ -7,4 +7,11 @@
 import java.util.zip.GZIPOutputStream;
 
+/**
+ * This class enables the compression of the information sent through the
+ * rabbitmq server.
+ * 
+ * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
+ * 
+ */
 public class Zipper {
 
@@ -16,12 +23,12 @@
 			zos = new GZIPOutputStream(baos);
 			zos.write(b);
-		} finally{
-			if(zos != null){
+		} finally {
+			if (zos != null) {
 				zos.close();
 			}
-			
+
 			baos.close();
 		}
-		
+
 		return baos.toByteArray();
 	}
@@ -34,5 +41,5 @@
 		try {
 			zis = new GZIPInputStream(bais);
-			
+
 			byte[] tmpBuffer = new byte[256];
 			int n;
@@ -40,14 +47,14 @@
 				baos.write(tmpBuffer, 0, n);
 			}
-		} finally {		
-			if(zis != null){
+		} finally {
+			if (zis != null) {
 				zis.close();
 			}
-			
+
 			bais.close();
 			baos.close();
-		}		
-		
+		}
+
 		return baos.toByteArray();
-	}	
+	}
 }
