main website home
  • About this blog

    This blog features updates, opinions, and technical notes from Caucho engineers about Caucho products, the enterprise Java industry, and PHP. Caucho Technology is the creator of the Resin Application Server and the Quercus PHP in Java engine. A leader in Java performance since 1998, Caucho is a Sun JavaEE licensee with over 9000 customers worldwide.
  • Tags

    ajaxworld bam candi cdi cloud cluster comet configuration deploy devoxx eclipse ejb embedded flash flex google app engine hessian hmtp ioc java ee 6 javaone javazone jms messaging newsletter nyjug osgi php pomegranate quercus resin resin 4.0 REST servlet sfjug silicon valley code camp spring testing training tssjs watchdog webbeans web profile websockets wordpress
  • Meta

    • Register
    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

Posts Tagged ‘services’

OSGi/WebBeans configuration

Monday, October 27th, 2008

Since OSGi bundles mainly provide services, for example authentication or JMS, you’ll need to configure the service to point to the user database or JMS queue destinations. Naturally, I’d recommend using WebBeans as the configuration format because it’s a Java standard, compact, and powerful. The official spec JSR-299 is on the JCP website.

Configuring a service generally involves creating a Java instance of the service class, configuring any properties, and registering the service with the OSGi and WebBeans, so it’s available to any application that needs the service.

To specify the class, the latest WebBeans draft uses a combination of an XML namespace and the XML element name, letting you instantiate any Java object an a minimum of verbiage. So the namespace xmlns:r=”urn:java:com.caucho.server.security” and the XML name r:XmlAuthenticator, would create an instance of Resin’s XML authenticator “com.caucho.server.security.XmlAuthenticator”.

<r:XmlAuthenticator xmlns:r="urn:java:com.caucho.server.security">
  <r:password-digest>none</r:password-digest>
  <r:user name="harry" password="quidditch"/>
</r:XmlAuthenticator>

The best part about the syntax is the removal of all overhead tags, so the configuration concentrates on the object itself. The only extra tag is the “xmlns:r” to specify the namespace. Otherwise, all the names are critical to the class and its properties. In other words, the new WebBeans syntax avoids annoying tokens like: <bean>, “class”, <property>, <name>, <value>, etc. It’s clean and simple.

Tags: osgi, services, webbeans
Posted in Engineering | No Comments »


Caucho Technology is proudly powered by WordPress and Quercus®
Entries (RSS) and Comments (RSS).

  • HOME |
  • CONTACT US |
  • DOCUMENTATION |
  • BLOG |
  • WIKI 4 |
  • WIKI 3 |
  • Resin: Java Application Server
Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc.
resin® is a cloud optimized, java® application server that supports the java ee webprofile ®