globus-build-service 使用手册

来源:互联网 发布:综合网络布线预算表 编辑:程序博客网 时间:2024/06/12 00:49
The globus-build-service script will help you build a GT4 servicewithout having to write your own Ant file. The following documentationstill has to be extended to make it less like a reference guide andmore like a user guide.

Parameters

The parameters accepted by the script are listed inthe table below (the BASH and Python script accept the sameparameters). $BUILD_DIR denotes the directory from which the script isrun. Also, you can see the list of parameters from the command line byrunning globus-build-service with the -h parameter

./globus-build-service.sh -h



 ParameterType
Description
-d, --dir SERVICE_DIR Required

SERVICE_DIR  is the directory that contains all our implementationand deployment files. The following directory structure is required(pay special attention at the names of the files and directories):

  • SERVICE_DIR/deploy-server.wsdd (Deployment file, required)

  • SERVICE_DIR/deploy-jndi-config.wsdd (JNDI deployment file, required)

  • SERVICE_DIR/impl/*.java (Java implementation files, required)

  • SERVICE_DIR/etc/*.xml (configuration files, optional)

  • SERVICE_DIR/lib/*.jar (JAR files to be included in the GAR file, and/or necessary to compile the service)

SERVICE_DIR must be relative to $BUILD_DIR.

-s, --schema SCHEMA_FILE Required

SCHEMA_FILE is the WSDL file with the service's interfacedescription. It is generally a good idea to keep the WSDL file in adirectory separate from

SCHEMA_FILE must be relative to $BUILD_DIR.

-fs, --factory-schema FACTORY_SCHEMA_FILE OptionalIf your service consists of a factory/instance pair of services, this parameter specifies the WSDL file of the factory service.-t, --target TARGET Optional

Allows us to specify what exactly we want to build:

  • stubs: Generates the stubs files, but doesn't build them.

  • compileStubs: Generates and compiles the stubs files.

  • all: Builds everything and creates a deployable GAR file.

If no -t parameter is specified, then the all target is assumed.

-d, --debug OptionalProvides detailed information of what the build script is doing.

Shorthand notation

The script offers a convenient shorthand wayof building services without having to type the service directory andschema file every time. You must have a build.mappings file in the samedirectory as the build script, with one line for each service using thefollowing format:

SERVICE_ID,SERVICE_DIR,SCHEMA_FILE


SERVICE_ID must be aunique identifier (without whitespace). To use the shorthand notation,you simply have to run the script like this:

./globus-build-service

For example, if we use the following build.mappings file:

first,org/globus/examples/services/core/first,schema/examples/MathService_instance/Math.wsdl

We would run the script like so:

./globus-build-service first

Youcan optionally specify a target (as described in the table above).However, in the shorthand notation you do not need to use the -tparameter. Simply specify the target as a second parameter. For example:

./globus-build-service first compileStubs

Finally, if you need to include a factory WSDL file, then use the following format:

SERVICE_ID,SERVICE_DIR,SCHEMA_FILE,FACTORY_SCHEMA_FILE

The GAR file

The GAR file is generated in $BUILD_DIR/GAR_ID.gar. The GAR ID isgenerated from the SERVICE_DIR parameter by replacing the pathseparators (/ in UNIX, / in Windows) with underscores. For example, ifour parameter is:

org/globus/examples/services/core/first   

Then, the GAR file will be generated in:

$BUILD_DIR/org_globus_examples_services_core_first.gar

Takeinto account that you will need to specify the GAR ID (not the GARfilename) when undeploying GAR files using the globus-undeploy-gar. Forexample:

globus-undeploy-gar org_globus_examples_services_core_first

The build directory

All the intermediate files generated by the build script are placedin $BUILD_DIR/build. Some times, the build script can produceunexpected results if you've performed a lot of different builds (andthe build directory gets filled with the intermediate files of previousbuilds). Whenever you get an unexpected error, the first thing youshould try is to erase the build directory, which will make sure thatthe build script starts from scratch.

Although there is usuallyno need to take a look at the contents of the build directory, youmight occasionally want to check if the stub files are being generatedcorrectly. The stub source files are generated in:

$BUILD_DIR/build/stubs-GAR_ID/src

The compiled stub files are placed in:

$BUILD_DIR/build/stubs-GAR_ID/classes
原创粉丝点击