Sunday, November 30, 2008

SlideShare Presentation

Hi;

I have created a slide share presentation. It is about the "Introduction to WebBeans" and gives you some idea about Web Beans specification and OpenWebBeans implementation.

It is located in the http://www.slideshare.net/gurkanerdogdu/openwebbeansweb-beans-presentation/

Cheers;

Have a nice day;

Gurkan Erdogdu

Monday, November 24, 2008

OpenWebBeans Project Status

OpenWebBeans project status page [1] is updated in the Apache Incubator site. All of the project related artifacts are configured and works now, these are
  • Project mailing lists
  • Project source code, aka SVN repository
  • Project bug tracking, aka JIRA
  • Project main web site.
We are actively developing for releasing the first version of the project that is fully compliant with the published JSR-299 specification. We are always looking for great contributors helping us to achieve this possible. Development process and repository access is documented in the project web site [2].

[1] http://incubator.apache.org/projects/openwebbeans.html
[2] http://incubator.apache.org/openwebbeans/

Cheers;
Gurkan Erdogdu

Tuesday, November 18, 2008

Resistence to WebBeans

Hi folks;

We are at Apache Incubation, continue to implement JSR-299 for creating the first alpha release. In the mean time, I am looking the blogs, mailig lists etc. and I see that the people who are really expert in their areas, resisting to the WebBeans specification. I do not expect from them to embrace the specification, and also am not advocator of the WebBeans. But I am the advocator and supporter of the Java EE standards. Why?

For example, it enables you to free from the any vendor products that your application is developed with obeying the standards. It enables you to talk with standards with others. Look at working of the internet(aka,internetwork), all of the protocols, specifications etc. is standardized by the foundations. (HTML by W3C, TCP/IP by IETF etc.).

So WebBean specification is no different from them, and like other Java EE stuffs/specifications, it is standardized by the JCP and its members. Maybe, some of its promises (For example : DI) is handled by the third party Java EE frameworks, like Spring in a non-standardized way. Depending on Spring means that you are depending on the one vendor product problem, and you are not free!..

I think that Java EE community could embrace the WebBean Specification as a standard, and helping to find a way to integrate its capabilities into the Java EE 6.0 instead of reactioning without the absloute understanding of the what the WebBeans is?

Have a nice day folks;

Tuesday, October 28, 2008

OpenWebBeans is Accepted

Hello Open Source Community,

OpenWebBeans proposal is accepted as an Incubator project in the Apache Foundation. In couple of weeks, we will release the first alpha version of the project. For interested developers, the proposal is located at the apache incubator wiki page [1].

[1] http://wiki.apache.org/incubator/OpenWebBeansProposal

Monday, October 20, 2008

WebBeans Public Draft

Hello,

I just read from the jboss.org site that WebBean public draft may be published in this week or next early. I think that some of the concepts that are documented in the EDR-1 has changed. Maybe we could change some of the impl. to reflect those changes. Anyway, may sure, overall concepts are the same.

You could read more about related posting at http://in.relation.to/Bloggers/WebBeansTeaser.

About OpenWebBeans, it is under the [VOTE] process that happens at incubator general mailing list by the Incubator PMC . If it passes, it will be project under the Apache Incubator.

Saturday, October 11, 2008

Open Web Foundation

Recently I have joined the new open source organization naming as Open Web Foundation. Altough its model is based on the Apache Software Foundation, its main purpose is to create open specifications that is related with the web standarts.

You can get more information ant its main goals at the URL,

Open Web Foundation : http://openwebfoundation.org/

Have a nice day :)

Monday, October 6, 2008

Web Beans Reference Implementation Proposal

Good morning from here :)

As a fan and an advocacy of the Open Source Software, I have created the new Incubator Proposal about the web beans reference implementation in the http://wiki.apache.org/incubator/OpenWebBeansProposal.

This proposal is not accepted yet to go into the incubator projects, but the discussions about the thread is doing on the incubator general mailing list, general@incubator.apache.org. You could comment on this mailing list about the proposal.

Currenly, I have been implementing the RI at the sourceforge. You can browse the SVN respository at http://bigfaces.svn.sourceforge.net/viewvc/bigfaces/webbeansimpl/.

I am getting good feedbacks from the Java EE community about the proposal. You can join the discussions on the above mailing list. You are all welcome to help this open source clean reference implementation.

Cheers;

Saturday, September 27, 2008

Web Beans Component

In the last post, I gave brief introduction to the Web Beans Specification, JSR 299. In this blog, I am trying to give you a real java codes :) Showing with code instead of writing is great . Ok, lets start with the definition of the web bean component and create some codes for them.
@Component
@RequestScoped
public class Payment{

}
For Web Beans Container understands that this class is a web beans component, it looks for some annotations defined on the class. In Web Beans every component is annotated with the Component Type annotation. Every component type annnotation is annotated with meta annotation @ComponentType. For example, in the above code, Payment class is annotated with the @Component component type. If we look at the definiton of the @Component annotation, it looks like

@ComponentType
@Target(value = { ElementType.TYPE, ElementType.METHOD })
@Retention(value = RetentionPolicy.RUNTIME)
public @interface Component {

}
@Component annotation is the built-in annotation. There are two built-in annotations in the web beans container, these are @Standart and @Component. You are free to define more components with creating new component types.

In web beans container, every web beans defines its scoped using the scope type annotation. In the above code, class is annotated with the @RequestScoped built-in scope types. Scope type annotation is defined using the @ScopeType meta annotation. For example, below is the definition of the @RequestScoped annotation. Scope type defines the context of the web beans component instances. For example, Payment component instances are only available in the current request context. Each request context is available between the Servlet Request Start and End.

