|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.maverick.ssh.components.ComponentFactory<T>
public class ComponentFactory<T extends SshComponent>
A utility class used to store the available transport components and provide delimited listing as required in the key exchange initialization process.
| Field Summary | |
|---|---|
protected Vector<String> |
order
|
protected Hashtable<String,Class<T>> |
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 | |
|---|---|
ComponentFactory()
|
|
| Method Summary | |
|---|---|
void |
add(String name,
Class cls)
Add a new component type to the factory. |
String |
changePositionofAlgorithm(String name,
int position)
|
void |
clear()
Clear all of the entries in this component factory. |
Object |
clone()
|
boolean |
contains(String name)
Determine whether the factory supports a given component type. |
protected T |
createInstance(String name)
Override this method to create an instance of the component. |
String |
createNewOrdering(int[] ordering)
|
T |
getInstance(String name)
Get a new instance of a supported component. |
String |
list(String preferred)
List the types of components supported by this factory. |
void |
remove(String name)
Remove a supported component |
void |
removeAllBut(String names)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Hashtable<String,Class<T extends SshComponent>> supported
protected Vector<String> order
| Constructor Detail |
|---|
public ComponentFactory()
| Method Detail |
|---|
public String changePositionofAlgorithm(String name,
int position)
throws SshException
SshException
public String createNewOrdering(int[] ordering)
throws SshException
SshExceptionpublic boolean contains(String name)
name -
true if the component is supported otherwise
falsepublic String list(String preferred)
preferred - The preferred component type.
public void add(String name,
Class cls)
name - cls -
ClassNotFoundException
public T getInstance(String name)
throws SshException
name - The name of the component; for example "3des-cbc"
ClassNotFoundException
SshException
protected T createInstance(String name)
throws Throwable
cls -
Throwablepublic void remove(String name)
name - public void removeAllBut(String names)
public void clear()
public Object clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||