org.ogf.graap.wsag.api.configuration
Class WSAG4JConfiguration

java.lang.Object
  extended by org.ogf.graap.wsag.api.configuration.WSAG4JConfiguration

public class WSAG4JConfiguration
extends Object

MSSConfiguration This class provides basic configuration mechanisms for WSAG4J components.

Author:
Oliver Waeldrich

Constructor Summary
WSAG4JConfiguration()
           
 
Method Summary
static Object findImplementation(Class<?> interfaceDef, String configFile, String defaultImpl)
          Finds an implementation for a given interface.
static InputStream findResource(String resourceName)
           
static InputStream findResource(String path, String resourceName)
           
static URL findResourceURL(String resourceName)
           
static URL findResourceURL(String path, String resourceName)
           
static Object findSingeltonImplementation(Class<?> interfaceDef, String configFile, String defaultImpl)
          Finds a singleton implementation for a given interface.
static String getConfigurationPath()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSAG4JConfiguration

public WSAG4JConfiguration()
Method Detail

getConfigurationPath

public static String getConfigurationPath()
Returns:
the configuration path for this module

findImplementation

public static Object findImplementation(Class<?> interfaceDef,
                                        String configFile,
                                        String defaultImpl)
Finds an implementation for a given interface.

Parameters:
interfaceDef - the interface definition to find an implementation for
configFile - the configuration file that specifies the appropriate implementation
defaultImpl - the default implementation to use
Returns:
The instance of the implementation class

findSingeltonImplementation

public static Object findSingeltonImplementation(Class<?> interfaceDef,
                                                 String configFile,
                                                 String defaultImpl)
Finds a singleton implementation for a given interface.

Parameters:
interfaceDef - the interface definition to find an implementation for
configFile - the configuration file that specifies the appropriate implementation
defaultImpl - the default implementation to use
Returns:
The instance of the implementation class

findResource

public static InputStream findResource(String resourceName)
                                throws IOException
Parameters:
resourceName - The name of the requested resource.
Returns:
The requested resource as InputStream.
Throws:
IOException - there was an error reading the resource

findResource

public static InputStream findResource(String path,
                                       String resourceName)
                                throws IOException
Parameters:
path - The path to the requested resource. If the resource is not found at the specified location discovery will be performed.
resourceName - The name of the requested resource.
Returns:
The requested resource as an InputStream.
Throws:
IOException - there was an error reading the resource

findResourceURL

public static URL findResourceURL(String resourceName)
                           throws IOException
Parameters:
resourceName - The name of the requested resource.
Returns:
The URL of the requested resource.
Throws:
IOException - there was an error reading the resource

findResourceURL

public static URL findResourceURL(String path,
                                  String resourceName)
                           throws IOException
Parameters:
path - The path to the requested resource. If the resource is not found at the specified location discovery will be performed.
resourceName - The name of the requested resource.
Returns:
The URL of the requested resource.
Throws:
IOException - there was an error reading the resource


Copyright © 2008-2012. All Rights Reserved.