[jbosstools-dev] Is there a way to tell the difference between a plug-in running in JBDS and one in JBT?
Brian Fitzpatrick
bfitzpat at redhat.com
Wed May 12 09:11:16 EDT 2010
I totally agree, but this seems to be an edge case (gotta love those).
The issue is that EGT requires one particular URL for .org and a different one for JBDS. For .org, the repository should show "/drools-guvnor/..." and for JBDS, it should be "/jboss-brms/...".
--Fitz
_______________________________
Brian Fitzpatrick (aka "Fitz")
Senior Software Engineer, SOA-P
JBoss by Red Hat
----- Original Message -----
From: "Andersen Max" <max.andersen at redhat.com>
To: "Brian Fitzpatrick" <bfitzpat at redhat.com>
Cc: "tools-dev" <jbosstools-dev at lists.jboss.org>, "external-exadel-list" <external-exadel-list at redhat.com>
Sent: Wednesday, May 12, 2010 12:53:47 AM GMT -07:00 US/Canada Mountain
Subject: Re: [jbosstools-dev] Is there a way to tell the difference between a plug-in running in JBDS and one in JBT?
Platform.getBundle("pluginId") should help you but why would you want to do this ?
You shouldn't tie functionality to if a certain osgi plugin is loaded, but to weather a certain extension point or service is available.
i.e. Maven integration in jboss tools is separated out in to a separate plugin to ensure it only gets loaded when m2ecipse plugins
are around and avoids having a maven dependency to the other plugins (i.e. seam core can be used with maven but doesnt depend)
Another way (but should be kept to a minimum) is to use optional dependencies and do a load for the class you want inside a try/catch for
NoClassDefFoundError. Then your plugin still loads even if the optional plugin is not available and only fails if you try access these extra
classes which you can guard against with the try/catch.
The trick here is to ensure you don't references those optional dependencies except for a very few controlled places.
/max
On May 11, 2010, at 18:08, Brian Fitzpatrick wrote:
> Hi guys...
>
> We have a bug for the Eclipse Guvnor Tools (EGT) where we need to be able to tell whether we're running a particular plug-in in JBDS or JBoss Tools... Is there an easy check to determine this?
>
> --Fitz
>
> _______________________________
> Brian Fitzpatrick (aka "Fitz")
> Senior Software Engineer, SOA-P
> JBoss by Red Hat
> _______________________________________________
> jbosstools-dev mailing list
> jbosstools-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosstools-dev
More information about the jbosstools-dev
mailing list