| Modifier and Type | Field and Description |
|---|---|
protected Vector<Object> |
order |
protected Hashtable<String,Class<?>> |
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 and Description |
|---|
ComponentFactory(Class<?> type)
Create a component factory with the base class supplied.
|
| Modifier and Type | Method and Description |
|---|---|
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 Object |
createInstance(String name,
Class<?> cls)
Override this method to create an instance of the component.
|
String |
createNewOrdering(int[] ordering) |
Object |
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 |
lockComponents() |
void |
remove(String name)
Remove a supported component
|
String[] |
toArray() |
protected Hashtable<String,Class<?>> supported
public ComponentFactory(Class<?> type)
type - ClassNotFoundException - Thrown if the class cannot be resolved.public String changePositionofAlgorithm(String name, int position) throws SshException
SshExceptionpublic 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 - ClassNotFoundExceptionpublic Object getInstance(String name) throws SshException
name - The name of the component; for example "3des-cbc"ClassNotFoundExceptionSshExceptionprotected Object createInstance(String name, Class<?> cls) throws Throwable
cls - Throwablepublic void remove(String name)
name - public void clear()
public String[] toArray()
public void lockComponents()
Copyright © 2016. All rights reserved.