Return-Path: Delivered-To: apmail-openejb-dev-archive@www.apache.org Received: (qmail 81066 invoked from network); 4 Nov 2009 00:10:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Nov 2009 00:10:36 -0000 Received: (qmail 52868 invoked by uid 500); 4 Nov 2009 00:10:36 -0000 Delivered-To: apmail-openejb-dev-archive@openejb.apache.org Received: (qmail 52729 invoked by uid 500); 4 Nov 2009 00:10:35 -0000 Mailing-List: contact dev-help@openejb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openejb.apache.org Delivered-To: mailing list dev@openejb.apache.org Received: (qmail 52719 invoked by uid 99); 4 Nov 2009 00:10:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 00:10:35 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jonathan.gallimore@gmail.com designates 209.85.219.215 as permitted sender) Received: from [209.85.219.215] (HELO mail-ew0-f215.google.com) (209.85.219.215) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 00:10:33 +0000 Received: by ewy11 with SMTP id 11so6682316ewy.11 for ; Tue, 03 Nov 2009 16:10:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=vYUouSd6iO9ZTHS7p8sZ8J+q+taLEN31zjHsrNcVaRA=; b=CB+J8WN+/ybI5KTN6Ekz1XV8wdVC9roN7Mj+j0RjStWm1P80K8zJm2OZvi3SIE8tDS iMXs1qWbZNTl8q5WjpAQTWT62dXiDuVlJhX1eIXFZsKCitJkafNEsUAaK6QvQ5jpVU70 aCqSEAIaCZA+bUSYsEcp8XOHC5xMza4TRo3E0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=l2ElCsCBjbF136bRFBIhv9e3FHvbHXpMGQdfwq3q+ThOrC0MyuAlDyd+Yp6Kh9In3/ ZNXp2seDpCYy4BdmY2ze5pUATornKxPh/SvAfw07E6Vzs5mo3ZB8ov6zWWd3jBoU+p3C kDGi+6oyBe4PzsQTAcLYgJm6/rKyY37k/jM3Q= MIME-Version: 1.0 Received: by 10.216.88.7 with SMTP id z7mr337685wee.19.1257293411385; Tue, 03 Nov 2009 16:10:11 -0800 (PST) In-Reply-To: References: <1b5bfeb50910231436y58439b89t37f745d7ba9b3236@mail.gmail.com> <26110134.post@talk.nabble.com> <26110631.post@talk.nabble.com> <1f3854d50910291015l22556674i41b238137d744642@mail.gmail.com> <1b5bfeb50910291236y6bfccf75sf60d50f5c9b459e@mail.gmail.com> <1b5bfeb50911011446l6491c67nefc0e6bcbc7bdf14@mail.gmail.com> Date: Wed, 4 Nov 2009 00:10:11 +0000 Message-ID: <8a884a800911031610g6e8d9c71wdfb631272b37a877@mail.gmail.com> Subject: Re: For adventurous: first run of OSGified OpenEJB *seems* running fine From: Jonathan Gallimore To: dev@openejb.apache.org Content-Type: multipart/alternative; boundary=0016e6dab0592a04900477806f6d --0016e6dab0592a04900477806f6d Content-Type: text/plain; charset=ISO-8859-1 I've been reading this thread with a lot of interest, this is looking like a really nice piece of functionality. I've had a bit too much on my plate to have a proper play around with this functionality but I'm hoping to get into shortly. > > > The missing pieces are to create a service bundle so JNDI namespace is > visible to other bundles being ejb clients or exposing ejb interfaces > as osgi services and finally create a osgified deployer (picks up > instaled bundles that are ejbs as well, passes them to openejb and > registers osgi services). Fancy helping out? > One thing I did mean to mention here was that in the Eclipse plugin we have a org.apache.openejb.server plugin, which was contributed a while back by Deryck Brown, to help build an Eclipse RCP application with OpenEJB embedded in it. This contribution has some code which listens for certain services being registered with the OSGi container, and deploying the app with OpenEJB. The org.apache.openejb.server wraps all of OpenEJB presenting it as one big bundle, and I've only had it working with Equinox, but I wonder whether whether this code might be useful or not. The plugin itself listens for EJB bundles like this: ServiceListener sl = new ServiceListener() { public void serviceChanged(ServiceEvent ev) { ServiceReference sr = ev.getServiceReference(); switch (ev.getType()) { case ServiceEvent.REGISTERED: deployApplication(sr); break; case ServiceEvent.UNREGISTERING: undeployApplication(sr); break; } } }; // Generate a ServiceEvent for any existing OpenEJbApplication services. String filter = "(objectclass=" + OpenEjbApplication.class.getName() + ")"; try { bundleContext.addServiceListener(sl, filter); ServiceReference[] srl = bundleContext.getServiceReferences(null, filter); if (srl != null) { for (ServiceReference sr : srl) { sl.serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED, sr)); } } } catch (InvalidSyntaxException e) { e.printStackTrace(); } The EJB bundle calls this on startup: OpenEjbApplication application = new OpenEjbApplication(bundle); context.registerService(OpenEjbApplication.class.getName(), application, null); Anyway, I don't know if its any use, but I thought I'd mention it. Thanks for the work you've done on this - hopefully I'll give it a go some point this week and give you some feedback. Jon --0016e6dab0592a04900477806f6d--