The WSDD file must now reflect that we have two services: the factory service and the instance service.
<?xml version="1.0" encoding="UTF-8"?> <deployment name="defaultServerConfig" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!-- Instance service --> <service name="examples/core/factory/MathService" provider="Handler" use="literal" style="document"> <parameter name="className" value="org.globus.examples.services.core.factory.impl.MathService"/> <wsdlFile>share/schema/examples/MathService_instance/Math_service.wsdl</wsdlFile> <parameter name="allowedMethods" value="*"/> <parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/> <parameter name="scope" value="Application"/> <parameter name="providers" value="GetRPProvider"/> </service> <!-- Factory service --> <service name="examples/core/factory/MathFactoryService" provider="Handler" use="literal" style="document"> <parameter name="className" value="org.globus.examples.services.core.factory.impl.MathFactoryService"/> <wsdlFile>share/schema/examples/FactoryService/Factory_service.wsdl</wsdlFile> <parameter name="allowedMethods" value="*"/> <parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/> <parameter name="scope" value="Application"/> <parameter name="instance" value="examples/core/factory/MathService"/> </service> </deployment>
This file is
|
In the previous chapter we saw that this file specifies what resource home must be used by each service. When managing just one resource, this file was very simple. Now, however, we will need to specify more parameters to manage multiple resources. Furthermore, our JNDI deployment file must include two <service>
tags (one for the instance service, and one for the factory service).
<?xml version="1.0" encoding="UTF-8"?> <jndiConfig xmlns="http://wsrf.globus.org/jndi/config"> <!-- Instance service --> <service name="examples/core/factory/MathService"> <resource name="home" type="org.globus.examples.services.core.factory.impl.MathResourceHome"> <resourceParams> <parameter> <name>resourceClass</name> <value>org.globus.examples.services.core.factory.impl.MathResource</value> </parameter> <parameter> <name>resourceKeyType</name> <value>java.lang.Integer</value> </parameter> <parameter> <name>resourceKeyName</name> <value>{http://www.globus.org/namespaces/examples/core/MathService_instance}MathResourceKey</value> </parameter> <parameter> <name>factory</name> <value>org.globus.wsrf.jndi.BeanFactory</value> </parameter> </resourceParams> </resource> </service> <!-- Factory service --> <service name="examples/core/factory/MathFactoryService"> <resourceLink name="home" target="java:comp/env/services/examples/core/factory/MathService/home"/> </service> </jndiConfig>
This file is
|