[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [equinox-dev] Accessing Plugins from WAS
|
Hi Rich,
I think the various wizard use-cases like this are
interesting as they're already in wide use.
A while back BJ mentioned, a "WAR to WAB (Web Application
Bundle) translation tool" and associated web container spec. These might be good
things to consider supporting in 3.3 if you want to open an "enhancement".
In particular I'm interested in adding better tooling support both for general
creation of this type of application as well as translation of existing web
apps.
--
for your question ...
Without directly seeing your application its fairly hard to
say what's best however I'd suggest that if you want to make use of Eclipse
functionality that you migrate your servlet application to be exposed
within Equinox through the HttpService. As you're discovering, creating a
hybrid is very tough. Generally I'd reserve the overriding of the
FrameworkLauncher for use in handling specialized deployment
scenarios.
In terms of creating your intial WAB
I'd suggest you start quick and dirty packaging the whole WAR file
in a bundle and then later refine its various components into bundles.
For most web applications the URL mappings in your web.xml can
be translated to the extension-points in org.eclipse.equinox.http.registry.
For webapps with more complex lifecycle needs I'd suggest direct use of the
OSGi Http Service.
Once you've created your web app bundle drop it
in WEB-INF/platform/plugins and restart your servlet container. If your bundle
uses the Http Service directly you might also need to start it
in config.ini.
Hope this helps.
-Simon
I'm using WAS 6.1. I have
constructed Web Services using the wizards in AST 6.1. I want the
implementation of these services to call plugin code. I know that there
are several problems here - including the fact that WAS 6.1 uses Eclipse 3.1
plugins, and the functionality I seek is more related to Eclipse
3.2.
It was
suggested that I use the Equinox bridge. This seems difficult, because
the servlets that I'm using are created via the wizards in AST, and I find it
hard to determine how I would register them so the bridge could access
them.
What I
decided to do instead was to subclass the FrameworkLauncher, removing most of
the servlet references (and currently hardcoding the access to the bridge war,
which contains my plugins that I need). Looking at the BridgeServlet
code, it changes the context classloader of the running thread, and then calls
the proxy servlet, which will call the registered servlet. I figured,
that I could create the appropriate context classloader using my
FrameworkLauncher class, and then before I try to load the first plugin class,
I would change the context classloader to the one I just created.
This seemed to
almost work, but the context classloader was not able to load/find any
plugin classes, beyond the ones related to the framework itself. On the
other hand, the framework started just fine, and loaded all of my bundles.
However, when I look at the context classloader that is created, it
seems like there is no connection between it and the bundle classloaders
created by the framework.
Am I just on the wrong track? Is what I'm trying to do just
silly?? Is there any hints you can provide??
Any help would be greatly
appeciated!
Rich Piazza
IBM Rational Software
20 Maguire Road
Lexington,
MA 02421
781-676-2462
781-676-2540 (Fax)
This message may contain privileged and/or confidential information. If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank you.