Java Doc for DataSource.java in  » 6.0-JDK-Modules » j2me » javax » microedition » media » protocol » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » javax.microedition.media.protocol 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.microedition.media.protocol.DataSource

DataSource
abstract public class DataSource implements Controllable(Code)
A DataSource is an abstraction for media protocol-handlers. It hides the details of how the data is read from source--whether the data is coming from a file, streaming server or proprietary delivery mechanism. It provides the methods for a Player to access the input data.

An application-defined protocol can be implemented with a custom DataSource. A Player can then be created for playing back the media from the custom DataSource using the Manager.createPlayer method.

There are a few reasons why one would choose to implement a DataSource as opposed to an InputStream for a custom protocol:

  • DataSource/SourceStream provides the random seeking API that is not supported by an InputStream. i.e., if the custom protocol requires random seeking capabilities, a custom DataSource can be used.
  • DataSource/SourceStream supports the concept of transfer size that is more suited for frame-delimited data, e.g. video.

A DataSource contains a set of SourceStreams. Each SourceStream represents one elementary data stream of the source. In the most common case, a DataSource only provides one SourceStream. A DataSource may provide multiple SourceStreams if it encapsulates multiple elementary data streams.

Each of the SourceStreams provides the methods to allow a Player to read data for processing.

DataSource manages the life-cycle of the media source by providing a simple connection protocol.

DataSource implements Controllable which provides extra controls via some type-specific Control interfaces. getControl and getControls can only be called when the DataSource is connected. An IllegalStateException will be thrown otherwise.
See Also:   
javax.microedition.media.Manager
See Also:   javax.microedition.media.protocol.SourceStream
See Also:   javax.microedition.media.protocol.ContentDescriptor




Constructor Summary
public  DataSource(String locator)
     Construct a DataSource from a locator.

Method Summary
abstract public  voidconnect()
     Open a connection to the source described by the locator and initiate communication.
abstract public  voiddisconnect()
     Close the connection to the source described by the locator and free resources used to maintain the connection.
abstract public  StringgetContentType()
     Get a string that describes the content-type of the media that the source is providing.
abstract public  ControlgetControl(String controlType)
    
abstract public  Control[]getControls()
    
public  StringgetLocator()
     Get the locator that describes this source. Returns null if the locator hasn't been set.
abstract public  SourceStream[]getStreams()
     Get the collection of streams that this source manages.
abstract public  voidstart()
     Initiate data-transfer.
abstract public  voidstop()
     Stop the data-transfer.


Constructor Detail
DataSource
public DataSource(String locator)(Code)
Construct a DataSource from a locator. This method should be overloaded by subclasses; the default implementation just keeps track of the locator.
Parameters:
  locator - The locator that describesthe DataSource.




Method Detail
connect
abstract public void connect() throws IOException(Code)
Open a connection to the source described by the locator and initiate communication.
exception:
  IOException - Thrown if there are IO problemswhen connect is called.
exception:
  SecurityException - Thrown if the caller does nothave security permission to call connect.



disconnect
abstract public void disconnect()(Code)
Close the connection to the source described by the locator and free resources used to maintain the connection.

If no resources are in use, disconnect is ignored. If stop hasn't already been called, calling disconnect implies a stop.




getContentType
abstract public String getContentType()(Code)
Get a string that describes the content-type of the media that the source is providing. The name that describes the media content.Returns null if the content is unknown.
exception:
  IllegalStateException - Thrown if the source isnot connected.



getControl
abstract public Control getControl(String controlType)(Code)



getControls
abstract public Control[] getControls()(Code)



getLocator
public String getLocator()(Code)
Get the locator that describes this source. Returns null if the locator hasn't been set. The locator for this source.



getStreams
abstract public SourceStream[] getStreams()(Code)
Get the collection of streams that this source manages. The collection of streams is entirely content dependent. The MIME type of this DataSource provides the only indication of what streams may be available on this connection. The collection of streams for this source.
exception:
  IllegalStateException - Thrown if the sourceis not connected.



start
abstract public void start() throws IOException(Code)
Initiate data-transfer. The start method must be called before data is available for reading.
exception:
  IllegalStateException - Thrown if the DataSource is not connected.
exception:
  IOException - Thrown if the DataSourcecannot be started due to some IO problems.
exception:
  SecurityException - Thrown if the caller does nothave security permission to call start.



stop
abstract public void stop() throws IOException(Code)
Stop the data-transfer. If the DataSource has not been connected and started, stop is ignored.
exception:
  IOException - Thrown if the DataSourcecannot be stopped due to some IO problems.



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.