Hi, 

We're running a J2EE app on JBOSS, but we've started integrating Restlet so
that hopefully we can ditch our legacy app and move on with RESTful
services.

The short story is hopefully some other folks will be able to use our new
Restlet service to get the resources they need, but if they can't (due to a
deadline crunch) then we need to do the leg work for them: request from our
own service and give them the returned resource through a legacy mechanism
they know already works. 

I'm wanting to write a server-side client (oxymoron?) that uses RIAP so I
can bypass the HTTP overhead and keep request internal. I'd also like to do
it without having to specify any configuration information related to the
host we've installed our application on. I figured my best shot was to write
a client on the server-side (within our application on the same jvm) using
the RIAP protocol. I know I have my restlet application routing internal
RIAP requests correctly as I previously dabbled with some server resources
that called each other... 

I feel like I've tried a number of things... but I think my general problem
is I don't seem to have access to Context of my restlet Application. 

I thought at one point I could call the static method "getCurrent()" on my
Application (i.e. MyRestletApplication.getCurrent()) and then make my riap
request through there:

MyRestletApplication.getCurrent().getContext().getClientDispatcher().get("riap://component/path-to-my-resource")

That didn't seem to work... the MyRestletApplication.getCurrent() only
returns null. Is that something I need to set in the
MyRestletApplication.createRoot() method? 

I also tried just creating a Client with the RIAP protocol:

Client myclient = new Client(Protocol.RIAP);

...but that doesn't seem to work as I don't have a Context for
MyRestletApplication. 

I appreciate any help, direction and insight as to how I can accomplish
this.

Thanks in advance!

Regards,

Andrew




-- 
View this message in context: 
http://n2.nabble.com/RIAP-Client-from-within-my-J2EE-application-%28jboss%29-tp3353312p3353312.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2376769

Reply via email to