com.gridsystems.innergrid.api
Class AbstractImplBase

java.lang.Object
  extended by com.gridsystems.innergrid.api.AbstractImplBase

public abstract class AbstractImplBase
extends java.lang.Object

Base implementation for SOAP connectors.

Version:
1.0
Author:
Xmas

Field Summary
protected  java.lang.String apiName
          The name of the remote API.
static org.apache.axis.EngineConfiguration CONFIG
          Singleton engine configuration.
protected  Connection conn
          The connection to use.
protected  java.net.URL currentUrl
          The current URL assigned to the stub.
static org.apache.axis.client.AxisClient ENGINE
          Singleton client engine.
protected  org.apache.axis.client.Stub stub
          The wrapped stub.
 
Constructor Summary
AbstractImplBase(Connection c, java.lang.String apiName)
          Creates a new instance associated to the specified connection, and with the given name.
 
Method Summary
protected  void axisCheckAttachments(java.lang.Object[] params)
          Iterates over an array of attachment parameters and checks that, if they are associated to a File instance, the file really exists.
protected  void axisConfigStub(org.apache.axis.client.Stub stub)
          Configures the stub.
protected abstract  org.apache.axis.client.Stub axisCreateStub(java.net.URL url)
          Create a stub instance of the appropriate class for the specific subclass implementation.
protected  org.apache.axis.client.Stub axisGetStub()
          Gets the stub instance to use in remote calls.
protected  void axisInitStub(org.apache.axis.client.Stub stub)
          Initializes the stub.
protected  KernelException processException(java.lang.Exception e)
          Processes incoming exceptions and converts them to the correct KernelException instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG

public static final org.apache.axis.EngineConfiguration CONFIG
Singleton engine configuration.


ENGINE

public static final org.apache.axis.client.AxisClient ENGINE
Singleton client engine.


conn

protected Connection conn
The connection to use.


apiName

protected java.lang.String apiName
The name of the remote API.


stub

protected org.apache.axis.client.Stub stub
The wrapped stub.


currentUrl

protected java.net.URL currentUrl
The current URL assigned to the stub.

Constructor Detail

AbstractImplBase

public AbstractImplBase(Connection c,
                        java.lang.String apiName)
                 throws KernelException
Creates a new instance associated to the specified connection, and with the given name.

Parameters:
c - The connection to use
apiName - The API name to set
Throws:
KernelException - CLT011 If the connection is null
KernelException - CLT014 If the API name is null or empty
Method Detail

axisCreateStub

protected abstract org.apache.axis.client.Stub axisCreateStub(java.net.URL url)
                                                       throws org.apache.axis.AxisFault
Create a stub instance of the appropriate class for the specific subclass implementation.

Parameters:
url - The target service url
Returns:
A newly created Stub instance
Throws:
org.apache.axis.AxisFault - If an error occurs creating the stub

axisGetStub

protected org.apache.axis.client.Stub axisGetStub()
                                           throws KernelException
Gets the stub instance to use in remote calls.

Returns:
The stub instance
Throws:
KernelException - If an error occurs creating the stub

axisInitStub

protected void axisInitStub(org.apache.axis.client.Stub stub)
Initializes the stub. This method will be called only once per stub instance.

The default initialization activates HTTP/1.1 protocol with chunked transfer encoding and non-persistent connections. It also sets the connection timeout to five minutes.

Chunked transfer encoding is needed to allow the server to detect corrupted or incomplete requests, and return the appropriate exception. If transfer encoding is not set to this value, the server will not be able to detect this condition, and the processor thread will hang until the client response read times out.

Parameters:
stub - The stub to initialise

axisConfigStub

protected void axisConfigStub(org.apache.axis.client.Stub stub)
Configures the stub. This method will be called before each remote call.

Parameters:
stub - The stub to configure

axisCheckAttachments

protected void axisCheckAttachments(java.lang.Object[] params)
                             throws KernelException
Iterates over an array of attachment parameters and checks that, if they are associated to a File instance, the file really exists.

Parameters:
params - The list of parameters of attachment type
Throws:
KernelException - CLT064 Attachment associated to a non-existent file

processException

protected KernelException processException(java.lang.Exception e)
Processes incoming exceptions and converts them to the correct KernelException instance.

Parameters:
e - The exception to process
Returns:
An equivalent KernelException instance


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.