REST Api (was Re: Custom UI? )
David A. Webster
DAWEBSTER at UP.COM
Mon Jun 6 13:00:28 UTC 2011
Be interested in how you solve the LazyLoad exceptions. In some of our
JPA implementations the only two ways I know of is to turn lazy fetching
off on the server side or to exercise the collection dependencies on the
specific exception then do that on a case-by-case basis as they crop up?
David Webster
Union Pacific Railroad
Lead Architect-Web Infrastructure
Systems Engineering
Phone: (402) 544-1094 | Email: dawebster at up.com
"Heiko W.Rupp" <hrupp at redhat.com>
Sent by: rhq-devel-bounces at lists.fedorahosted.org
06/06/2011 05:22 AM
Please respond to
rhq-devel at lists.fedorahosted.org
To
rhq-devel at lists.fedorahosted.org
cc
rhq-users at lists.fedorahosted.org
Subject
Re: REST Api (was Re: Custom UI? )
Hi,
I sat down over the weekend (and some time this morning) to implement a
first REST provider.
This code is in git in branch heiko-rest (
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=shortlog;h=refs/heads/heiko-rest
).
The code is *far from production* but serves for bootstrapping the REST
api work.
If you want to play with it, you need to run a container build so that the
rest libraries get copied to server/default/lib.
Aside from the pure providing of resources , there are two technical
issues still to solve:
* accessing resources (e.g. http://localhost:7080/rest/resource/r/10001 )
will result in a LazyLoad exception,
as the marshalling code works outside the EJBs with JPA sessions in the
servlet code.
* How to impose security ?
My guess is that both cases could be handled by some sort of Servlet
filters. The first case could also be addressed
by "DTOs" tailored for the REST api (but I'd like to use the standard
domain objects).
For a successful call use the url
http://localhost:7080/rest/resource/a/10001 (assuming you have resources
in inventory).
Heiko
_______________________________________________
rhq-devel mailing list
rhq-devel at lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/rhq-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://fedorahosted.org/pipermail/rhq-devel/attachments/20110606/5ddd03dd/attachment.html
More information about the rhq-devel
mailing list