de.jiac.micro.agent
Interface IConnectionFactory


public interface IConnectionFactory

The IConnectionFactory should be extended by sensor or actuator elements to modify or extend the standard GCF behaviour.

Author:
Marcel Patzlaff

Method Summary
 String getScheme()
          This method must return the URI scheme that can be used with this connection factory.
 javax.microedition.io.Connection openConnection(String uri)
          This method must return a connection to the specified URI.
 

Method Detail

getScheme

String getScheme()
This method must return the URI scheme that can be used with this connection factory. It is called only once during the initialisation of the associated agent element.

If this factory specifies a URI that is also understood by the Connector then this factory overrides the standard mechanism.

Returns:
the scheme for the URIs this factory accepts

openConnection

javax.microedition.io.Connection openConnection(String uri)
                                                throws IOException
This method must return a connection to the specified URI.

If null is returned the given uri is applied with the Connector. If this method throws an exception, then the Connector will not be called! So you are able to just support some URIs with the specified scheme and delegate the rest to the standard Connector.

Parameters:
uri - the identifier that describes the connection endpoint
Returns:
a new or cached instance of the connection or null.
Throws:
IOException - if error occur while establishing the connection


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