Methods Summary |
---|
public abstract void | connect()Open a connection to the source described by
the MediaLocator .
The connect method initiates communication with the source.
|
public abstract void | disconnect()Close the connection to the source described by the locator.
The disconnect method frees resources used to maintain a
connection to the source.
If no resources are in use, disconnect is ignored.
If stop hasn't already been called,
calling disconnect implies a stop.
|
public abstract java.lang.String | getContentType()Get a string that describes the content-type of the media
that the source is providing.
It is an error to call getContentType if the source is
not connected.
|
public javax.media.MediaLocator | getLocator()Get the MediaLocator that describes this source.
Returns null if the locator hasn't been set.
(Very unlikely.)
return sourceLocator;
|
protected void | initCheck()Check to see if this connection has been
initialized with a MediaLocator .
If the connection hasn't been initialized,
initCheck throws an UninitializedError .
Most methods should call initCheck on entry.
if(sourceLocator == null) {
// $jdr: This should a real media error.
throw new java.lang.Error("Uninitialized DataSource error.");
}
|
public void | setLocator(javax.media.MediaLocator source)Set the connection source for this DataSource .
This method should only be called once; an error is thrown if
the locator has already been set.
if( sourceLocator == null) {
sourceLocator = source;
} else {
// $jdr: Should we name the error here?
throw new java.lang.Error("Locator already set on DataSource.");
}
|
public abstract void | start()Initiate data-transfer. The start method must be
called before data is available.
(You must call connect before calling start .)
|
public abstract void | stop()Stop the data-transfer.
If the source has not been connected and started,
stop does nothing.
|