public interface ConnectorService
javax.microedition.io.Connection
objects.
When an 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
method of the selected Connection Factory will then
be called to create the actual Connection
object.
If more than one Connection Factory service is registered for a particular
scheme, the service with the highest ranking (as specified in its
service.ranking
property) is called. If there is a tie in ranking,
the service with the lowest service ID (as specified in its
service.id
property), that is the service that was registered first,
is called. This is the same algorithm used by
BundleContext.getServiceReference
.
Modifier and Type | Field and Description |
---|---|
static int |
READ
Read access mode.
|
static int |
READ_WRITE
Read/Write access mode.
|
static int |
WRITE
Write access mode.
|
Modifier and Type | Method and Description |
---|---|
javax.microedition.io.Connection |
open(String name)
Create and open a
Connection object for the specified name. |
javax.microedition.io.Connection |
open(String name,
int mode)
Create and open a
Connection object for the specified name and
access mode. |
javax.microedition.io.Connection |
open(String name,
int mode,
boolean timeouts)
Create and open a
Connection object for the specified name,
access mode and timeouts. |
DataInputStream |
openDataInputStream(String name)
Create and open a
DataInputStream object for the specified name. |
DataOutputStream |
openDataOutputStream(String name)
Create and open a
DataOutputStream object for the specified name. |
InputStream |
openInputStream(String name)
Create and open an
InputStream object for the specified name. |
OutputStream |
openOutputStream(String name)
Create and open an
OutputStream object for the specified name. |
static final int READ
static final int WRITE
static final int READ_WRITE
javax.microedition.io.Connection open(String name) throws IOException
Connection
object for the specified name.name
- The URI for the connection.javax.microedition.io.Connection
object.IllegalArgumentException
- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException
- If the
connection cannot be found.IOException
- If some other kind of I/O error occurs.javax.microedition.io.Connection open(String name, int mode) throws IOException
Connection
object for the specified name and
access mode.name
- The URI for the connection.mode
- The access mode.javax.microedition.io.Connection
object.IllegalArgumentException
- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException
- If the
connection cannot be found.IOException
- If some other kind of I/O error occurs.javax.microedition.io.Connection open(String name, int mode, boolean timeouts) throws IOException
Connection
object for the specified name,
access mode and timeouts.name
- The URI for the connection.mode
- The access mode.timeouts
- A flag to indicate that the caller wants timeout
exceptions.javax.microedition.io.Connection
object.IllegalArgumentException
- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException
- If the
connection cannot be found.IOException
- If some other kind of I/O error occurs.InputStream openInputStream(String name) throws IOException
InputStream
object for the specified name.name
- The URI for the connection.InputStream
object.IllegalArgumentException
- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException
- If the
connection cannot be found.IOException
- If some other kind of I/O error occurs.DataInputStream openDataInputStream(String name) throws IOException
DataInputStream
object for the specified name.name
- The URI for the connection.DataInputStream
object.IllegalArgumentException
- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException
- If the
connection cannot be found.IOException
- If some other kind of I/O error occurs.OutputStream openOutputStream(String name) throws IOException
OutputStream
object for the specified name.name
- The URI for the connection.OutputStream
object.IllegalArgumentException
- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException
- If the
connection cannot be found.IOException
- If some other kind of I/O error occurs.DataOutputStream openDataOutputStream(String name) throws IOException
DataOutputStream
object for the specified name.name
- The URI for the connection.DataOutputStream
object.IllegalArgumentException
- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException
- If the
connection cannot be found.IOException
- If some other kind of I/O error occurs.Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0