orca.boot
Class ConfigurationTools

java.lang.Object
  extended by orca.boot.ConfigurationTools

public class ConfigurationTools
extends java.lang.Object

A class with utility functions for processing configuration files

Author:
aydan

Field Summary
static java.lang.String URLSeparator
           
 
Constructor Summary
ConfigurationTools()
           
 
Method Summary
static void attachConfigurationProperties(java.lang.Object obj, java.util.Properties p)
           
static void attachParameter(java.lang.Object object, Parameter param)
          Sets the specified property of the given object.
static java.lang.Object callMethod(java.lang.Object object, java.lang.String methodName)
          Calls a method with no parameters
static java.lang.Object callMethod(java.lang.Object object, java.lang.String methodName, java.lang.Class argumentClass, java.lang.Object argument)
          Calls a method on the specified object
static java.lang.Object callMethod(java.lang.Object object, java.lang.String methodName, java.lang.String argumentClass, java.lang.Object argument)
          Calls a method on the specified object that takes a single parameter
static java.lang.Object createInstance(Instance inst)
          Creates an object instance and sets up its custom parameters
static java.lang.Object createInstance(java.lang.String className)
           
static java.security.PrivateKey decodePrivateKey(CryptoKey data)
          Decodes a private key
static java.security.PublicKey decodePublicKey(CryptoKey data)
          Decodes a public key
static java.lang.Object getObject(Parameter param)
          Extracts an object from a Parameter bean
static java.util.Properties getProperties(Properties beanProperties)
           
static java.util.Properties getProperties(SimpleParameters param)
          Converts a boot.beans.SimpleParameters to java.util.Properties
static ResourceData getResourceData(Rdata beanRData)
          Converts a boot.beans.Rdata to slices.ResourceData
static ResourceSet getResourceSet(Rset rset)
          Converts a boot.beans.Rset to slices.ResourceSet
static java.lang.String getURLPath(java.lang.String path)
           
static java.util.Properties loadProperties(java.lang.String location)
          Loads data from a properties file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URLSeparator

public static final java.lang.String URLSeparator
See Also:
Constant Field Values
Constructor Detail

ConfigurationTools

public ConfigurationTools()
Method Detail

decodePublicKey

public static java.security.PublicKey decodePublicKey(CryptoKey data)
                                               throws java.lang.Exception
Decodes a public key

Parameters:
data - The CryptoKey bean
Returns:
PublicKey
Throws:
java.lang.Exception

decodePrivateKey

public static java.security.PrivateKey decodePrivateKey(CryptoKey data)
                                                 throws java.lang.Exception
Decodes a private key

Parameters:
data - The CryptoKey bean
Returns:
PrivateKey
Throws:
java.lang.Exception

getProperties

public static java.util.Properties getProperties(SimpleParameters param)
Converts a boot.beans.SimpleParameters to java.util.Properties

Parameters:
param - The SimpleParameters bean
Returns:
Properties

getResourceData

public static ResourceData getResourceData(Rdata beanRData)
Converts a boot.beans.Rdata to slices.ResourceData

Parameters:
beanRData -
Returns:

getResourceSet

public static ResourceSet getResourceSet(Rset rset)
Converts a boot.beans.Rset to slices.ResourceSet

Parameters:
rset - The Rset bean
Returns:
ResourceSet

callMethod

public static java.lang.Object callMethod(java.lang.Object object,
                                          java.lang.String methodName)
                                   throws java.lang.Exception
Calls a method with no parameters

Parameters:
object - The object to make the call on
methodName - The method name
Throws:
java.lang.Exception

callMethod

public static java.lang.Object callMethod(java.lang.Object object,
                                          java.lang.String methodName,
                                          java.lang.String argumentClass,
                                          java.lang.Object argument)
                                   throws java.lang.Exception
Calls a method on the specified object that takes a single parameter

Parameters:
object - The object
methodName - The name of the method to be called
argumentClass - The name of the class of the argument
argument - The argument
Throws:
java.lang.Exception

callMethod

public static java.lang.Object callMethod(java.lang.Object object,
                                          java.lang.String methodName,
                                          java.lang.Class argumentClass,
                                          java.lang.Object argument)
                                   throws java.lang.Exception
Calls a method on the specified object

Parameters:
object - The object
methodName - The name of the method to be called
argumentClass - The class of the argument
argument - The argument
Throws:
java.lang.Exception

getObject

public static java.lang.Object getObject(Parameter param)
                                  throws java.lang.Exception
Extracts an object from a Parameter bean

Parameters:
param - The parameter bean
Returns:
The object
Throws:
java.lang.Exception

attachParameter

public static void attachParameter(java.lang.Object object,
                                   Parameter param)
                            throws java.lang.Exception
Sets the specified property of the given object.

Parameters:
object - The object
param - Parameter desciption
Throws:
java.lang.Exception

loadProperties

public static java.util.Properties loadProperties(java.lang.String location)
                                           throws java.lang.Exception
Loads data from a properties file

Parameters:
location - The file path
Returns:
Throws:
java.lang.Exception

getProperties

public static java.util.Properties getProperties(Properties beanProperties)

createInstance

public static java.lang.Object createInstance(java.lang.String className)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

attachConfigurationProperties

public static void attachConfigurationProperties(java.lang.Object obj,
                                                 java.util.Properties p)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

createInstance

public static java.lang.Object createInstance(Instance inst)
                                       throws java.lang.Exception
Creates an object instance and sets up its custom parameters

Parameters:
inst -
Returns:
Throws:
java.lang.Exception

getURLPath

public static java.lang.String getURLPath(java.lang.String path)
                                   throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.