WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] How to implement Async interface

To: <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] How to implement Async interface
From: "Aggarwal, Ajay" <Ajay.Aggarwal@xxxxxxxxxxx>
Date: Wed, 21 Oct 2009 11:03:33 -0400
Delivery-date: Wed, 21 Oct 2009 08:03:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcpSX6i2t69DMkaTTG6Cyvk+EP+EpA==
Thread-topic: How to implement Async interface

Hello,

 

I have a question regarding implementing the "async" interface for the XenAPI RPC methods. We have chosen Apache XML-RPC Java library to do our XenAPI implementation (server side). So for each XenAPI class I have a corresponding Java class which implements the XenAPI methods and an entry in the XmlRpcServlet.properties file.

 

So for example, my XmlRpcServlet.properties file look like:

 

PBD=com.mycompany.xenapi.classes.PBD

host_cpu=com.mycompany.xenapi.classes.HostCpu

VDI=com.mycompany.xenapi.classes.VDI

..

 

My question is what is the easiest way to implement and provide the "async" interface to these existing classes and RPC methods, while leveraging the work already done for the "sync" version.

 

Do I need to implement the Async version for each class (perhaps by leveraging and extending the sync version) and then add a new mapping like

 

Async.PBD=com.mycompany.xenapi.classes.PBDAsync

Async.host_cpu=com.mycompany.xenapi.classes.HostCpuAsync

Async.VDI=com.mycompany.xenapi.classes.VDIAsync

 

Or is there a way to implement one class to front all “async” methods which can then forward the request to the sync class with a special flag? How?

 

Async=com.mycompany.xenapi.classes.AsyncHandler

 

 

Any suggestions?

 

-Ajay

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] How to implement Async interface, Aggarwal, Ajay <=