#set( $package = $generated.packageName) #set( $serviceName = $generated.serviceName) #set( $namespaceVersionHolder = $generated.NamespaceVersionHolder) package $package; /** * A $serviceName WS-Resource. *
* NOTE: This file is generated, but is meant to be modified. * It will NOT be overwritten by subsequent runs of Wsdl2Java. */ public class ${serviceName}Resource extends Abstract${serviceName}Resource { #if($namespaceVersionHolder) /** * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls */ $namespaceVersionHolder #end /** * Initializes this resource's state (properties, etc.). */ public void init() { super.init(); #if($generated.hasProperties) /** * The ResourcePropertySet which contains all the defined ResourceProperties */ org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet(); org.apache.ws.resource.properties.ResourceProperty resourceProperty = null; try{ #foreach($key in $generated.ImplementableProperties.keySet()) // init the ${generated.PropertyMap.get($key).toString()} Resource Property resourceProperty = resourcePropertySet.get(${serviceName}PropertyQNames.$key); ${generated.getDocumentElementXmlBeanClassName(${generated.PropertyMap.get($key)})} prop_${generated.PropertyMap.get($key).LocalPart.toLowerCase()} = ${generated.getDocumentElementXmlBeanClassName(${generated.PropertyMap.get($key)})}.Factory.newInstance(); // TODO: Initialize the prop_${generated.PropertyMap.get($key).LocalPart.toLowerCase()} by calling its operations. //also could call resourceProperty.setCallback(...); to add a custom callback object for this property resourceProperty.add(prop_${generated.PropertyMap.get($key).LocalPart.toLowerCase()}); #end } catch (Exception e) { throw new javax.xml.rpc.JAXRPCException("There was a problem in initializing your resource properties. Please check your init() method. Cause: " + e.getLocalizedMessage()); } #foreach( $implementedProp in $generated.ImplementedProperties ) // Resource Property ${implementedProp.toString()} is implemented by the framework. #end #end #foreach( $includeFile in $generated.ResourceInitIncludeLocations ) #parse( $includeFile ) #end } }