org.teatrove.tea.engine
Class MergedContextSource

java.lang.Object
  extended by org.teatrove.tea.engine.MergedContextSource
All Implemented Interfaces:
ContextSource

public class MergedContextSource
extends Object
implements ContextSource

A ContextSource implementation that merges several ContextSources into one.

Author:
Jonathan Colwell

Constructor Summary
MergedContextSource()
           
 
Method Summary
 Object createContext(Object param)
          a generic method to create context instances
protected  Constructor<?> getConstructor()
          let subclasses get at the constructor
protected  Class<?>[] getContextsInOrder()
           
 Class<?> getContextType()
           
 void init(ClassLoader loader, ContextSource[] contextSources, boolean profilingEnabled)
           
 void init(ClassLoader loader, ContextSource[] contextSources, String[] prefixes, boolean profilingEnabled)
          Creates a unified context source for all those passed in.
protected  boolean isProfilingEnabled()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergedContextSource

public MergedContextSource()
Method Detail

init

public void init(ClassLoader loader,
                 ContextSource[] contextSources,
                 boolean profilingEnabled)
          throws Exception
Throws:
Exception

init

public void init(ClassLoader loader,
                 ContextSource[] contextSources,
                 String[] prefixes,
                 boolean profilingEnabled)
          throws Exception
Creates a unified context source for all those passed in. An Exception may be thrown if the call to a source's getContextType() method throws an exception.

Throws:
Exception

getContextsInOrder

protected Class<?>[] getContextsInOrder()

getConstructor

protected Constructor<?> getConstructor()
let subclasses get at the constructor


isProfilingEnabled

protected boolean isProfilingEnabled()

getContextType

public Class<?> getContextType()
Specified by:
getContextType in interface ContextSource
Returns:
the Class of the object returned by createContext.

createContext

public Object createContext(Object param)
                     throws Exception
a generic method to create context instances

Specified by:
createContext in interface ContextSource
Parameters:
param - engine specific parameter that may be used to create the context instance
Throws:
Exception


Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.