com.gridsystems.innergrid.api
Class ClientApiFactory

java.lang.Object
  extended by org.apache.axis.transport.http.HTTPConstants
      extended by com.gridsystems.innergrid.api.ClientApiFactory

public abstract class ClientApiFactory
extends org.apache.axis.transport.http.HTTPConstants

ApiClientFactory type.

Author:
Rodrigo Ruiz

Nested Class Summary
static class ClientApiFactory.ApiEntry
          Client API registry entry.
 
Field Summary
 
Fields inherited from class org.apache.axis.transport.http.HTTPConstants
COMPRESSION_GZIP, HEADER_ACCEPT, HEADER_ACCEPT_APPL_SOAP, HEADER_ACCEPT_APPLICATION_DIME, HEADER_ACCEPT_ENCODING, HEADER_ACCEPT_MULTIPART_RELATED, HEADER_ACCEPT_TEXT_ALL, HEADER_AUTHORIZATION, HEADER_CACHE_CONTROL, HEADER_CACHE_CONTROL_NOCACHE, HEADER_CONNECTION, HEADER_CONNECTION_CLOSE, HEADER_CONNECTION_KEEPALIVE, HEADER_CONTENT_DESCRIPTION, HEADER_CONTENT_ENCODING, HEADER_CONTENT_ID, HEADER_CONTENT_LENGTH, HEADER_CONTENT_LOCATION, HEADER_CONTENT_TRANSFER_ENCODING, HEADER_CONTENT_TYPE, HEADER_CONTENT_TYPE_JMS, HEADER_COOKIE, HEADER_COOKIE2, HEADER_DEFAULT_CHAR_ENCODING, HEADER_EXPECT, HEADER_EXPECT_100_Continue, HEADER_HOST, HEADER_LOCATION, HEADER_POST, HEADER_PRAGMA, HEADER_PROTOCOL_10, HEADER_PROTOCOL_11, HEADER_PROTOCOL_V10, HEADER_PROTOCOL_V11, HEADER_PROXY_AUTHORIZATION, HEADER_SET_COOKIE, HEADER_SET_COOKIE2, HEADER_SOAP_ACTION, HEADER_TRANSFER_ENCODING, HEADER_TRANSFER_ENCODING_CHUNKED, HEADER_USER_AGENT, MC_ACCEPT_GZIP, MC_GZIP_REQUEST, MC_HTTP_SERVLET, MC_HTTP_SERVLETLOCATION, MC_HTTP_SERVLETPATHINFO, MC_HTTP_SERVLETREQUEST, MC_HTTP_SERVLETRESPONSE, MC_HTTP_SOAPACTION, MC_HTTP_STATUS_CODE, MC_HTTP_STATUS_MESSAGE, PLUGIN_ENABLE_LIST, PLUGIN_ENGINE, PLUGIN_EXCEPTION_LOG, PLUGIN_IS_DEVELOPMENT, PLUGIN_LOG, PLUGIN_NAME, PLUGIN_SERVICE_NAME, PLUGIN_WRITER, REQUEST_HEADERS, RESPONSE_HEADERS
 
Constructor Summary
protected ClientApiFactory()
          Creates a new instance.
 
Method Summary
static void fixTypeMapping(java.lang.String svcName, java.lang.Class<?> javaType, javax.xml.namespace.QName xmlType)
          Moves a type mapping defined in the "" encoding to the default encoding.
static org.apache.axis.WSDDEngineConfiguration getConfig()
          Gets the back-end engine configuration.
static org.apache.axis.client.AxisClient getEngine()
          Gets the back-end engine.
 java.rmi.Remote getPort(ClientApiFactory.ApiEntry entry, Connection con)
          Creates a stub instance for the given API.
static
<T extends java.rmi.Remote>
T
newApi(java.lang.Class<T> iface, Connection con)
          Creates a new API stub instance.
static
<T extends java.rmi.Remote>
T
newApi(java.lang.Class<T> iface, javax.xml.namespace.QName serviceName, Connection con)
          Creates a new API stub instance.
protected  java.rmi.Remote newInstance(ClientApiFactory.ApiEntry entry, Connection con)
          Creates a new instance using a dynamic proxy.
static void register(ClientApiFactory.ApiEntry api)
          Registers this instance into the FACTORIES map.
protected abstract  void registerApis()
          Hook for registering the APIs this factory is responsible for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientApiFactory

protected ClientApiFactory()
Creates a new instance.

Method Detail

register

public static void register(ClientApiFactory.ApiEntry api)
Registers this instance into the FACTORIES map.

Parameters:
api - API entry descriptor

registerApis

protected abstract void registerApis()
Hook for registering the APIs this factory is responsible for.


newInstance

protected java.rmi.Remote newInstance(ClientApiFactory.ApiEntry entry,
                                      Connection con)
                               throws javax.xml.rpc.ServiceException
Creates a new instance using a dynamic proxy.

Parameters:
entry - The API descriptor
con - Used to configure target endpoint and authentication
Returns:
An implementation of "iface"
Throws:
javax.xml.rpc.ServiceException - If an error occurs

getPort

public final java.rmi.Remote getPort(ClientApiFactory.ApiEntry entry,
                                     Connection con)
                              throws javax.xml.rpc.ServiceException
Creates a stub instance for the given API.

Parameters:
entry - The API descriptor
con - Used to configure target endpoint and authentication
Returns:
The stub
Throws:
javax.xml.rpc.ServiceException - If an error occurs

newApi

public static <T extends java.rmi.Remote> T newApi(java.lang.Class<T> iface,
                                                   Connection con)
                                        throws java.lang.Exception
Creates a new API stub instance.

Type Parameters:
T - The stub type
Parameters:
iface - The stub interface class
con - The connection
Returns:
A stub
Throws:
java.lang.Exception - If an error occurs

newApi

public static <T extends java.rmi.Remote> T newApi(java.lang.Class<T> iface,
                                                   javax.xml.namespace.QName serviceName,
                                                   Connection con)
                                        throws java.lang.Exception
Creates a new API stub instance.

Type Parameters:
T - Stub type
Parameters:
iface - Stub interface class
serviceName - Service qualified name
con - Connection
Returns:
A stub instance
Throws:
java.lang.Exception - If an error occurs

getConfig

public static org.apache.axis.WSDDEngineConfiguration getConfig()
Gets the back-end engine configuration.

Returns:
The engine configuration

getEngine

public static org.apache.axis.client.AxisClient getEngine()
Gets the back-end engine.

Returns:
The engine

fixTypeMapping

public static void fixTypeMapping(java.lang.String svcName,
                                  java.lang.Class<?> javaType,
                                  javax.xml.namespace.QName xmlType)
Moves a type mapping defined in the "" encoding to the default encoding.

Parameters:
svcName - The service name
javaType - The java class
xmlType - The QName of the XML type


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