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.


Method Summary
 void addLoader(EnvironmentClassLoader loader)
          Called with the loader config changes.
static TypeFactory create()
           
static
<T> XmlBeanType<T>
getCustomBeanType(java.lang.Class<T> type)
          Returns the appropriate strategy.
 java.lang.Class<?> getDriverClassByScheme(java.lang.Class<?> api, java.lang.String scheme)
          Returns a driver by the scheme
 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.
protected  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
<T> ConfigType<T>
getType(java.lang.Class<T> type)
          Returns the appropriate strategy.
static ConfigType<?> getType(java.lang.Object bean)
          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)
           
 boolean isEnhancer()
           
static java.lang.Class<?> loadClass(QName qName)
          Returns the appropriate strategy.
static java.lang.Class<?> loadClass(java.lang.String pkg, java.lang.String name)
          Returns the appropriate strategy.
 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.Object bean)
Returns the appropriate strategy.


getType

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


getType

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


loadClass

public static java.lang.Class<?> loadClass(QName qName)
Returns the appropriate strategy.


loadClass

public static java.lang.Class<?> loadClass(java.lang.String pkg,
                                           java.lang.String name)
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

protected 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.


getCustomBeanType

public static <T> XmlBeanType<T> getCustomBeanType(java.lang.Class<T> type)
Returns the appropriate strategy.


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


getDriverClassByScheme

public java.lang.Class<?> getDriverClassByScheme(java.lang.Class<?> api,
                                                 java.lang.String scheme)
Returns a driver by the scheme


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)

isEnhancer

public boolean isEnhancer()
Specified by:
isEnhancer in interface AddLoaderListener

addLoader

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

Specified by:
addLoader in interface AddLoaderListener

toString

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