org.jcoderz.commons.connector.http
Class HttpConnectionFactoryImpl

java.lang.Object
  extended by org.jcoderz.commons.connector.http.HttpConnectionFactoryImpl
All Implemented Interfaces:
HttpConnectionFactory

public class HttpConnectionFactoryImpl
extends Object
implements HttpConnectionFactory

Factory for the creation of a connection handle used by the client.


Constructor Summary
HttpConnectionFactoryImpl(HttpManagedConnectionFactoryImpl mcf, ConnectionManager cm)
          Constructor.
 
Method Summary
 HttpConnection getConnection(HttpConnectionSpec connectionSpec)
          Get a connection handle for an HTTP connection using request-specific properties.
protected  HttpConnection getConnectionHandle(HttpConnectionSpec connectionSpec)
          Gets a HttpConnection implementation (here: HttpConnectionImpl - see deployment descriptor) as counterpart of the HttpManagedConnectionImpl.
 String getDescription()
          Get the human-readable description.
 Reference getReference()
          
 void setDescription(String desc)
          Set the human-readable description.
 void setReference(Reference reference)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpConnectionFactoryImpl

public HttpConnectionFactoryImpl(HttpManagedConnectionFactoryImpl mcf,
                                 ConnectionManager cm)
Constructor.

Parameters:
mcf - the used ManagedConnectionFactory
cm - the used ConnectionManager
Method Detail

getConnection

public HttpConnection getConnection(HttpConnectionSpec connectionSpec)
                             throws ResourceException
Get a connection handle for an HTTP connection using request-specific properties.

Example:
 HttpConnectionFactory mConnectionFactory = ...;
 HttpConnectionSpec cs = new HttpConnectionSpec(this);
 cs.setUrl("http://host.somewhere.com/");
 
 HttpConnection connection = mConnectionFactory.getConnection(cs);
 
 

Specified by:
getConnection in interface HttpConnectionFactory
Parameters:
connectionSpec - HttpConnectionSpec instance holding request-specific properties.
Returns:
HttpConnection handle.
Throws:
ResourceException - indicating an error condition on application server side.

getConnectionHandle

protected HttpConnection getConnectionHandle(HttpConnectionSpec connectionSpec)
                                      throws ResourceException
Gets a HttpConnection implementation (here: HttpConnectionImpl - see deployment descriptor) as counterpart of the HttpManagedConnectionImpl. This connection does not support multiple retries and is used within the HttpConnectionHelper to provide retries.

Parameters:
connectionSpec - specifies the target system
Returns:
HttpConnection an implementation of the HttpConnection interface
Throws:
ResourceException

setReference

public void setReference(Reference reference)


getReference

public Reference getReference()


getDescription

public String getDescription()
Get the human-readable description.

Returns:
String - the description of the connector as part of the deployment descriptor

setDescription

public void setDescription(String desc)
Set the human-readable description.

Parameters:
desc - the description of the connector as part of the deployment descriptor


Copyright 2007 The jCoderZ Project.