net.sf.gwtspringrpc
Class GWTSpringRPCConfig

java.lang.Object
  extended by net.sf.gwtspringrpc.GWTSpringRPCConfig

public class GWTSpringRPCConfig
extends Object

This class wraps the GWTSpringRPC.properties configuration file to allow custom instances to be configured for:

Since:
1.0
Author:
Mike Clemens

Field Summary
static String BEAN_NAME_RESOLVER
          The resource bundle property name for a BeanNameResolver instance
private static GWTSpringRPCConfig instance
           
private  Log log
           
static String RESOURCE_BUNDLE_NAME
          The name of the GWTSpringRPC configuration resource bundle
static String WEB_APPLICATION_CONTEXT_RETRIEVER
          The resource bundle property name for a WebApplicationContextRetriever instance
 
Constructor Summary
protected GWTSpringRPCConfig()
          The default constructor is protected since the GWTSpringRPCConfig class is a singleton; to retrieve the instance, use the static getInstance() method.
 
Method Summary
 String getBeanNameResolverClassname(String servletName)
          Retrieves the classname for the BeanNameResolver instance configured for the specified servlet.
static GWTSpringRPCConfig getInstance()
          Retrieves the singleton GWTSpringRPCConfig instance.
private  String getValue(String prefix, String servletName)
          Retrieves a value from the configuration properties file.
 String getWebApplicationContextRetrieverClassname(String servletName)
          Retrieves the classname for the WebApplicationContextRetriever instance configured for the specified servlet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static GWTSpringRPCConfig instance

log

private final Log log

RESOURCE_BUNDLE_NAME

public static final String RESOURCE_BUNDLE_NAME
The name of the GWTSpringRPC configuration resource bundle

See Also:
Constant Field Values

WEB_APPLICATION_CONTEXT_RETRIEVER

public static final String WEB_APPLICATION_CONTEXT_RETRIEVER
The resource bundle property name for a WebApplicationContextRetriever instance

See Also:
Constant Field Values

BEAN_NAME_RESOLVER

public static final String BEAN_NAME_RESOLVER
The resource bundle property name for a BeanNameResolver instance

See Also:
Constant Field Values
Constructor Detail

GWTSpringRPCConfig

protected GWTSpringRPCConfig()
The default constructor is protected since the GWTSpringRPCConfig class is a singleton; to retrieve the instance, use the static getInstance() method.

Method Detail

getInstance

public static GWTSpringRPCConfig getInstance()
Retrieves the singleton GWTSpringRPCConfig instance.

Returns:
The singleton GWTSpringRPCConfig instance

getWebApplicationContextRetrieverClassname

public String getWebApplicationContextRetrieverClassname(String servletName)
Retrieves the classname for the WebApplicationContextRetriever instance configured for the specified servlet.

Parameters:
servletName - The servlet name
Returns:
The WebApplicationContextRetriever classname

getBeanNameResolverClassname

public String getBeanNameResolverClassname(String servletName)
Retrieves the classname for the BeanNameResolver instance configured for the specified servlet.

Parameters:
servletName - The servlet name
Returns:
The WebApplicationContextRetriever classname

getValue

private String getValue(String prefix,
                        String servletName)
Retrieves a value from the configuration properties file. This method will first check if a servlet-specific value exists by appending the servlet name to the prefix, such as prefix.servletName. If no value is found matching this, it will then check just the prefix. This method will never throw an exception and will return null if either the resource bundle or the specified value is not found.

Parameters:
prefix - The property prefix
servletName - The servlet name
Returns:
The property value