globus-build-service 使用手册

The globus-build-service script will help you build a GT4 service without having to write your own Ant file. The following documentation still has to be extended to make it less like a reference guide and more like a user guide.

Parameters

The parameters accepted by the script are listed in the table below (the BASH and Python script accept the same parameters). $BUILD_DIR denotes the directory from which the script is run. Also, you can see the list of parameters from the command line by running 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 implementation and 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 interface description. It is generally a good idea to keep the WSDL file in a directory 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 way of building services without having to type the service directory and schema file every time. You must have a build.mappings file in the same directory as the build script, with one line for each service using the following format:

SERVICE_ID,SERVICE_DIR,SCHEMA_FILE


SERVICE_ID must be a unique 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

You can optionally specify a target (as described in the table above). However, in the shorthand notation you do not need to use the -t parameter. 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 is generated from the SERVICE_DIR parameter by replacing the path separators (/ in UNIX, / in Windows) with underscores. For example, if our 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

Take into account that you will need to specify the GAR ID (not the GAR filename) when undeploying GAR files using the globus-undeploy-gar. For example:

globus-undeploy-gar org_globus_examples_services_core_first

The build directory

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

Although there is usually no need to take a look at the contents of the build directory, you might occasionally want to check if the stub files are being generated correctly. 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值