org.osgi.service.io
Interface ConnectionFactory


public interface ConnectionFactory

A Connection Factory service is called by the implementation of the Connector Service to create javax.microedition.io.Connection objects which implement the scheme named by IO_SCHEME. When a ConnectorService.open method is called, the implementation of the Connector Service will examine the specified name for a scheme. The Connector Service will then look for a Connection Factory service which is registered with the service property IO_SCHEME which matches the scheme. The createConnection(java.lang.String, int, boolean) method of the selected Connection Factory will then be called to create the actual Connection object.

Version:
$Revision: 7337 $

Field Summary
static String IO_SCHEME
          Service property containing the scheme(s) for which this Connection Factory can create Connection objects.
 
Method Summary
 javax.microedition.io.Connection createConnection(String name, int mode, boolean timeouts)
          Create a new Connection object for the specified URI.
 

Field Detail

IO_SCHEME

static final String IO_SCHEME
Service property containing the scheme(s) for which this Connection Factory can create Connection objects. This property is of type String[].

See Also:
Constant Field Values
Method Detail

createConnection

javax.microedition.io.Connection createConnection(String name,
                                                  int mode,
                                                  boolean timeouts)
                                                  throws IOException
Create a new Connection object for the specified URI.

Parameters:
name - The full URI passed to the ConnectorService.open method
mode - The mode parameter passed to the ConnectorService.open method
timeouts - The timeouts parameter passed to the ConnectorService.open method
Returns:
A new javax.microedition.io.Connection object.
Throws:
IOException - If a javax.microedition.io.Connection object can not not be created.


Copyright © 2006-2011 OSGi Alliance. All Rights Reserved.