Package org.osgi.service.io
Interface ConnectorService
-
public interface ConnectorServiceThe Connector Service should be called to create and openjavax.microedition.io.Connectionobjects. When anopen*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 propertyIO_SCHEMEwhich matches the scheme. ThecreateConnectionmethod of the selected Connection Factory will then be called to create the actualConnectionobject.If more than one Connection Factory service is registered for a particular scheme, the service with the highest ranking (as specified in its
service.rankingproperty) is called. If there is a tie in ranking, the service with the lowest service ID (as specified in itsservice.idproperty), that is the service that was registered first, is called. This is the same algorithm used byBundleContext.getServiceReference.
-
-
Field Summary
Fields Modifier and Type Field Description static intREADRead access mode.static intREAD_WRITERead/Write access mode.static intWRITEWrite access mode.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.microedition.io.Connectionopen(java.lang.String name)Create and open aConnectionobject for the specified name.javax.microedition.io.Connectionopen(java.lang.String name, int mode)Create and open aConnectionobject for the specified name and access mode.javax.microedition.io.Connectionopen(java.lang.String name, int mode, boolean timeouts)Create and open aConnectionobject for the specified name, access mode and timeouts.java.io.DataInputStreamopenDataInputStream(java.lang.String name)Create and open aDataInputStreamobject for the specified name.java.io.DataOutputStreamopenDataOutputStream(java.lang.String name)Create and open aDataOutputStreamobject for the specified name.java.io.InputStreamopenInputStream(java.lang.String name)Create and open anInputStreamobject for the specified name.java.io.OutputStreamopenOutputStream(java.lang.String name)Create and open anOutputStreamobject for the specified name.
-
-
-
Field Detail
-
READ
static final int READ
Read access mode.- See Also:
- "javax.microedition.io.Connector.READ", Constant Field Values
-
WRITE
static final int WRITE
Write access mode.- See Also:
- "javax.microedition.io.Connector.WRITE", Constant Field Values
-
READ_WRITE
static final int READ_WRITE
Read/Write access mode.- See Also:
- "javax.microedition.io.Connector.READ_WRITE", Constant Field Values
-
-
Method Detail
-
open
javax.microedition.io.Connection open(java.lang.String name) throws java.io.IOExceptionCreate and open aConnectionobject for the specified name.- Parameters:
name- The URI for the connection.- Returns:
- A new
javax.microedition.io.Connectionobject. - Throws:
java.lang.IllegalArgumentException- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException- If the connection cannot be found.java.io.IOException- If some other kind of I/O error occurs.- See Also:
- "javax.microedition.io.Connector.open(String name)"
-
open
javax.microedition.io.Connection open(java.lang.String name, int mode) throws java.io.IOExceptionCreate and open aConnectionobject for the specified name and access mode.- Parameters:
name- The URI for the connection.mode- The access mode.- Returns:
- A new
javax.microedition.io.Connectionobject. - Throws:
java.lang.IllegalArgumentException- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException- If the connection cannot be found.java.io.IOException- If some other kind of I/O error occurs.- See Also:
- "javax.microedition.io.Connector.open(String name, int mode)"
-
open
javax.microedition.io.Connection open(java.lang.String name, int mode, boolean timeouts) throws java.io.IOExceptionCreate and open aConnectionobject 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.Connectionobject. - Throws:
java.lang.IllegalArgumentException- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException- If the connection cannot be found.java.io.IOException- If some other kind of I/O error occurs.- See Also:
- "javax.microedition.io.Connector.open(String name, int mode, boolean timeouts)"
-
openInputStream
java.io.InputStream openInputStream(java.lang.String name) throws java.io.IOExceptionCreate and open anInputStreamobject for the specified name.- Parameters:
name- The URI for the connection.- Returns:
- An
InputStreamobject. - Throws:
java.lang.IllegalArgumentException- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException- If the connection cannot be found.java.io.IOException- If some other kind of I/O error occurs.- See Also:
- "javax.microedition.io.Connector.openInputStream(String name)"
-
openDataInputStream
java.io.DataInputStream openDataInputStream(java.lang.String name) throws java.io.IOExceptionCreate and open aDataInputStreamobject for the specified name.- Parameters:
name- The URI for the connection.- Returns:
- A
DataInputStreamobject. - Throws:
java.lang.IllegalArgumentException- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException- If the connection cannot be found.java.io.IOException- If some other kind of I/O error occurs.- See Also:
- "javax.microedition.io.Connector.openDataInputStream(String name)"
-
openOutputStream
java.io.OutputStream openOutputStream(java.lang.String name) throws java.io.IOExceptionCreate and open anOutputStreamobject for the specified name.- Parameters:
name- The URI for the connection.- Returns:
- An
OutputStreamobject. - Throws:
java.lang.IllegalArgumentException- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException- If the connection cannot be found.java.io.IOException- If some other kind of I/O error occurs.- See Also:
- "javax.microedition.io.Connector.openOutputStream(String name)"
-
openDataOutputStream
java.io.DataOutputStream openDataOutputStream(java.lang.String name) throws java.io.IOExceptionCreate and open aDataOutputStreamobject for the specified name.- Parameters:
name- The URI for the connection.- Returns:
- A
DataOutputStreamobject. - Throws:
java.lang.IllegalArgumentException- If a parameter is invalid.javax.microedition.io.ConnectionNotFoundException- If the connection cannot be found.java.io.IOException- If some other kind of I/O error occurs.- See Also:
- "javax.microedition.io.Connector.openDataOutputStream(String name)"
-
-