Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jreceiver.server.stream.capture
Class MusicInputStreamFactory  view MusicInputStreamFactory download MusicInputStreamFactory.java

java.lang.Object
  extended byjreceiver.server.stream.capture.MusicInputStreamFactory

public final class MusicInputStreamFactory
extends java.lang.Object

This provides support for getting MusicInputStream objects. It stores them and then returns the correct object at a later date. It can store multiple MusicInputStream objects for a single URL -- think multiple players playing the same stream. It serves up the object that has a correct offset. This is not quite the optimal strategy -- it probably ought to preferentially return the stream where the requested offset is at the 'end'.

Version:
$Revision: 1.8 $ $Date: 2002/12/29 00:44:07 $

Field Summary
protected static org.apache.commons.logging.Log log
          logging object
private static java.util.Hashtable table
          A table of current MusicInputStream objects -- indexed by URL
 
Constructor Summary
MusicInputStreamFactory()
           
 
Method Summary
static MusicInputStream getStream(java.net.URL url, int pos, java.lang.String mimeType)
          Obtains a MusicInputStream object for the requested URL at the requested position.
static MusicInputStream getStream(java.net.URL url, int pos, java.lang.String mimeType, java.lang.String srcMimeType)
          Obtains a MusicInputStream object for the requested URL at the requested position.
static void removeMusicInputStream(java.net.URL url, MusicInputStream stream)
          Removes a music stream from the table.
static void removeStream(java.net.URL url, int pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

private static java.util.Hashtable table
A table of current MusicInputStream objects -- indexed by URL


log

protected static org.apache.commons.logging.Log log
logging object

Constructor Detail

MusicInputStreamFactory

public MusicInputStreamFactory()
Method Detail

getStream

public static MusicInputStream getStream(java.net.URL url,
                                         int pos,
                                         java.lang.String mimeType)
                                  throws java.io.IOException
Obtains a MusicInputStream object for the requested URL at the requested position. This allows us to disabiguate two people asking for the same stream.


getStream

public static MusicInputStream getStream(java.net.URL url,
                                         int pos,
                                         java.lang.String mimeType,
                                         java.lang.String srcMimeType)
                                  throws java.io.IOException
Obtains a MusicInputStream object for the requested URL at the requested position. This allows us to disabiguate two people asking for the same stream.


removeStream

public static void removeStream(java.net.URL url,
                                int pos)

removeMusicInputStream

public static void removeMusicInputStream(java.net.URL url,
                                          MusicInputStream stream)
Removes a music stream from the table. This is only called by the MusicInputStream object itself on a timeout.