incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reto Bachmann-Gmür <r...@apache.org>
Subject Re: Karaf in Clerezza
Date Fri, 22 Feb 2013 17:59:22 GMT
Hi Minto

I think checking and ensuring interoperability (in both directions) is a
great sanity check of the architecture. But my concrete motivation was
exploring way to have clerezza more modular, to have easy way to install
optional components (like UIMA or CRIS) and maybe to make the launcher
slimmer.

On the Karaf list I was asked why we don't use a the Karaf framework in
Clerezza. I'm not sure what advatages/disadvantatges this would bring. I
think having an executable jar as launcher is quite important. Also I'm not
sure how well the security stuff would work together.

What are the reasons for you to use Karaf?

Cheers,
Reto

On Mon, Feb 11, 2013 at 11:03 PM, Minto van der Sluis <minto@xup.nl> wrote:

> Hi,
>
> What I have done is the reverse (clerezza in karaf) and might be of
> interest to others:
>
> I have created a custom karaf based distribution containing:
> - clerezza components
> - stanbol rulestore and ontology manager
> - karaf cli commands to manipulate stanbol rulestore
> - custom components of my own
>
> For both clerezza and stanbol I created karaf features to only contain
> components used by me. This however can be easily extended to contain
> all features. It is still up to the distribution to decide which
> features to load on startup.
>
> If there is any interest please let me know. Then I will ask my client
> if I can share details with the community.
>
> Regards,
>
> Minto
>
> Op 11-2-2013 21:56, Reto Bachmann-Gmür schreef:
> > My experiments today.
> >
> > Goal: Be able to install Karaf features within clerezza
> >
> > Approach: use the service org.apache.karaf.features.FeaturesService
> provided by
> > the bundle Apache Karaf :: Features :: Core
> > (org.apache.karaf.features.core) [1].
> >
> > Unfortunately this bundle has quite some dependencies which need to be
> > satisfied. I've chosen a brute force approach and installed the list
> > of bundles of the karaf-framework feature. Because of chicken and egg
> > I can't yet install features. So  I needed the following scala on the
> > command line:
> >
> > import java.net._
> > val url = new
> URL("mvn:org.apache.karaf.assemblies.features/standard/2.3.0/xml/features")
> > val conn = url.openConnection
> > import xml._
> > val doc = XML.load(conn.getInputStream)
> >
> > for (b <- doc\"feature"\"bundle") {
> >  val mvnUri = b.text
> >  try {
> >  val bundle = bundleContext.installBundle(mvnUri)
> >  bundle.start()
> >  } catch {
> >    case ex => out.println("Exception installing bundle", ex)
> >  }
> > }
> >
> > The bundle org.apache.karaf.features.core is now satisfied but not
> > exposing any service. For some reason the blueprint service bundle
> > wasn't activated, activating it over the webconsole made the service
> > available. As new packages aren't avaiable on already open shells I
> > have to reconnect via ssh.
> >
> > Now I can access the service:
> >
> > zz>val fs = $[org.apache.karaf.features.FeaturesService]
> > fs: org.apache.karaf.features.FeaturesService =
> > org.apache.karaf.features.internal.FeaturesServiceImpl@9d8957d
> > zz>fs.[TAB]
> > addRepository           asInstanceOf            getFeature
> >  installFeature          installFeatures         isInstalled
> >   isInstanceOf            listFeatures
> > listInstalledFeatures   listRepositories        removeRepository
> >  restoreRepository       toString                uninstallFeature
> >   validateRepository
> > zz>fs.listFeatures
> > res0: Array[org.apache.karaf.features.Feature] = Array()
> > zz>fs.listRepositories
> > res1: Array[org.apache.karaf.features.Repository] = Array()
> >
> > The next step will be to add a repository.
> >
> > Reto
> >
> > 1. Thanks to Krzysztoffor pointing me to this:
> >
> http://mail-archives.apache.org/mod_mbox/karaf-user/201302.mbox/%3C2960186.kKK1vM5F7L%40dracula%3E
> >
> >
>
>
> --
> ir. ing. Minto van der Sluis
> Software innovator / renovator
> Xup BV
>
> Mobiel: +31 (0) 626 014541
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message