All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.enunciate.modules.amf.amf-endpoint.fmt Maven / Gradle / Ivy

Go to download

The Enunciate AMF module generates the artifacts needed for mounting AMF endpoints.

There is a newer version: 1.31
Show newest version
[#ftl]
[#-- @ftlvariable name="webMethod" type="org.codehaus.enunciate.contract.jaxws.WebMethod" --]
[#-- @ftlvariable name="endpointInterface" type="org.codehaus.enunciate.contract.jaxws.EndpointInterface" --]
[#--template for the client-side endpoint interface.--]
[@file name=("AMF" + endpointInterface.simpleName + ".java") package=(endpointInterface.package.qualifiedName + ".amf") charset="utf-8"]
// Generated by Enunciate
package ${endpointInterface.package.qualifiedName}.amf;

/**
 * ${endpointInterface.docComment!"(no documentation provided)"?chop_linebreak?replace("\n", "\n * ")}
 */
public class AMF${endpointInterface.simpleName} extends org.codehaus.enunciate.modules.amf.AMFEndpointImpl {

  public AMF${endpointInterface.simpleName}() throws Exception {
    super(new ${endpointInterface.endpointImplementations[0].qualifiedName}());
  }

  [@forEachWebMethod endpointInterface=endpointInterface]
    [#if !webMethod.annotations["org.codehaus.enunciate.modules.amf.AMFTransient"]??]

  /**
   * ${webMethod.docComment!"(no documentation provided)"?chop_linebreak?replace("\n", "\n   * ")}
   */
  public ${classnameFor(webMethod.webResult)} ${webMethod.clientSimpleName}([#list webMethod.webParameters as param]${classnameFor(param)} ${param.clientSimpleName}[#if param_has_next], [/#if][/#list]) [#if webMethod.webFaults?size > 0]throws [#list webMethod.webFaults as fault]${fault.qualifiedName}[#if fault_has_next], [/#if][/#list][/#if] {
    try {
      [#if !webMethod.returnType.void]
        [#if !webMethod.returnType.primitive]
        return (${classnameFor(webMethod.webResult)}) invokeOperation("${webMethod.operationName}"[#list webMethod.webParameters as param], [#if param.type.array](Object) [/#if]${param.clientSimpleName}[/#list]);
        [#else]
        return [@unwrapIfPrimitive type=webMethod.returnType](([@primitiveWrapper type=webMethod.returnType/]) invokeOperation("${webMethod.operationName}"[#list webMethod.webParameters as param], [#if param.type.array](Object) [/#if]${param.clientSimpleName}[/#list]))[/@unwrapIfPrimitive];
        [/#if]
      [#else]
        invokeOperation("${webMethod.operationName}"[#list webMethod.webParameters as param], [#if param.type.array](Object) [/#if]${param.clientSimpleName}[/#list]);
      [/#if]
    }
      [#list webMethod.webFaults as fault]
    catch (${fault.qualifiedName} e) {
      throw e;
    }
      [/#list]
    catch (Exception e) {
      if (e instanceof RuntimeException) {
        throw (RuntimeException) e;
      }
      else {
        throw new RuntimeException(e);      
      }
    }
  }
    [/#if]
  [/@forEachWebMethod]

  // Inherited.
  protected Class getServiceInterface() {
    return ${endpointInterface.qualifiedName}.class;
  }

  @javax.annotation.Resource ( name = "${endpointInterface.endpointImplementations[0].serviceEndpointId}" )
  public void setServiceBean(${endpointInterface.qualifiedName} serviceBean) {
    this.serviceBean = serviceBean;
  }
}
[/@file]




© 2015 - 2025 Weber Informatics LLC | Privacy Policy