[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] How to implement Async interface


  • To: <xen-api@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
  • 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.