JMU
The J2ME Connection Framework
and Related Topics


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Using the Decorator Pattern

Add Capabilities to an Object Dynamically

images/decorator_pattern.gif
Input/Output Streams
images/j2me-io.gif
The Connection Framework
The Connection Framework (cont.)
images/j2me-connection-framework.gif
Schemes and Connection Types
Opening a Connection
  SocketConnection c = (SocketConnection)Connector.Open("socket://cs.jmu.edu:8120");
  
  UDPDatagramConnection c = (IDPDatagramConnection)Connector.Open("datagram://cs.jmu.edu:8120");
  
  HttpConnection c = (HttpConnection)Connector.Open("http://www.jmu.edu");
  
  FileConnection c = (FileConnection)Connector.Open("file://test.txt");