oemware.core.util
Class ChainUtils

java.lang.Object
  extended by oemware.core.util.ChainUtils

public final class ChainUtils
extends java.lang.Object

The chain utils.


Constructor Summary
ChainUtils()
           
 
Method Summary
static java.lang.String chainsAvailable(org.apache.commons.chain.Catalog pCatalog)
          Returns a string of available chains in a catalog.
static org.apache.commons.chain.Context createContext()
          Returns the standard context object for the system.
static org.apache.commons.chain.Context executeChain(org.apache.commons.chain.Catalog pCatalog, java.lang.String pChainName)
          Execute a command name in a chain.
static void executeChain(org.apache.commons.chain.Catalog pCatalog, java.lang.String pChainName, org.apache.commons.chain.Context pContext)
          Execute a command name in a chain.
static org.apache.commons.chain.Context executeChain(org.apache.commons.chain.Chain pChain)
          Execute a chain with a new empty context object.
static void executeChain(org.apache.commons.chain.Chain pChain, org.apache.commons.chain.Context pContext)
          Execute a chain with a passed context.
static org.apache.commons.chain.Chain getChain(org.apache.commons.chain.Catalog pCatalog, java.lang.String pChainName)
          Returns a chain from a catalog.
static org.apache.commons.chain.Catalog loadCatalog(java.lang.String pResourceName, java.lang.String pCatalogName)
          Load a catalog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainUtils

public ChainUtils()
Method Detail

createContext

public static final org.apache.commons.chain.Context createContext()
Returns the standard context object for the system.

Returns:
A new context object.

executeChain

public static final org.apache.commons.chain.Context executeChain(org.apache.commons.chain.Catalog pCatalog,
                                                                  java.lang.String pChainName)
                                                           throws CoreException
Execute a command name in a chain.

Parameters:
pCatalog - The catalog.
pChainName - The chain name.
Returns:
The context object.
Throws:
CoreException

executeChain

public static final void executeChain(org.apache.commons.chain.Catalog pCatalog,
                                      java.lang.String pChainName,
                                      org.apache.commons.chain.Context pContext)
                               throws CoreException
Execute a command name in a chain.

Parameters:
pCatalog - The catalog.
pChainName - The chain name.
pContext - The context object.
Throws:
CoreException

executeChain

public static final void executeChain(org.apache.commons.chain.Chain pChain,
                                      org.apache.commons.chain.Context pContext)
                               throws CoreException
Execute a chain with a passed context.

Parameters:
pChain - The chain
pContext - The context object.
Throws:
CoreException

executeChain

public static final org.apache.commons.chain.Context executeChain(org.apache.commons.chain.Chain pChain)
                                                           throws CoreException
Execute a chain with a new empty context object.

Parameters:
pChain - The chain
Returns:
The context object.
Throws:
CoreException

getChain

public static final org.apache.commons.chain.Chain getChain(org.apache.commons.chain.Catalog pCatalog,
                                                            java.lang.String pChainName)
                                                     throws CoreException
Returns a chain from a catalog.

Parameters:
pCatalog - The catalog.
pChainName - The chain name.
Returns:
The chain. Exception if not found.
Throws:
CoreException

chainsAvailable

public static final java.lang.String chainsAvailable(org.apache.commons.chain.Catalog pCatalog)
Returns a string of available chains in a catalog. Comma delimited.

Parameters:
pCatalog - The catalog
Returns:
The string.

loadCatalog

public static final org.apache.commons.chain.Catalog loadCatalog(java.lang.String pResourceName,
                                                                 java.lang.String pCatalogName)
                                                          throws CoreException
Load a catalog.

Parameters:
pResourceName - The catalog config file name (must be in the classpath e.g., /oemware-lifecycle.xml).
pCatalogName - The name of the catalog.
Returns:
The catalog. Throws an exception if it's not found.
Throws:
CoreException


Copyright © 2009 Deft Labs - Released under LGPL, Version 3.0