de.jiac.micro.core.handle
Interface IResourceHandle

All Superinterfaces:
IHandle

public interface IResourceHandle
extends IHandle

This interface provides functionalities to acquire resources

Version:
$Revision$
Author:
Marcel Patzlaff

Method Summary
 void close(javax.microedition.io.Connection con)
          Use this method to release the connection and all acquired resources.
 javax.microedition.io.Connection open(String url)
          This method opens a connection to the specified URL.
 IStreamConnection openStreamConnection(String url)
          This method opens a connection to the specified URL and tries to map it into an IStreamConnection.
 

Method Detail

open

javax.microedition.io.Connection open(String url)
                                      throws IOException
This method opens a connection to the specified URL. Connections created by this method MUST be released via close(Connection)!

Note: IConnectionFactories that are registered with the current agent are also available through this method!

Parameters:
url - The location to open the connection to
Returns:
The appropriate connection.
Throws:
IOException - if the URL is malformed or the connection could not be opened

openStreamConnection

IStreamConnection openStreamConnection(String url)
                                       throws IOException
This method opens a connection to the specified URL and tries to map it into an IStreamConnection.

Parameters:
url - The location to open the connection to
Returns:
The appropriate IStreamConnection.
Throws:
IOException - if no mapping could be found or everything open(String) throws

close

void close(javax.microedition.io.Connection con)
Use this method to release the connection and all acquired resources. Otherwise the agent won't be able to open subsequent connections if the limit is reached!

Parameters:
con - The connection to close.


Copyright © 2008-2011 DAI-Labor. All Rights Reserved.