[vlma-devel] commit: More Javadoc. (Adrien Grand )

git version control git at videolan.org
Thu Aug 14 00:16:12 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Tue Aug 12 22:45:33 2008 +0200| [26b5de8c9e5986de5b6d862010300763f17df442] | committer: Adrien Grand 

More Javadoc.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=26b5de8c9e5986de5b6d862010300763f17df442
---

 .../main/java/org/videolan/vlma/OrderGiver.java    |   25 ++++++++++++++++----
 .../vlma/watcher/DirectMulticastStreamWatcher.java |    6 +++-
 .../videolan/vlma/watcher/HttpStreamWatcher.java   |    3 +-
 .../vlma/watcher/StreamWatcherMockImpl.java        |    7 +++++
 4 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/vlma-core/src/main/java/org/videolan/vlma/OrderGiver.java b/vlma-core/src/main/java/org/videolan/vlma/OrderGiver.java
index 84c079c..35e6749 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/OrderGiver.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/OrderGiver.java
@@ -37,12 +37,27 @@ import org.videolan.vlma.model.adapter.Adapter;
 import org.videolan.vlma.model.adapter.Server;
 import org.videolan.vlma.model.media.Media;
 import org.videolan.vlma.model.media.MediaGroup;
+import org.videolan.vlma.model.media.Program;
 import org.videolan.vlma.order.OrderSender;
 
 /**
- * This class can compute the orders to give to the servers depending on the
- * medias' programmation, on the servers' and peripherics' state, and on the
- * priority of the programms.
+ * This class computes the orders to give to the servers depending on the
+ * medias programmation, on the state of servers state, and on the priority
+ * of the programs.
+ * <p>
+ * To assign medias to servers, this class performs the following steps:
+ * <ol>
+ *   <li>A partition of available {@link Adapter}s is built according to their
+ *   hashTypes.</li>
+ *   <li>{@link Media}s are grouped together in {@link MediaGroup}s and
+ *   partitioned according to the hashType of the {@link Adapter}s than can
+ *   stream them.</li>
+ *   <li>{@link MediaGroup}s are sorted by
+ *   {@link Program#getPriority() priority} and {@link Order}s are given to
+ *   {@link Adapter}s as long as there are available ones.</li>
+ * </ol>
+ * This means that the {@link MediaGroup}s with a low priority may not be
+ * streamed.
  *
  * @author Adrien Maglo <magsoft at videolan.org>
  * @author Sylvain Cadilhac <sylv at videolan.org>
@@ -86,7 +101,7 @@ public class OrderGiver {
     /**
      * Partition adapters according to their hashType.
      *
-     * @param servers
+     * @param servers available servers
      * @return the partition of adapters
      */
     public Map<Integer, List<Adapter>> partitionAdapters(List<Server> servers) {
@@ -239,7 +254,7 @@ public class OrderGiver {
     };
 
     /**
-     * This method launches the computing of orders in a news thread, if it was
+     * This method launches the computing of orders in a new thread, if it was
      * not already running.
      */
     synchronized public void giveOrders() {
diff --git a/vlma-core/src/main/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcher.java b/vlma-core/src/main/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcher.java
index 7b3d524..c190ec1 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcher.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcher.java
@@ -31,8 +31,10 @@ import org.apache.log4j.Logger;
 import org.videolan.vlma.model.media.Program;
 
 /**
- * This Watcher direcly connects to the multicast groups to verify if some data
- * are broadcasted. If yes, it considers that the media is broadcasted.
+ * This Watcher direcly connects to the multicast groups to check wether some
+ * data is broadcasted. If yes, it considers that the media is broadcasted.
+ * This class should never be used directly. Use {@link StreamWatcherDispatcher}
+ * instead.
  *
  * @author Adrien Maglo <magsoft at videolan.org>
  */
diff --git a/vlma-core/src/main/java/org/videolan/vlma/watcher/HttpStreamWatcher.java b/vlma-core/src/main/java/org/videolan/vlma/watcher/HttpStreamWatcher.java
index dec8138..a2e3bb5 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/watcher/HttpStreamWatcher.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/watcher/HttpStreamWatcher.java
@@ -30,7 +30,8 @@ import org.apache.commons.configuration.Configuration;
 import org.videolan.vlma.model.media.Program;
 
 /**
- * This class monitors HTTP streams.
+ * This class monitors HTTP streams. It should never be used directly. Use
+ * {@link StreamWatcherDispatcher} instead.
  *
  * @author Adrien Grand <jpountz at videolan.org>
  */
diff --git a/vlma-core/src/main/java/org/videolan/vlma/watcher/StreamWatcherMockImpl.java b/vlma-core/src/main/java/org/videolan/vlma/watcher/StreamWatcherMockImpl.java
index ba7833b..200d16d 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/watcher/StreamWatcherMockImpl.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/watcher/StreamWatcherMockImpl.java
@@ -24,6 +24,13 @@ import java.io.Serializable;
 
 import org.videolan.vlma.model.media.Program;
 
+/**
+ * This implementation always return true. It will be called by
+ * {@link DirectMulticastStreamWatcher} if no appropriate watcher has been
+ * found.
+ *
+ * @author Adrien Grand <jpountz at videolan.org>
+ */
 public class StreamWatcherMockImpl implements StreamWatcher, Serializable {
 
     private static final long serialVersionUID = -7140427768396758460L;



More information about the vlma-devel mailing list