290 likes | 429 Views
GT4 安装与开发. 李长华. Agenda. GT4 概述 GT4 的安装 GT4 的服务开发. GT4 的安装(1). 必备软件: JDK1.4.2+ ANT1.5.4+ Tomcat 5+( 可选). 准备工作. 2.1 创建一普通用户帐号,用于安装,管理 GT4. such as globus, 在此用户下创建目录 GT4 , 为 GT4 的安装目录 2.2 设置环境变量 JAVA_HOME,ANT_HOME,GLOBUS_LOCATION,GPT_LOCATION. 安装 GT4( 在普通帐号下工作 ).
E N D
GT4安装与开发 李长华
Agenda • GT4概述 GT4的安装 • GT4的服务开发
GT4的安装(1) • 必备软件: JDK1.4.2+ ANT1.5.4+ Tomcat 5+(可选)
准备工作 • 2.1 创建一普通用户帐号,用于安装,管理GT4. such as globus, 在此用户下创建目录GT4,为GT4的安装目录 • 2.2设置环境变量 JAVA_HOME,ANT_HOME,GLOBUS_LOCATION,GPT_LOCATION
安装GT4(在普通帐号下工作) • 3.1. 下载GT3.9.5软件压缩包 • 3.2 在此目录下 ./configure –prefix=$GLOBUS_LOCATION • 3.3 make • 3.4 source $GLOBUS_LOCATION/etc/globus-user-env.sh • globus-start-container -nosec
WS-Resource • WS-ResourceProperties • WS-ResourceLifecycle • WS-RenewableReferences
How to Write a stateful WS • Step 1: Defining the interface in WSDL • Step 2: Implementing the service in Java • Step 3: Configuring the deployment in WSDD (and JNDI) • Step 4: Create a GAR file with Ant • Step 5: Deploy the service into a Web services container
Step 1: Defining the interface in WSDL • MathService WSDL • Namespace mappings http\://www.globus.org/namespaces/2004/11/progtutorial/wsrf/MathService= org.globus.progtutorial.stubs.MathService http\://www.globus.org/namespaces/2004/11/progtutorial/wsrf/MathService/bindings= org.globus.progtutorial.stubs.MathService.bindings http\://www.globus.org/namespaces/2004/11/progtutorial/wsrf/MathService/service= org.globus.progtutorial.stubs.MathService.service
Write Java code • MathNameSpaces • MathService implements MathNamespaces • MathResource implements Resource, ResourceIdentifier, ResourceProperties, MathNamespaces • MathResourceHome extends ResourceHomeImpl
Step 3: Configuring the deployment in WSDD (and JNDI) • The WSDD deployment descriptor Tells the Web service container how it should publish our Web service • The JNDI deploy file Locate resource homes.
Step 4: Create a GAR file with Ant Processing the WSDL file to add missing pieces (such as bindings) Creating the stub classes from the WSDL Compiling the stubs classes Compiling the service implementation Organize all the files into a very specific directory structure
./tutorial_build.sh -d <service base directory> -s <service's WSDL file>
Step 5: Deploy the service into a Web services container • ant \ -f share/globus_wsrf_common/build-packages.xml \ deployGar \ -Dgar.name=<full path of GAR file>
Client • implements MathNamespaces • MathServiceAddressingLocator locator = new MathServiceAddressingLocator();
关于GT4的思考(1) • 由于GT4的整个系统并不是GT3的延续,而是重新进行了建模,用WSRF代替了OGSI,因此,也就决定如果采用GT4,一切可能都要从新开始 • 目前GT4虽与GT3可以兼容,那只是在GT4中包含了GT3的大部分组件,使得GT4变得很庞大,但仍然只是同床异梦
关于GT4的思考(2) • GT4只是一个很底层的东西,各大组件提供了丰富的API,但如果不做什么二次开发,基本上还没有什么实际的用处。
关于GT4的思考(3) • 服务与状态的分离为我们提供了更大的灵活性