The HTTP Connection Bundle wraps a connection factory implementing the http scheme. This scheme provides means for communication over HTTP. It can be used by bundles which need to establish connection with bundles running on the local or remote framework.
Contents:
The JAR file of this bundle is httpconn.jar, located in the bundles folder.
|
Note: The HTTP Connection Bundle uses the HTTP Service for transferring information over HTTP. Hence, you cannot start the bundle if the HTTP Bundle is not active too.
Note: If the bundle is started on the Standard Version of the framework, the connection APIs are exported by the Connector Service Bundle. If the bundle is started on the Connector Version of the framework, these APIs are exported by the System Bundle.
Note: If the bundle is started on ProSyst mBS,
the com.prosyst.util.ref package is exported by the ProSyst Util
Bundle. If it is started on an OSGi framework provided by another vendor, the
package is exported by the ProSyst Util Full Bundle.
None.
This service publishes the org.osgi.service.io.ConnectionFactory
interface and represents a connection factory for the OSGi communication model,
described in the OSGi IO Connector Service Specification. It is used by the
IO Connector Service (exported by the Connector Service Bundle or by the System Bundle,
depending on the version of the framework) for creating connections over the
http scheme.
The HTTP Connection Factory handles connection requests for the http scheme. It provides communication over the HTTP v 1.1 protocol. This means that the keep connection alive option and proxy management are implemented.
The HTTP Connection Factory supports two connection types:
javax.microedition.io.StreamConnection and javax.microedition.io.StreamConnectionNotifier.IOException
is thrown. The created connection implements javax.microedition.io.StreamConnection
and org.mbs.services.io.ConnectionNotifier.
Creating a client side connection requires passing a client http URI to the IO Connector Service.
Note: If the connection factory is unregistered, all created connections are closed.
All URIs processed by the HTTP Connection Factory must start with "http:". However, there is a slight difference between client side URIs and server side URIs.
A valid server URI must have the following syntax:
http:/<alias>
where <alias> stands for the HTTP alias with which the servlet registered by the server HTTP connection is created.
For example, a server http URI may look like this:
http:/http_serv_alias
A client connection URI must have the following form:
http://<host>[:<port>]/<alias>
where <host> stands for the machine on which the server socket is waiting. The [..] brackets represent an optional part. They are not part of the URI itself. If the port occupied by the server is different from the default value: 80, it must be passed to the URI. If the occupied port is 80, it may be omitted from the URI. The <alias> part represents the HTTP alias under which the server connection has registered its servlet.
For example, the client URI may look like this:
http://127.0.0.1:8080/http_serv_alias
Note: Some parts of the URI are case sensitive! For details, refer to RFC 2396.
If you want to use the HTTP Connection Factory as an underlying transport implementation
for your connections, you must invoke the IO Connector Service, exported by
the Connector Service Bundle/System Bundle, and pass an http URI to its
open method. For more information refer to the Connector
Service Bundle description. You can manage the created connections using
the methods of the respective subinterfaces of javax.microedition.io.Connection.
See Client-side connections and Server side
connections for details.
The HTTP Connection Bundle owns a number of user-definable system properties. The first two serve for debug purposes. The rest of the properties are applied when using a proxy.
|
If you set/change these properties after the bundle has been activated, you must restart it so that it will accept the new values.