karaf-winegrower

Apache Winegrower

APACHE-2.0 License

Stars
13
Committers
5

= Apache Winegrower

Apache Winegrower is a lightweight and powerful application framework.

It brings the powerful OSGi model without all the issue and help of bundle classloaders. Winegrower fully supports the activator and service model but use an unique classloader.

It supports both OSGi and regular application.

Apache Winegrower provides several packaging options, like standalone jar, exploded jar, docker images. It's also cloud ready and provides tooling to provision your applications on cloud providers.

== Sample

[code,xml]

4.0.0

mygroupid mywinegrowerapp-with-shell 1.0-SNAPSHOT

You can now start Winegrower with:

[source,sh]

mvn exec:java

How to add a command? Create a class with this class:

[source,java]

@Service
@Command(name = "hello", scope = "test")
public class MyCommand implements Action {
public Object execute() throws Exception {
System.out.println("Hello world");
return "hello world";
}
}

Then package it as a normal jar/exploded folder - not even a bundle - and add it in the previous classpath. You can now run "test:hello".

Note that to shortcut the build phase you can use @Header which to define a BundleActivator.

Here is an example:

[source,java]

@Header(name= Constants.BUNDLE_ACTIVATOR, value = "${@class}")
public class MyBundleActivator implements BundleActivator {
// standard code
}