Monday, November 23, 2009

OpenWebBeans and Java SE Project


Today, we will learn how to easily use OpenWebBeans Container in a standalone mavenized Java Projects.

To use OpenWebBeans in a standalone project, just add the custom "" file into your project classpath location that is "src/main/resources/META-INF/openwebbeans/" folder.

Content of the file will be:

#Use Static HashMap

# Non Transactional

#use the web metadata as default

#Lifecycle to start container

Add "beans.xml" file into your "src/main/resources/META-INF/beans.xml" as a marker file. That is it! Now, You can use dependency injection service from your standalone Java Projects .

For example:
public class Boot
 private static BeanManager beanManager;

public void start()
 //Boot container
 Lifecycle lifecycle = LifecycleFactory.getInstance().getLifecycle();         

 beanManager = lifecycle.getBeanManager();  

public void stop()
 //Stop container
 Lifecycle lifecycle = LifecycleFactory.getInstance().getLifecycle();         

public static void main(String args[])
  Boot boot = new Boot();

  //USE YOUR BeanManager in your code for injections


That is cool Hah :)


Wednesday, November 18, 2009

Introducing the Open Web Foundation Agreement


As I am member of the Open Web Foundation, I would like to inform you that OWF has created its license agreement that is applied to web related specifications. Below is excerpted from the announcement page :

The Open Web Foundation is pleased to announce the availability of the Open Web Foundation Agreement (OWFa).

The Open Web Foundation was founded to help developer communities collaborate and share technical innovation on the web, bringing to the world of formats and protocols the same successful grassroots approaches established by the open source community. Modeled after the Apache Software Foundation and Creative Commons, the Open Web Foundation seeks to facilitate the creation and implementation of specifications with legal agreements that make such work simple, safe, and sustainable.

You could get detailed information from