|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.maverick.ssh2.AbstractComponentFactory
An abstract utility class used to store the available transport components and provide delimited listing as required in the key exchange initialization process.
Field Summary | |
protected java.util.Hashtable |
supported
The supported components stored in a Hashtable with a String key as the component name such as "3des-cbc" and a Class value storing the implementation class. |
Constructor Summary | |
AbstractComponentFactory(java.lang.Class type)
Create a component factory with the base class supplied. |
Method Summary | |
void |
add(java.lang.String name,
java.lang.Class cls)
Add a new component type to the factory. |
void |
clear()
Clear all of the entries in this component factory. |
boolean |
contains(java.lang.String name)
Determine whether the factory supports a given component type. |
protected abstract java.lang.Object |
createInstance(java.lang.String name,
java.lang.Class cls)
Overide this method to create an instance of the component. |
java.lang.Object |
getInstance(java.lang.String name)
Get a new instance of a supported component. |
java.lang.String |
list(java.lang.String preferred)
List the types of components supported by this factory. |
void |
remove(java.lang.String name)
Remove a supported component |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Hashtable supported
Constructor Detail |
public AbstractComponentFactory(java.lang.Class type)
type
-
java.lang.ClassNotFoundException
- Thrown if the class cannot
be resolved.Method Detail |
public boolean contains(java.lang.String name)
name
-
true
if the component is supported otherwise
false
public java.lang.String list(java.lang.String preferred)
preferred
- The preferred component type.
public void add(java.lang.String name, java.lang.Class cls)
name
- cls
-
java.lang.ClassNotFoundException
public java.lang.Object getInstance(java.lang.String name) throws java.lang.ClassNotFoundException
name
- The name of the component; for example "3des-cbc"
java.lang.ClassNotFoundException
protected abstract java.lang.Object createInstance(java.lang.String name, java.lang.Class cls) throws java.lang.Throwable
cls
-
java.lang.Throwable
public void remove(java.lang.String name)
name
- public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |