Java Doc for Connector.java in  » 6.0-JDK-Modules » j2me » javax » microedition » io » 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.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.microedition.io.Connector

Connector
public class Connector (Code)
This class is factory for creating new Connection objects.

The creation of Connections is performed dynamically by looking up a protocol implementation class whose name is formed from the platform name (read from a system property) and the protocol name of the requested connection (extracted from the parameter string supplied by the application programmer.) The parameter string that describes the target should conform to the URL format as described in RFC 2396. This takes the general form:

{scheme}:[{target}][{params}]

where {scheme} is the name of a protocol such as http}.

The {target} is normally some kind of network address.

Any {params} are formed as a series of equates of the form ";x=y". Example: ";type=a".

An optional second parameter may be specified to the open function. This is a mode flag that indicates to the protocol handler the intentions of the calling code. The options here specify if the connection is going to be read (READ), written (WRITE), or both (READ_WRITE). The validity of these flag settings is protocol dependent. For instance, a connection for a printer would not allow read access, and would throw an IllegalArgumentException. If the mode parameter is not specified, READ_WRITE is used by default.

An optional third parameter is a boolean flag that indicates if the calling code can handle timeout exceptions. If this flag is set, the protocol implementation may throw an InterruptedIOException when it detects a timeout condition. This flag is only a hint to the protocol handler, and it does not guarantee that such exceptions will actually be thrown. If this parameter is not set, no timeout exceptions will be thrown.

Because connections are frequently opened just to gain access to a specific input or output stream, four convenience functions are provided for this purpose. See also: DatagramConnection DatagramConnection for information relating to datagram addressing
version:
   12/17/01 (CLDC 1.1)
since:
   CLDC 1.0



Field Summary
final public static  intREAD
     Access mode READ.
final public static  intREAD_WRITE
     Access mode READ_WRITE.
final public static  intWRITE
     Access mode WRITE.


Method Summary
public static  Connectionopen(String name)
     Create and open a Connection.
Parameters:
  name - The URL for the connection.
public static  Connectionopen(String name, int mode)
     Create and open a Connection.
Parameters:
  name - The URL for the connection.
Parameters:
  mode - The access mode.
public static  Connectionopen(String name, int mode, boolean timeouts)
     Create and open a Connection.
public static  DataInputStreamopenDataInputStream(String name)
     Create and open a connection input stream.
Parameters:
  name - The URL for the connection.
public static  DataOutputStreamopenDataOutputStream(String name)
     Create and open a connection output stream.
Parameters:
  name - The URL for the connection.
public static  InputStreamopenInputStream(String name)
     Create and open a connection input stream.
Parameters:
  name - The URL for the connection.
public static  OutputStreamopenOutputStream(String name)
     Create and open a connection output stream.
Parameters:
  name - The URL for the connection.

Field Detail
READ
final public static int READ(Code)
Access mode READ.



READ_WRITE
final public static int READ_WRITE(Code)
Access mode READ_WRITE.



WRITE
final public static int WRITE(Code)
Access mode WRITE.





Method Detail
open
public static Connection open(String name) throws IOException(Code)
Create and open a Connection.
Parameters:
  name - The URL for the connection. A new Connection object.
exception:
  IllegalArgumentException - If a parameter is invalid.
exception:
  ConnectionNotFoundException - If the target of thename cannot be found, or if the requested protocol typeis not supported.
exception:
  IOException - If some other kind of I/O error occurs.
exception:
  SecurityException - May be thrown if access to theprotocol handler is prohibited.



open
public static Connection open(String name, int mode) throws IOException(Code)
Create and open a Connection.
Parameters:
  name - The URL for the connection.
Parameters:
  mode - The access mode. A new Connection object.
exception:
  IllegalArgumentException - If a parameter is invalid.
exception:
  ConnectionNotFoundException - If the target of thename cannot be found, or if the requested protocol typeis not supported.
exception:
  IOException - If some other kind of I/O error occurs.
exception:
  SecurityException - May be thrown if access to theprotocol handler is prohibited.



open
public static Connection open(String name, int mode, boolean timeouts) throws IOException(Code)
Create and open a Connection.
Parameters:
  name - The URL for the connection
Parameters:
  mode - The access mode
Parameters:
  timeouts - A flag to indicate that the callerwants timeout exceptions A new Connection object
exception:
  IllegalArgumentException - If a parameter is invalid.
exception:
  ConnectionNotFoundException - If the target of thename cannot be found, or if the requested protocol typeis not supported.
exception:
  IOException - If some other kind of I/O error occurs.
exception:
  SecurityException - May be thrown if access to theprotocol handler is prohibited.



openDataInputStream
public static DataInputStream openDataInputStream(String name) throws IOException(Code)
Create and open a connection input stream.
Parameters:
  name - The URL for the connection. A DataInputStream.
exception:
  IllegalArgumentException - If a parameter is invalid.
exception:
  ConnectionNotFoundException - If the target of thename cannot be found, or if the requested protocol typeis not supported.
exception:
  IOException - If some other kind of I/O error occurs.
exception:
  SecurityException - May be thrown if access to theprotocol handler is prohibited.



openDataOutputStream
public static DataOutputStream openDataOutputStream(String name) throws IOException(Code)
Create and open a connection output stream.
Parameters:
  name - The URL for the connection. A DataOutputStream.
exception:
  IllegalArgumentException - If a parameter is invalid.
exception:
  ConnectionNotFoundException - If the target of thename cannot be found, or if the requested protocol typeis not supported.
exception:
  IOException - If some other kind of I/O error occurs.
exception:
  SecurityException - May be thrown if access to theprotocol handler is prohibited.



openInputStream
public static InputStream openInputStream(String name) throws IOException(Code)
Create and open a connection input stream.
Parameters:
  name - The URL for the connection. An InputStream.
exception:
  IllegalArgumentException - If a parameter is invalid.
exception:
  ConnectionNotFoundException - If the target of thename cannot be found, or if the requested protocol typeis not supported.
exception:
  IOException - If some other kind of I/O error occurs.
exception:
  SecurityException - May be thrown if access to theprotocol handler is prohibited.



openOutputStream
public static OutputStream openOutputStream(String name) throws IOException(Code)
Create and open a connection output stream.
Parameters:
  name - The URL for the connection. An OutputStream.
exception:
  IllegalArgumentException - If a parameter is invalid.
exception:
  ConnectionNotFoundException - If the target of thename cannot be found, or if the requested protocol typeis not supported.
exception:
  IOException - If some other kind of I/O error occurs.
exception:
  SecurityException - May be thrown if access to theprotocol handler is prohibited.



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.