Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.osgi.service.io;
 
 import  javax.microedition.io.Connection;
 import  javax.microedition.io.Connector;

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.

Author(s):
$Id: 3965bf616b44ab3459343f1fa761567b484ccbe9 $
 
 public interface ConnectorService {
Read access mode.

See also:
"javax.microedition.io.Connector.READ"
 
 	public static final int	READ		= Connector.READ;
Write access mode.

See also:
"javax.microedition.io.Connector.WRITE"
 
 	public static final int	WRITE		= Connector.WRITE;
Read/Write access mode.

See also:
"javax.microedition.io.Connector.READ_WRITE"
 
 	public static final int	READ_WRITE	= Connector.READ_WRITE;

Create and open a Connection 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:
"javax.microedition.io.Connector.open(String name)"
 
 	public Connection open(String namethrows IOException;

Create and open a Connection 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:
"javax.microedition.io.Connector.open(String name, int mode)"
 
 	public Connection open(String nameint modethrows IOException;

Create and open a Connection 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:
"javax.microedition.io.Connector.open(String name, int mode, boolean timeouts)"
	public Connection open(String nameint modeboolean timeoutsthrows IOException;

Create and open an InputStream 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:
"javax.microedition.io.Connector.openInputStream(String name)"
	public InputStream openInputStream(String namethrows IOException;

Create and open a DataInputStream 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:
"javax.microedition.io.Connector.openDataInputStream(String name)"
Create and open an OutputStream 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:
"javax.microedition.io.Connector.openOutputStream(String name)"
Create and open a DataOutputStream 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:
"javax.microedition.io.Connector.openDataOutputStream(String name)"
New to GrepCode? Check out our FAQ X