Package org.osgi.service.io
Interface ConnectorService
public interface ConnectorService
The Connector Service should be called to create and open
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
.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Read access mode.static final int
Read/Write access mode.static final int
Write access mode. -
Method Summary
Modifier and TypeMethodDescriptionjavax.microedition.io.Connection
Create and open aConnection
object for the specified name.javax.microedition.io.Connection
Create and open aConnection
object for the specified name and access mode.javax.microedition.io.Connection
Create and open aConnection
object for the specified name, access mode and timeouts.openDataInputStream
(String name) Create and open aDataInputStream
object for the specified name.openDataOutputStream
(String name) Create and open aDataOutputStream
object for the specified name.openInputStream
(String name) Create and open anInputStream
object for the specified name.openOutputStream
(String name) Create and open anOutputStream
object for the specified name.
-
Field Details
-
READ
static final int READRead access mode.- See Also:
-
WRITE
static final int WRITEWrite access mode.- See Also:
-
READ_WRITE
static final int READ_WRITERead/Write access mode.- See Also:
-
-
Method Details
-
open
Create and open aConnection
object for the specified name.- Parameters:
name
- The URI for the connection.- Returns:
- A new
javax.microedition.io.Connection
object. - Throws:
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.- See Also:
-
open
Create and open aConnection
object for the specified name and access mode.- Parameters:
name
- The URI for the connection.mode
- The access mode.- Returns:
- A new
javax.microedition.io.Connection
object. - Throws:
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.- See Also:
-
open
Create and open aConnection
object for the specified name, access mode and timeouts.- Parameters:
name
- The URI for the connection.mode
- The access mode.timeouts
- A flag to indicate that the caller wants timeout exceptions.- Returns:
- A new
javax.microedition.io.Connection
object. - Throws:
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.- See Also:
-
openInputStream
Create and open anInputStream
object for the specified name.- Parameters:
name
- The URI for the connection.- Returns:
- An
InputStream
object. - Throws:
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.- See Also:
-
openDataInputStream
Create and open aDataInputStream
object for the specified name.- Parameters:
name
- The URI for the connection.- Returns:
- A
DataInputStream
object. - Throws:
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.- See Also:
-
openOutputStream
Create and open anOutputStream
object for the specified name.- Parameters:
name
- The URI for the connection.- Returns:
- An
OutputStream
object. - Throws:
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.- See Also:
-
openDataOutputStream
Create and open aDataOutputStream
object for the specified name.- Parameters:
name
- The URI for the connection.- Returns:
- A
DataOutputStream
object. - Throws:
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.- See Also:
-