博文

目前显示的是 六月, 2010的博文

How to Build an HTML5 Video Player

http://blog.steveheffernan.com/2010/04/how-to-build-an-html5-video-player/

Stateful Session Bean Example

In this part of Enterprise Session Beans, you will learn how to develop, deploy, and run a simple Java EE application named account using stateful session bean. The purpose of account is to performs two transaction operations (deposit and withdraw) for the customer. The account application consists of an enterprise bean, which performs the transactions, and two types of clients: an application client and a web client . here are following steps that you have to follow to develop a account JEE application . Create the enterprise bean: AccountBean Create the application client: AccountCustomer Deploy account onto the server. Run the application client. I. Creating the enterprise bean: The enterprise bean in our example is a statelful session bean called AccountBean. The account session bean represents an account information in an online customer account. The bean’s customer can deposit to or withdraw the amount from his account. To manage account, you...

Stateless Session Bean Example

图片
In this part of Enterprise Session Beans, you will learn how to develop, deploy, and run a simple Java EE application named example using stateless session bean. The purpose of example is to performs the mathematical operations such as Addition, Subtraction, Multiplication, and Division. The example application consists of an enterprise bean, which performs the calculations, and two types of clients: an application client and a web client . There are following steps that you have to follow to develop a example JEE application Create the enterprise bean: CalculatorBean Create the web client: WebClient Deploy example onto the server. Using a browser, run the web client. I. Creating the enterprise bean: The enterprise bean in our example is a stateless session bean called CalculatorBean . The source code for CalculatorBean is in “net/roseindia/ejb3/stateless” directory. Creating CalculatorBean requires these steps: (i) Coding the bean’s...

EJB - Intro to Session beans

图片
What is a Session bean A session bean is the enterprise bean that directly interact with the user and contains the business logic of the enterprise application . A session bean represents a single client accessing the enterprise application deployed on the server by invoking its method. An application may contain multiple sessions depending upon the number of users accessing to the application. A session bean makes an interactive session only for a single client and shields that client from complexities just by executing the business task on server side. For example, whenever a client wants to perform any of these actions such as making a reservation or validating a credit card, a session bean should be used. The session bean decides what data is to be modified. Typically, the session bean uses an entity bean to access or modify data. They implement business logic, business rules, algorithms, and work flows. Session beans are relatively short-lived components. The EJB container may...

Intro to annotation p2

Annotations: JDK 5 (Tiger) contains two types of annotations: Simple annotations: These types of annotations are used to annotate the code only. We can not use these types of annotations for creating the custom annotation type. Meta annotations: Also known as annotations of annotations are used to annotate the annotation-type declaration. Simple annotations: JDK 5 includes three types of simple annotations. Override Depricated Suppresswarnings Meta-Annotations (Annotation Types): There are four types ofm Meta annotations (or annotations of annotations) defined by the JDK 5. These are as follows: Target Retention Documented Inherited Target annotation: Target annotation specifies the elements of a class to which annotation is to be applied. Here is the listing of the elements of the enumerated types as its value: @Target(ElementType.TYPE)—applicable to any element of a class. @Target(ElementType.FIELD)—applicable to field or property....

EJB 3.0 Features

图片
Elimination of Home and Remote Interfaces:  The new session beans contain all the business methods inside the business interface. The bean provider designates the business interface as local business interface or the remote business interface or both according to the client whether it is local or remote. Elimination of Component Interface:  Component interface in EJB2.1 or in earlier versions are used to provide a way through which the container notifies the bean instances of various life cycles they are affecting it.  Now the next question that arises is that how a bean class get notified by the container if it is interested? The solution is that there are two ways to do so, the first one is, the bean provider can implement a separate bean class that consists of all the callback notification methods that inform the container to treat it as a listener class. The second way is that, a bean provider can implement the notification method inside the bean class and desig...