com.caucho.config.type
Class TypeFactory

java.lang.Object
  extended by com.caucho.config.type.TypeFactory
All Implemented Interfaces:
AddLoaderListener, java.util.EventListener

public class TypeFactory
extends java.lang.Object
implements AddLoaderListener

Factory for returning type strategies.


Nested Class Summary
 class TypeFactory.BeanConfig
           
 class TypeFactory.FlowConfig
           
 class TypeFactory.NamespaceConfig
           
 
Method Summary
 void addLoader(EnvironmentClassLoader loader)
          Called with the loader config changes.
 void addNamespace(TypeFactory.NamespaceConfig ns)
          Adds an new environment attribute.
static TypeFactory create()
           
 TypeFactory.NamespaceConfig createNamespace()
          Adds an new environment attribute.
 java.lang.Class getDriverClassByUrl(java.lang.Class api, java.lang.String url)
          Returns a driver by the url
 void getDriverSchemes(java.util.ArrayList<java.lang.String> schemes, java.lang.String apiType)
          Returns a list of schemes supported by the api type.
 java.lang.String getDriverType(java.lang.String apiType, java.lang.String scheme)
          Returns the classname of the given driver.
 Attribute getEnvironmentAttribute(QName name)
          Returns an environment type.
 ConfigType getEnvironmentType(QName name)
          Returns an environment type.
 ConfigType getEnvironmentTypeRec(QName name)
          Returns an environment type.
static TypeFactory getFactory()
           
static TypeFactory getFactory(java.lang.ClassLoader loader)
           
 Attribute getListAttribute(QName name)
          Returns an environment type.
 Attribute getSetAttribute(QName name)
          Returns an environment type.
static ConfigType getType(java.lang.Class type)
          Returns the appropriate strategy.
static ConfigType getType(java.lang.reflect.Type type)
          Returns the appropriate strategy.
 ContainerProgram getUrlProgram(java.lang.String url)
           
protected  boolean hasConfig(java.net.URL url)
           
protected  boolean hasDriver(java.net.URL url)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getType

public static ConfigType getType(java.lang.Class type)
Returns the appropriate strategy.


getType

public static ConfigType getType(java.lang.reflect.Type type)
Returns the appropriate strategy.


create

public static TypeFactory create()

getFactory

public static TypeFactory getFactory()

getFactory

public static TypeFactory getFactory(java.lang.ClassLoader loader)

getEnvironmentType

public ConfigType getEnvironmentType(QName name)
Returns an environment type.


getEnvironmentTypeRec

public ConfigType getEnvironmentTypeRec(QName name)
Returns an environment type.


getListAttribute

public Attribute getListAttribute(QName name)
Returns an environment type.


getSetAttribute

public Attribute getSetAttribute(QName name)
Returns an environment type.


getEnvironmentAttribute

public Attribute getEnvironmentAttribute(QName name)
Returns an environment type.


hasConfig

protected boolean hasConfig(java.net.URL url)

getDriverClassByUrl

public java.lang.Class getDriverClassByUrl(java.lang.Class api,
                                           java.lang.String url)
Returns a driver by the url


getUrlProgram

public ContainerProgram getUrlProgram(java.lang.String url)

getDriverType

public java.lang.String getDriverType(java.lang.String apiType,
                                      java.lang.String scheme)
Returns the classname of the given driver.

Parameters:
apiType - the driver API
scheme - the configuration scheme

getDriverSchemes

public void getDriverSchemes(java.util.ArrayList<java.lang.String> schemes,
                             java.lang.String apiType)
Returns a list of schemes supported by the api type.

Parameters:
schemes - the return list of schemes scheme
apiType - the driver API

hasDriver

protected boolean hasDriver(java.net.URL url)

addLoader

public void addLoader(EnvironmentClassLoader loader)
Called with the loader config changes.

Specified by:
addLoader in interface AddLoaderListener

createNamespace

public TypeFactory.NamespaceConfig createNamespace()
Adds an new environment attribute.


addNamespace

public void addNamespace(TypeFactory.NamespaceConfig ns)
Adds an new environment attribute.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object