|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectverinec.adaptation.PropDistFactory
public class PropDistFactory
Creates distributors for given targets, based on the name of the distributor.
This factory is configured by a properties file either specified upon
instantiation or read from /res/distributormap.properties within
the classpath. The file contains a mapping from distributor names (i.e. cp,
scp) to fully qualified class names of IDistributor instances.
| Field Summary | |
|---|---|
private Properties |
map
|
| Constructor Summary | |
|---|---|
PropDistFactory()
Initializes the mapping with the file /res/distributormap.properties. |
|
PropDistFactory(InputStream propertiesFile)
Initializes the mapping with the stream specified as parameter. |
|
| Method Summary | |
|---|---|
IDistributor |
createDistributor(Element target)
Create a distributor suitable for the given target. |
protected void |
init(InputStream propertiesFile)
Initialize the map. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Properties map
| Constructor Detail |
|---|
public PropDistFactory()
throws VerinecException
VerinecException - if the default properties can not be read
public PropDistFactory(InputStream propertiesFile)
throws VerinecException
propertiesFile - an opened file containing the mapping between distribution names and fully qualified class names.
VerinecException - if the properties file can not be read| Method Detail |
|---|
protected void init(InputStream propertiesFile)
throws VerinecException
propertiesFile - file resouce to load mapping from, in the format of java.util.Properties
VerinecException - if the inputstream is not a valid properties file.
public IDistributor createDistributor(Element target)
throws VerinecException
Reads the class name from the mapping, loads that class and sets the target.
createDistributor in interface IDistributorFactorytarget - The tr:target element of the service configuration to be distributed.
VerinecException - if no distributor can be found or loading it fails.
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||