They are two different frameworks.  The article you linked to earlier was
about using bndtools to debug a karaf distribution and not about enroute
http://enroute.osgi.org/appnotes/bndtools-and-karaf.html.  I would suggest
if you looking to use karaf then you start there with the karaf maven
tools.  The bndtools integration with karaf is very early and difficult.  I
think Christian has a good way of going about it here
https://github.com/cschneider/osgi-chat and I do something similar but it
is very early on.  If you are looking at staying with the bndtools tool
chain and the enroute distribution then I would suggest not mixing in karaf
at first.  Just my opinion and again I mix the two so take it for what it
is worth.

David

On Wed, Nov 16, 2016 at 7:01 AM, Tim Ward <t...@telensa.com> wrote:

> I'm using enRoute and targeting Karaf.
>
>
> On 16/11/2016 11:59, David Daniel wrote:
>
> It is really going to depend on your library and bundles you use.  I used
> to do it in my activator like
>
>
> import java.util.Dictionary;
> import org.ops4j.pax.web.extender.whiteboard.ResourceMapping;
> import org.ops4j.pax.web.extender.whiteboard.runtime.
> DefaultResourceMapping;
> import org.osgi.framework.BundleActivator;
> import org.osgi.framework.BundleContext;
> import org.osgi.framework.ServiceRegistration;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
>
>
> /**
> *
> * @author ddaniel
> */
> public class Activator implements BundleActivator {
>
> /**
> * Logger.
> */
> private static final Logger LOG = LoggerFactory.getLogger(Activator.class
> );
> private ServiceRegistration<ResourceMapping> resourcesReg;
>
> public void start(final BundleContext bundleContext) throws Exception {
> Dictionary<String, String> props;
>
> // Registering resource mappings as service
> DefaultResourceMapping resourceMapping = new DefaultResourceMapping();
> resourceMapping.setAlias("/webIngest");
> resourceMapping.setPath("/content");
> resourcesReg = bundleContext.registerService(ResourceMapping.class,
> resourceMapping, null);
> }
>
> public void stop(BundleContext bundleContext) throws Exception {
> if (resourcesReg != null) {
> resourcesReg.unregister();
> resourcesReg = null;
> }
> }
> }
>
> I have since moved to using the enroute web simple provider
>
> https://github.com/osgi/osgi.enroute.bundles/tree/master/
> osgi.enroute.web.simple.provider
>
> You will likely need to pick a framework karaf/enroute/amdatu and follow
> their documentation.  Without a clear framework things become more
> difficult and you have to know your bundles well.
>
> On Wed, Nov 16, 2016 at 6:42 AM, Tim Ward <t...@telensa.com> wrote:
>
>> Basically I was just trying to understand the documentation I quoted; I'd
>> been led there whilst looking for some way to serve a static resource from
>> a less complicated URL. I have not found any documentation of how to
>> actually use ConditionalServlet - your response below tells me that I can
>> do whatever I like, but doesn't give enough information for me to be able
>> to work out *how* to do it.
>>
>>
>> On 15/11/2016 21:45, David Leangen wrote:
>>
>>
>> Hi Tim,
>>
>> You just need a class that implements ConditionalServlet, and register it
>> (for example) using DS.
>>
>> By following the ConditionalServlet algorithm, you should be able to
>> accomplish anything you need to do.
>>
>>
>> It may be easier if you have more specific questions. What are you trying
>> to accomplish?
>>
>> Cheers,
>> =David
>>
>>
>> On Nov 16, 2016, at 12:52 AM, Tim Ward <t...@telensa.com> wrote:
>>
>> In
>>
>> https://github.com/osgi/osgi.enroute.bundles/tree/master/osg
>> i.enroute.web.simple.provider
>>
>> it says
>>
>> "By adding, removing, and reordering ConditionalServlets, you can gain
>> unlimited control of what happens on the root path."
>>
>> How, exactly? - what does one actually *do* to "add" (eg) a
>> ConditionalServlet?
>>
>> --
>> Tim Ward
>>
>> _______________________________________________
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>>
>>
>>
>> _______________________________________________
>> OSGi Developer Mail 
>> listosgi-...@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>> --
>> Tim Ward
>>
>> _______________________________________________ OSGi Developer Mail List
>> osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev
>
> _______________________________________________
> OSGi Developer Mail 
> listosgi-...@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
>
> --
> Tim Ward
>
>
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to