CLDC Generic Connection Framework framework

  • Generalization of J2SE NW and I/O framework
  • Can map to low level hardware/J2SE classes
  • General Form":
    • Static function
  • No network protocols defined in CLDC
  • Bulk of App code stays same for diff protocols
  • Protocol Binding done at runtime.
  • Implemented as a hierarchy of connection interfaces(7)
  • One exception class: ConnectorNotFound
Classes and Interfaces
    • Interface Connection- Basic Connection
public void close() throws IOException;
    • Interface InputConnection- Device with data read capability
public InputStream openInputStream() throws IOException;
public DataInputStream openDataInputStream() throws IOException;
    • Interface OutputConnection- Device with Data write capability
public OutputStream openOutputStream() throws IOException;
DataOutputStream openDataOutputStream() throws IOException;

    • Interface StreamConnection-Combines InputConnection & OutputConnection
    • Interface ContentConnection -Sub interface of StreamConnection-Access to HTTP metadata
public String getType();
public String getEncoding();
public long getLength();
    • Interface StreamConnectionNotifier
public StreamConnection acceptAndOpen() throws IOException;
    • Interface DatagramConnection -Datagram endpoint
public int getMaximumLength() IOException;
public int getNominalLength() IOException;
    • Other functions for
      • send,
      • receive,
      • 4 newDatagram(with params byte, size, address)
Datagram type
  • has a data buffer associated with it.
  • Use DataInput and DataOutput.
  • Can behave like a stream

blog comments powered by Disqus