Posts

Showing posts from December, 2013

Coming in Karaf 3.0.0: new enterprise JPA (OpenJPA, Hibernate) and CDI (OpenWebBeans, JBoss Weld) features

Apache Karaf 3.0.0 is now mostly ready (I’m just polishing the documentation). In previous post, I introduced new enterprise features like JNDI, JDBC, JMS. As I said, the purpose is to provide a full flexible enterprise ready container, easy to use and extend for the users. Easy to use means that a simple command will extend your container, with feature that can help you a lot. JPA Previous Karaf version already provided a jpa feature. However, this feature “only” installs the Aries JPA bundles, allowing to expose the EntityManager as an OSGi service. It doesn’t install any JPA engine. It means that, previously, the users had to install all bundles required to have a persistence engine. As very popular persistence engines, Karaf 3.0.0 provides two ready-to-use features: karaf@root()> feature:install openjpa The openjpa feature brings Apache OpenJPA in Apache Karaf. karaf@root()> feature:install hibernate The hibernate feature brings Hibernate in Apache Karaf. CDI Karaf 3.0.0 n

Coming in Karaf 3.0.0: new enterprise JMS feature

In my previous post, I introduced the new enterprise JDBC feature. To follow the same purpose, we introduced the new enterprise JMS feature. JMS feature Like the JDBC feature, the JMS feature is an optional one. It means that you have to install it first: karaf@root()> feature:install jms The jms feature installs the JMS service which is mostly a JMS “client”. It doesn’t install any broker. For the rest of this post, I’m using a ActiveMQ embedded in my Karaf: karaf@root()> feature:repo-add activemq 5.9.0karaf@root()> feature:install activemq-broker Like the JDBC feature, the JMS feature provides: an OSGi service jms:* commands a JMX JMS MBean The OSGi service provides a set of operation to create JMS connection factories, send JMS messages, browse a JMS queue, etc. The commands and MBean manipulate the OSGi service. Commands The jms:create command allows you to create a JMS connection factory. This command automatically creates a connectionfactory-[name].xml blueprint file

Coming in Karaf 3.0.0: new enterprise JDBC feature

Some weeks (months ;)) ago, my colleague Christian (Schneider) did a good job by creating some useful commands to manipulate databases directly in Karaf. We discussed together where to put those commands. We decided to submit a patch at ServiceMix because we didn’t really think about Karaf 3.0.0 at that time. Finally, I decided to refactore those commands as a even more “useful” Karaf feature and prepare it for Karaf 3.0.0. JDBC feature By refactoring, I mean that it’s no more only commands: I did a complete JDBC features, providing a OSGi service, a set of commands and a MBean. The different modules are provided by the jdbc feature. Like most of other enterprise features, the jdbc feature is not installed by default. To enable it, you have to install the jdbc feature first: karaf@root()> feature:install jdbc This feature provides: a JdbcService OSGi service a set of jdbc:* commands a JDBC MBean (org.apache.karaf:type=jdbc,name=*) The OSGi service provides a set of operation to

Coming in Karaf 3.0.0: new enterprise JNDI feature

In previous Karaf version (2.x), the JNDI support was “basic”. We just leveraged Aries JNDI to support the osgi:service JNDI scheme to reference the OSGi services using JNDI name. However, we didn’t provide a fully functionnal JNDI initial context, nor any tooling around JNDI. In part of the new enterprise features coming with Karaf 3.0.0, the JNDI support is now more “complete”. Add JNDI support As most of the other enterprise features, the JNDI feature is an optional one. It means that you have to install the jndi feature first: karaf@root()> feature:install jndi The jndi feature installs several parts. Ready to use initial context Like in previous version, Karaf provides a fully compliant implementation of the OSGi Alliance JNDI Service Specification. This specification details how to advertise InitialContextFactory and ObjectFactories in an OSGi environment. It also defines how to obtain services from services registry via JNDI. Now, it’s possible to use directly the JNDI init

Coming in Karaf 3.0.0: RBAC support for OSGi services and console commands

In a previous post, we saw a new Karaf feature: support of user groups and Role-Based Access Controle (RBAC) for the JMX layer . We extended the RBAC support to the OSGi services, and by side effect to the console commands (as a console command is also an OSGi service). RBAC for OSGi services The JMX RBAC support uses a MBeanServerBuilder . The KarafMBeanServerBuilder “intercepts” the call to the MBeans, checks the definition (defined in etc/jmx.acl.*.cfg configuration files) and defines if the call can be performed or not. Regarding the RBAC support for OSGi services, we use a similar mechanism. The Karaf Service Guard provides a service listener which intercepts the service calls, and check if the call to the service can be performed or not. The list of “secured” OSGi service is defined in the karaf.secured.services property in the etc/system.properties (using a LDAP syntax filter). By default, we only “intercept” (and so secure) the command OSGi services: karaf.secured.services