com.alibaba.dubbo.common.extension
Class ExtensionLoader<T>

java.lang.Object  extended by com.alibaba.dubbo.common.extension.ExtensionLoader<T>

public class ExtensionLoader<T>
extends Object

Dubbo?????????

  • ??????????
  • ??Wrap?????Wrap??
  • ????????????Adaptive Instance?

Author:
william.liangf, ding.lid
See Also:
JDK5.0?????????, SPI, Adaptive, Activate


Method Summary
 voidaddExtension(String name, Class<?> clazz)
          ???????????
 List<T>getActivateExtension(URL url, String key)
          This is equivalent to
 List<T>getActivateExtension(URL url, String[] values)
          This is equivalent to
 List<T>getActivateExtension(URL url, String[] values, String group)
          Get activate extensions.
 List<T>getActivateExtension(URL url, String key, String group)
          This is equivalent to
 TgetAdaptiveExtension()
           
 TgetDefaultExtension()
          ?????????????????null?
 StringgetDefaultExtensionName()
          ?????????????????????null?
 TgetExtension(String name)
          ??????????????????????????? IllegalStateException.
static
<T> ExtensionLoader<T>
getExtensionLoader(Class<T> type)
           
 StringgetExtensionName(Class<?> extensionClass)
           
 StringgetExtensionName(T extensionInstance)
           
 TgetLoadedExtension(String name)
          ?????????????????????????????????null??????????????????

??????getExtension(String)????????????????????

 Set<String>getLoadedExtensions()
          ??????????????

??????getSupportedExtensions()?????????????????????

 Set<String>getSupportedExtensions()
           
 booleanhasExtension(String name)
           
 voidreplaceExtension(String name, Class<?> clazz)
          Deprecated. ???????????????????
 StringtoString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getExtensionLoader

public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> type)

getExtensionName

public String getExtensionName(T extensionInstance)

getExtensionName

public String getExtensionName(Class<?> extensionClass)

getActivateExtension

public List<T> getActivateExtension(URL url,                                    String key)
This is equivalent to
     getActivateExtension(url, key, null); 

Parameters:
url - url
key - url parameter key which used to get extension point names
Returns:
extension list which are activated.
See Also:
getActivateExtension(com.alibaba.dubbo.common.URL, String, String)

getActivateExtension

public List<T> getActivateExtension(URL url,                                    String[] values)
This is equivalent to
     getActivateExtension(url, values, null); 

Parameters:
url - url
values - extension point names
Returns:
extension list which are activated
See Also:
getActivateExtension(com.alibaba.dubbo.common.URL, String[], String)

getActivateExtension

public List<T> getActivateExtension(URL url,                                    String key,                                    String group)
This is equivalent to
     getActivateExtension(url, url.getParameter(key).split(","), null); 

Parameters:
url - url
key - url parameter key which used to get extension point names
group - group
Returns:
extension list which are activated.
See Also:
getActivateExtension(com.alibaba.dubbo.common.URL, String[], String)

getActivateExtension

public List<T> getActivateExtension(URL url,                                    String[] values,                                    String group)
Get activate extensions.

Parameters:
url - url
values - extension point names
group - group
Returns:
extension list which are activated
See Also:
Activate

getLoadedExtension

public T getLoadedExtension(String name)
?????????????????????????????????null??????????????????

??????getExtension(String)????????????????????

See Also:
getExtension(String)

getLoadedExtensions

public Set<String> getLoadedExtensions()
??????????????

??????getSupportedExtensions()?????????????????????

See Also:
getSupportedExtensions()

getExtension

public T getExtension(String name)
??????????????????????????? IllegalStateException.

Parameters:
name -
Returns:

getDefaultExtension

public T getDefaultExtension()
?????????????????null?


hasExtension

public boolean hasExtension(String name)

getSupportedExtensions

public Set<String> getSupportedExtensions()

getDefaultExtensionName

public String getDefaultExtensionName()
?????????????????????null?


addExtension

public void addExtension(String name,                         Class<?> clazz)
???????????

Parameters:
name - ????
clazz - ????
Throws:
IllegalStateException - ????????????

replaceExtension

@Deprecatedpublic void replaceExtension(String name,                                        Class<?> clazz)
Deprecated. ???????????????????

??????????????

Parameters:
name - ????
clazz - ????
Throws:
IllegalStateException - ????????????

getAdaptiveExtension

public T getAdaptiveExtension()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012
Alibaba. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14