@ScopeType
@Target( { ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface RequestScoped {

}
There are other built-in scope types in the web beans container
  • Application Scoped : Start when Servlet Context is initialized and is destroyed when Servlet Context is destroyed.
  • Session Scoped : Start when Http Session is started and is destroyed when Http Session is destroyed at the end of the session.
  • Conversation Scoped : This is the more complicated scoped definiton. We will look at this scope witihin the next blogs.
Every web beans components has named. Naming is differs with respect to the type of the component. There are several different type of the component definition in the web beans specifications, these are standart type components like Payment class annotated with @Component , producer methods components (these are defined at the method level) and EJB related component definitions. We will look at the producer method and EJB components within the coming next blogs. In the standart type components, component is named with @Named annotation. If there is no annotation, the name is the simple name of the class with changing the first character to the lowe case, in the Payment example, component name is payment.

So far we defined the followings about the web beans components
  • Component Type
  • Scope Type
  • Name
We have to explicitly specify that Web Bean Component and the Web Bean Component Instance is different from each other. Instances are created and initialized by the web beans container using the web beans components. We can say that web beans component actually defines the semantic of the classes that instantiates the actual components. Actually, web beans container uses the Container and Context API s to create components instances. We will explains these API in the next coming blogs.

There are two more definitons that must be explained that enable web beans container to fully differentiate the web beans components from each other. These are the API type of the components and the binding type annotation. API type is the class and interface type of the web beans component that it implements. binding type is the special annotation, that differentiates the web beans components that implements the same interface API contract. Binding type annotations is defined using the @BindingType meta annotation.

Lets create some interface that our Payment class implements, call IPayment


public interface IPayment{
public void doPay();
}

And create some sub-classes,

@Component
@RequestScoped
@Credit
public class CreditPayment implements IPayment{

}
@Component
@RequestScoped
@Check
public class CheckPayment implements IPayment{

}

@BindingType
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Check {
}


@BindingType
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Credit {
}
Ok, in the above code we defined two binding type annotation, two class and one interface. This two web beans components implements the same API type contract, namely IPayment. But it differs from each other with binding annotations. When the web beans container injects the IPayment run time instances into the other web beans components, it differentiates each other using the "API type and Binding Type."For example in the following code, web beans container selects the CreditPayment web beans component in the runtime,
@Component
@SessionScoped
public class
PaymentService {

@In @Credit IPayment payment;

public void doPayment
{
payment.doPay();
}
}
In the above code, web beans container injects the CreditPayment instance in the runtime into the PaymentService component. Altough, the API type is the same (IPayment), binding type is the Credit.

Ohhh, we have defined lots of new things in this blog :). In the next blog, we will look at the other type web beans components, componens event and interceptor mechnaisms and so much...


Monday, September 15, 2008

Introduction to WebBeans

Hi to all;

Nowadays I am playing with the Web Beans Specification. It is published on the http://jcp.org. with the code JSR-299.

In these small transcripts, I will try to explain and give an example of what the Web Bean tries to solve in the enterprise development. We can summarize its main objectives as follow
  • Defines contextual components.
  • Handles dependency injections and auto destruction of the components.
  • Defines loosely coupled components wiring using its powerful events mechanism.
  • Adds new scope types to the already defined request, session and application scopes defined in the servlet specification.
  • Allows deployment time changing of the component implementation
  • Allows runtime changing of the component implementation with type safe resolutions
  • Allow components integration with Unified EL
  • Integrates JSF (Java Server Faces) and EJB3 technologies seemlesly. It allows EJB3 session beans as JSF managed beans.
  • It integrates with the JPA extended persistence context.
Actually, Web Beans specification defines the Unified Component Model for Java Enterprise Application based on the existing J2EE specifications. It does not add extra functionality such as transaction management, security etc., it defines and manages the stateful contextual components within well defined scopes.

We will try to create some code examples in the next post to further explain above concepts.

Cheers;

Saturday, May 10, 2008

JBoss Messaging

Last day, I setup JBoss Messaging queue into the JBoss AS. I tried to connect to the Queue from standalone Java project in Eclipse. In Eclipse, I added the JBoss 4.2 GA runtime libraries to the project. Then when I tried to getting connection from the ConnectionFactory, JBoss Messaging on the server side throws Exception like that "bla bla... does not ping client bla.. bla...shut down ping....".

I struggled with this, searching all the forms, etc... I have not found the solution. Then, I tried to look at the classpath, jbossall-client.jar and jboss-remoting.jar are on the class path. But classloader first loads, jbossall-client.jar and then remoting.jar. Just I changed the order of these jars, then everything works like a charm.


Maybe it works for you and saves your valuable time..

Sunday, April 27, 2008

Welcome to Ubuntu

Yesterday, I tried to setup my new laptop with Ubuntu Desktop version 8.04 LTS. Altough I am the regular user of the window OS, I quickly adapted to my new environment. It was amazing to add new programs with its superificial snaptic package manager.

As a fan of the JSF , quckly installed eclipse 3.3 + apache tomcat 6.x and mojarra relesases into my new OS and implement some codes to try. Its great, it works....

It was big step to dive into the Linux world.

I think I will never back to the windows world

Friday, April 4, 2008

First Blog :)

This is my first blog ... Starting from this day, I will share my thinking about the Java and JEE. Happy coding :)