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

service-generator.templates.java.async-resource-implementation.vm Maven / Gradle / Ivy

The newest version!
#set ($currentPackage = "#resolveResourceImplementationNamespace($element)")

package $currentPackage;

import javax.inject.Singleton;
import javax.ws.rs.container.AsyncResponse;
import javax.ws.rs.container.Suspended;
import javax.ws.rs.core.Response;

import org.springframework.stereotype.Component;

/**
* Resource class containing the custom logic. Please put your logic here!
*/
@Component("#resolveAPIComponentQualifier($element)")
@Singleton
public class #resolveResourceImplementationClassName($element) implements #resolveResourceInterfaceCanonicalClassName($element)

{
#if("#resolveHasPostMethod($element)"=="true")
	@javax.ws.rs.core.Context
	private javax.ws.rs.core.UriInfo uriInfo;
#end

#foreach($resource in $element.resources)
#foreach($method in $resource.methods)
	/* $method.getMethodType() #resolveMethodPath($method,"/") */
	@Override
	public void #resolveResourceMethodName($method)(#asyncParams($method) #resolveResourceParams($method))
	{
		// please provide some async response logic here
		// you may run time consuming logic in the separate thread, but  still
		// remember to resume processing of the http request at the end of the separate thread flow
		// for more details refer to https://jersey.java.net/documentation/latest/async.html or SDK documentation

		#asyncResourceBodyResolver($method);
	}

#end
#end
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy