|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.biomoby.service.generator.Generator org.biomoby.service.generator.ServicesGenerator
public class ServicesGenerator
A generator generating skeleton classes for Biomoby services. Such skeletons can be extended by a service-provider and she or he just fills there "business logic" (the real work of a service) without worrying about how to parse and create data in a Biomoby specific XML format.
The generated classes uses Biomoby data types that were also
generated (see DataTypesGenerator
).
Both services and data types are generated using information stored in a Biomoby registry. In other words, generating is possible only for entities that had been registered.
The best way how to find what it does for you is to use
command-line client MosesGenerators and let it generate
some classes, browse them and try to extend them. The examples and
information which methods are available, and which methods must be
implemented are in BaseService
where
all generated skeletons inherit from.
Start MosesGenerators either from a command-line using a script:
build/run/run-generator -hor using Ant:
ant -Dmoses.service=MyService moses-servicesThe name MyService is the name under a service was registered in a Biomoby registry.
Field Summary |
---|
Fields inherited from class org.biomoby.service.generator.Generator |
---|
GPROP_AUTH, GPROP_DOTLOCATION, GPROP_FILTER, GPROP_NOGEN, GPROP_NOGRAPHS, GPROP_OUTDIR, GPROP_SERVICE, GPROP_VERBOSE |
Constructor Summary | |
---|---|
ServicesGenerator()
|
|
ServicesGenerator(CentralCached worker)
|
|
ServicesGenerator(String cacheDir)
|
|
ServicesGenerator(String registryEndpoint,
String registryURI,
String cacheDir)
|
Method Summary | |
---|---|
void |
generate(Properties props)
Generate classes for service(s) from a given Biomoby registry. |
Map<String,File> |
getTemplateNames()
Getting names of templates is isolated here so a sub-class can override it (but any new teplate still needs to follow the same patterns as the original template - so it is not too flexible, anyway). |
Methods inherited from class org.biomoby.service.generator.Generator |
---|
getWorker, makeDirs |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServicesGenerator()
public ServicesGenerator(String cacheDir) throws MobyException
MobyException
public ServicesGenerator(String registryEndpoint, String registryURI, String cacheDir) throws MobyException
MobyException
public ServicesGenerator(CentralCached worker)
Method Detail |
---|
public Map<String,File> getTemplateNames()
Generator
The values of returned Map are files. It their names are relative (which is the best way) then they are looked for in the CLASSPATH (including all jar files there).
Make sure that the returned path is correct for the system where JVM is running.
getTemplateNames
in class Generator
public void generate(Properties props) throws MobyException
generate
in class Generator
props
- are properties influencing the generated results
MobyException
- if anything goes wrongproperty GPROP_SERVICE
,
property GPROP_AUTH
,
property GPROP_OUTDIR
,
property GPROP_VERBOSE
,
property GPROP_NOGRAPHS
,
property GPROP_DOTLOCATION
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |