The document discusses various ways that EJB clients can access and interact with EJB beans, including:
1) An EJB bean acting as a client to another bean by looking up the bean's home interface and invoking methods.
2) Serializing a handle to a bean so the reference can be stored and used later to access the bean.
3) Clients managing transactions across multiple bean invocations using the UserTransaction interface.
4) Clients authenticating with the EJB server by passing principal and credential properties.
This document provides an overview of the Spring framework. Key points include:
- Spring is a lightweight container that promotes loose coupling and separation of concerns through dependency injection.
- It simplifies programming without J2EE by providing declarative transaction management and abstraction from underlying technologies.
- Spring uses dependency injection and inversion of control to configure and wire together components. It supports setter, constructor, and autowiring of dependencies.
- The Spring container manages the lifecycle of beans through initialization and destruction callbacks.
Stateful session beans maintain conversational state between client requests by saving the bean's state to a database or file when it is passivated. This state is then restored when the bean is activated for a new client request. The container uses object serialization to save and restore the bean's state. Stateful session beans are appropriate when a business process requires multiple method invocations, while stateless session beans are better for single method calls since they do not maintain conversational state between invocations.
This document provides examples and explanations of different types of Enterprise JavaBeans (EJBs), including stateless session beans, stateful session beans, entity beans, and container-managed persistence. It describes the home and remote interfaces, bean classes, required bean methods, and example client code for each EJB type. It also discusses entity bean mappings, characteristics, and how they represent persistent data stored in a database. Finally, it briefly outlines the multitiered J2EE application model and database connection pooling techniques.
1. The document discusses the differences between a web server and application server, with application servers containing both a web container and EJB container while web servers only contain a web container and do not support clustering.
2. It describes the key components of EJB - the home interface, remote interface, and bean class - and their purposes. The home interface acts as a factory, the remote interface contains business methods, and the bean class implements both interfaces.
3. It outlines the basic architecture and workflow of how a client accesses EJBs, first looking up the home interface and then using it to get a reference to the remote interface to invoke business methods on the bean.
Java Web Programming [2/9] : Servlet BasicIMC Institute
?
This document provides an overview of servlets, including:
- Servlets extend the functionality of HTTP servers and allow for dynamic content generation.
- Servlets handle requests and responses more efficiently than CGI due to being server-independent and allowing for session management.
- The servlet lifecycle includes initialization, request handling, and destruction. Common methods are init(), service(), doGet(), doPost(), and destroy().
- Servlets extract information from HTTP requests and use this to generate and return HTTP responses by setting headers and writing response content.
1) Enterprise JavaBeans (EJBs) are server-side components that expose methods for performing application logic. There are two main types: session beans and message-driven beans.
2) Session beans represent actions or a session and can be either stateless or stateful. Stateless session beans handle a single request and do not maintain conversational state, while stateful session beans span multiple requests and retain state for an individual client.
3) The document provides an example of a bank account application using EJBs, and describes the components of an EJB including business interfaces, EJB classes, and packaging into an EJB JAR file.
Java EE 7 will focus on enabling Java EE applications and services to easily operate in public and private cloud environments. Key areas of focus include improved packaging for cloud deployment, tighter resource management, and potential new APIs for cloud services. Modularity enhancements based on Java SE 8 modules will allow applications to be composed of independent, versioned modules. The first Java EE 7 specifications have already been approved.
The document discusses the key changes and improvements in EJB 3.0, including a simplified programming model using annotations, a new entity bean development model and persistence functionality using the entity manager API. It provides an overview of the new approach and covers topics like entity beans and their lifecycle, the entity manager, queries, object-relational mapping, transactions and how session and message-driven beans work in EJB 3.0.
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010Arun Gupta
?
The document outlines new features in Enterprise JavaBean (EJB) 3.1 technology, including ease of use improvements like optional local business interfaces and simplified packaging. It also describes new functionality like singleton session beans, startup and shutdown callbacks, automatic timer creation, and asynchronous session bean invocations. The changes aim to continue focusing on ease of use while adding useful new capabilities to the EJB specification.
EJB3.1 defines enterprise beans as server-side components that encapsulate business logic. The main types of enterprise beans are session beans, message-driven beans, and entity beans. Session beans are further divided into stateless, stateful, and singleton beans. Enterprise beans provide benefits such as portability, transaction management, and scalability.
This document discusses Spring Core and bean configuration in Spring. It covers defining beans through XML, Java configuration using annotations, and Groovy bean configuration. It also discusses the Spring IoC container and different types of ApplicationContext, and how to define bean dependencies through constructor injection, setter injection, and method injection using the @Bean annotation in Java configuration.
Java Web Programming [5/9] : EL, JSTL and Custom TagsIMC Institute
?
This document provides an overview of Expression Language (EL), JSTL (JSP Standard Tag Library) 1.1, and custom tags. It describes EL expressions, implicit objects, and attributes. It explains core JSTL tags for looping, conditionals, and URL manipulation. It also discusses using JSTL tags to connect to a database and format output. Finally, it outlines how to create a custom tag library with a TLD file, tag handler class, and JSP file to implement a simple tag.
The document discusses Java Server Pages (JSP) technology which provides a simplified way to create dynamic web content. JSP pages are compiled into servlets, allowing developers to embed Java code directly into HTML pages to interact with databases and other applications. The document covers key aspects of JSP including its architecture, lifecycle, directives like include and taglib, and how it enables rapid development of web applications.
Java Web Programming [8/9] : JSF and AJAXIMC Institute
?
This document provides an overview of JavaServer Faces (JSF) and Asynchronous JavaScript and XML (AJAX). It describes JSF as a server-side user interface framework that uses components like UIForm and UIInput to build web applications. It also explains how AJAX allows for asynchronous client-server communication using XMLHttpRequest to update parts of a page without reloading. The key technologies discussed are JSF tags, configuration files, components and validators as well as the steps involved in an AJAX request like creating an XMLHttpRequest object and processing the response.
This document discusses entity beans in Java. It defines entity beans as enterprise beans that represent persistent data stored in a database. Each entity bean instance corresponds to a row in a database table. The EJB container is responsible for loading data into entity bean instances and storing it back in the database. Entity beans are persistent, meaning their state exists across client sessions. They also support shared access, with multiple clients accessing the same data through separate entity bean instances. The document outlines the characteristics and lifecycle of entity beans.
This document provides an overview of JSP/Servlet architecture. It describes how a web request is handled from the browser to the web server and JSP/Servlet container. It then discusses key components like servlets, JSPs, the request and response objects. It provides examples of basic servlet and JSP code to output text and access request parameters. It also covers servlet configuration, mappings, and the use of forwards and redirects.
This document discusses WebSockets and their APIs. It introduces WebSockets as enabling bi-directional, full-duplex communications over TCP, in contrast to traditional HTTP interactions which are half-duplex. It then covers the WebSocket handshake process, APIs for WebSocket in JavaScript and Java, and how to create and use WebSocket endpoints programmatically and using annotations in Java.
this ppt tells you about what is spring in java. how to use spring? and what are the main methods of spring class? For more info and free java projects visit : http://s4al.com/category/study-java/
This ppt tells about spring class in java. what spring class have, all the methods in brief. for more info please visit : http://s4al.com/category/study-java/
Java Web Programming [3/9] : Servlet AdvancedIMC Institute
?
This document provides an overview of servlet advanced topics including including, forwarding to, and redirecting to other web resources. It discusses servlet and JDBC integration including using prepared statements and callable statements. It also covers session tracking APIs and how they can be used to maintain state across HTTP requests through different mechanisms like cookies or URL rewriting. Finally, it briefly introduces servlet scopes, listeners, and filters.
JAVA EE DEVELOPMENT (JSP and Servlets)Talha Ocak??
?
Java and J2EE is the most used technologies in enterprise web development. Telecom operators, service providers are using these technlogies; banking and insurance companies are moving to Java from old generation technologies.
https://www.udemy.com/java-web-developmen-with-real-world-development-flow
If you want to earn much in web development business, you also need to learn Java web technologies.
Java has de facto standart frameworks such as EJB 3.0, Spring and others that can be bound to them.
But at heart, they all use the similar JSP/Servlet technology and add some layers above them to speed up the development.
You will use them in your daily business but before using them, you must learn the basics and what is going on while using them. Otherwise, you will not be able to find a proper solution to common problems.
This course will make you understand the basics of JSP / servlet technlogies, designing a relational database, DB operations, design patterns, working with other developers,
and let you know the must-do operations in professional projects such as performance increasing, logging errors.
If you want to develop a web-site in a couple of hours without understanding what you are doing, you may go ahead and find other resources. But if you really want to understand what you are doing and learn the theory at the same time, this course will be a great oppurtunity for you. You will develop a real working project. Yow will first write quick and dirty code then you will apply professional patterns one by one while investigating the problems.
You will walk through a real development flow:
1- Write a quick and dirty code for doing the job.
2- You will design database tables and high performance queries
3 - You will apply design patterns to make the code reusable and high performance.
4 - You will beautify the user interface with Javascript and CSS tweaks
5- You will add exception handling, logging mechanism for production environment
6- AT THIS STEP, YOU WILL BE HIRED FOR MUCH MUCH HIGHER SALARIES. BECAUSE YOU ARE A REAL PROFESSIONAL.
This document provides an overview of Enterprise Java Beans (EJB) including:
- The different types of EJB components including session beans, message-driven beans, and entities.
- Session beans can be stateless, stateful, or singleton and their differences are summarized.
- How EJB components are accessed through local, remote, and no-interface views using dependency injection or JNDI lookups.
- Message-driven beans process asynchronous JMS messages.
- Transactions, persistence contexts, and resources can be managed by the EJB container through annotations.
This document provides an overview of new features in Java EE 7, including WebSocket, JSON processing, batch applications, concurrency utilities, simplified JMS, and more. It discusses these features and their availability in upcoming Liberty releases. The roadmap outlines IBM's plans to deliver a full Java EE 7 compliant WebSphere Application Server and continuous delivery of new features through Liberty. Related sessions at the conference are also listed.
This document provides an overview and comparison of various Java web frameworks including JPA 2, MyBatis, Hibernate, Struts 2, Stripes, Spring MVC, Tapestry, Wicket, JSF 2, and GWT. Code examples are shown for implementing basic CRUD functionality using each framework. The frameworks are evaluated based on factors such as ease of use, query APIs, performance, portability, and community support.
1. O documento apresenta os termos e condi??es de uso da publica??o "Cartilha de Seguran?a para Internet" sob a licen?a Creative Commons.
2. A cartilha fornece recomenda??es sobre como aumentar a seguran?a no uso da Internet e proteger-se de amea?as.
3. O documento n?o pode ser alterado ou usado comercialmente de acordo com a licen?a, mas pode ser copiado e distribu¨ªdo desde que devidamente creditado.
The document discusses the key changes and improvements in EJB 3.0, including a simplified programming model using annotations, a new entity bean development model and persistence functionality using the entity manager API. It provides an overview of the new approach and covers topics like entity beans and their lifecycle, the entity manager, queries, object-relational mapping, transactions and how session and message-driven beans work in EJB 3.0.
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010Arun Gupta
?
The document outlines new features in Enterprise JavaBean (EJB) 3.1 technology, including ease of use improvements like optional local business interfaces and simplified packaging. It also describes new functionality like singleton session beans, startup and shutdown callbacks, automatic timer creation, and asynchronous session bean invocations. The changes aim to continue focusing on ease of use while adding useful new capabilities to the EJB specification.
EJB3.1 defines enterprise beans as server-side components that encapsulate business logic. The main types of enterprise beans are session beans, message-driven beans, and entity beans. Session beans are further divided into stateless, stateful, and singleton beans. Enterprise beans provide benefits such as portability, transaction management, and scalability.
This document discusses Spring Core and bean configuration in Spring. It covers defining beans through XML, Java configuration using annotations, and Groovy bean configuration. It also discusses the Spring IoC container and different types of ApplicationContext, and how to define bean dependencies through constructor injection, setter injection, and method injection using the @Bean annotation in Java configuration.
Java Web Programming [5/9] : EL, JSTL and Custom TagsIMC Institute
?
This document provides an overview of Expression Language (EL), JSTL (JSP Standard Tag Library) 1.1, and custom tags. It describes EL expressions, implicit objects, and attributes. It explains core JSTL tags for looping, conditionals, and URL manipulation. It also discusses using JSTL tags to connect to a database and format output. Finally, it outlines how to create a custom tag library with a TLD file, tag handler class, and JSP file to implement a simple tag.
The document discusses Java Server Pages (JSP) technology which provides a simplified way to create dynamic web content. JSP pages are compiled into servlets, allowing developers to embed Java code directly into HTML pages to interact with databases and other applications. The document covers key aspects of JSP including its architecture, lifecycle, directives like include and taglib, and how it enables rapid development of web applications.
Java Web Programming [8/9] : JSF and AJAXIMC Institute
?
This document provides an overview of JavaServer Faces (JSF) and Asynchronous JavaScript and XML (AJAX). It describes JSF as a server-side user interface framework that uses components like UIForm and UIInput to build web applications. It also explains how AJAX allows for asynchronous client-server communication using XMLHttpRequest to update parts of a page without reloading. The key technologies discussed are JSF tags, configuration files, components and validators as well as the steps involved in an AJAX request like creating an XMLHttpRequest object and processing the response.
This document discusses entity beans in Java. It defines entity beans as enterprise beans that represent persistent data stored in a database. Each entity bean instance corresponds to a row in a database table. The EJB container is responsible for loading data into entity bean instances and storing it back in the database. Entity beans are persistent, meaning their state exists across client sessions. They also support shared access, with multiple clients accessing the same data through separate entity bean instances. The document outlines the characteristics and lifecycle of entity beans.
This document provides an overview of JSP/Servlet architecture. It describes how a web request is handled from the browser to the web server and JSP/Servlet container. It then discusses key components like servlets, JSPs, the request and response objects. It provides examples of basic servlet and JSP code to output text and access request parameters. It also covers servlet configuration, mappings, and the use of forwards and redirects.
This document discusses WebSockets and their APIs. It introduces WebSockets as enabling bi-directional, full-duplex communications over TCP, in contrast to traditional HTTP interactions which are half-duplex. It then covers the WebSocket handshake process, APIs for WebSocket in JavaScript and Java, and how to create and use WebSocket endpoints programmatically and using annotations in Java.
this ppt tells you about what is spring in java. how to use spring? and what are the main methods of spring class? For more info and free java projects visit : http://s4al.com/category/study-java/
This ppt tells about spring class in java. what spring class have, all the methods in brief. for more info please visit : http://s4al.com/category/study-java/
Java Web Programming [3/9] : Servlet AdvancedIMC Institute
?
This document provides an overview of servlet advanced topics including including, forwarding to, and redirecting to other web resources. It discusses servlet and JDBC integration including using prepared statements and callable statements. It also covers session tracking APIs and how they can be used to maintain state across HTTP requests through different mechanisms like cookies or URL rewriting. Finally, it briefly introduces servlet scopes, listeners, and filters.
JAVA EE DEVELOPMENT (JSP and Servlets)Talha Ocak??
?
Java and J2EE is the most used technologies in enterprise web development. Telecom operators, service providers are using these technlogies; banking and insurance companies are moving to Java from old generation technologies.
https://www.udemy.com/java-web-developmen-with-real-world-development-flow
If you want to earn much in web development business, you also need to learn Java web technologies.
Java has de facto standart frameworks such as EJB 3.0, Spring and others that can be bound to them.
But at heart, they all use the similar JSP/Servlet technology and add some layers above them to speed up the development.
You will use them in your daily business but before using them, you must learn the basics and what is going on while using them. Otherwise, you will not be able to find a proper solution to common problems.
This course will make you understand the basics of JSP / servlet technlogies, designing a relational database, DB operations, design patterns, working with other developers,
and let you know the must-do operations in professional projects such as performance increasing, logging errors.
If you want to develop a web-site in a couple of hours without understanding what you are doing, you may go ahead and find other resources. But if you really want to understand what you are doing and learn the theory at the same time, this course will be a great oppurtunity for you. You will develop a real working project. Yow will first write quick and dirty code then you will apply professional patterns one by one while investigating the problems.
You will walk through a real development flow:
1- Write a quick and dirty code for doing the job.
2- You will design database tables and high performance queries
3 - You will apply design patterns to make the code reusable and high performance.
4 - You will beautify the user interface with Javascript and CSS tweaks
5- You will add exception handling, logging mechanism for production environment
6- AT THIS STEP, YOU WILL BE HIRED FOR MUCH MUCH HIGHER SALARIES. BECAUSE YOU ARE A REAL PROFESSIONAL.
This document provides an overview of Enterprise Java Beans (EJB) including:
- The different types of EJB components including session beans, message-driven beans, and entities.
- Session beans can be stateless, stateful, or singleton and their differences are summarized.
- How EJB components are accessed through local, remote, and no-interface views using dependency injection or JNDI lookups.
- Message-driven beans process asynchronous JMS messages.
- Transactions, persistence contexts, and resources can be managed by the EJB container through annotations.
This document provides an overview of new features in Java EE 7, including WebSocket, JSON processing, batch applications, concurrency utilities, simplified JMS, and more. It discusses these features and their availability in upcoming Liberty releases. The roadmap outlines IBM's plans to deliver a full Java EE 7 compliant WebSphere Application Server and continuous delivery of new features through Liberty. Related sessions at the conference are also listed.
This document provides an overview and comparison of various Java web frameworks including JPA 2, MyBatis, Hibernate, Struts 2, Stripes, Spring MVC, Tapestry, Wicket, JSF 2, and GWT. Code examples are shown for implementing basic CRUD functionality using each framework. The frameworks are evaluated based on factors such as ease of use, query APIs, performance, portability, and community support.
1. O documento apresenta os termos e condi??es de uso da publica??o "Cartilha de Seguran?a para Internet" sob a licen?a Creative Commons.
2. A cartilha fornece recomenda??es sobre como aumentar a seguran?a no uso da Internet e proteger-se de amea?as.
3. O documento n?o pode ser alterado ou usado comercialmente de acordo com a licen?a, mas pode ser copiado e distribu¨ªdo desde que devidamente creditado.
This document contains the resume of Appasaheb Sakharam Kapase. He has over 10 years of experience working with technologies like C#, .NET, JavaScript, JQuery, and SharePoint. Some of his responsibilities include managing teams, analyzing requirements, designing solutions, testing applications, and implementing applications in SharePoint. He has experience working on various projects for MWH ResourceNet India Pvt. Ltd., including projects involving custom SharePoint web parts, electronic data management tools, and reporting systems.
El documento presenta una gu¨ªa para el desarrollo de proyectos de aula. Explica que estos proyectos buscan cubrir vac¨ªos educativos o sociales de los estudiantes mediante el uso de recursos y herramientas diferentes en el aula. Luego, detalla los pasos a seguir en cuatro fases: 1) Reconocimiento de recursos y necesidades, 2) Planificaci¨®n, 3) Ejecuci¨®n de actividades, y 4) Evaluaci¨®n y justificaci¨®n de resultados. Finalmente, indica que la fase de ejecuci¨®n debe presentarse en PowerPoint
Viewers have short attention spans and internet connections can be slow, so it's important to optimize websites for speed. A site should load within 10 seconds, with the initial page structure visible within 3-4 seconds. To optimize, remove unnecessary elements like animations, images, and large JavaScript files. Break pages with large bodies of text into multiple, shorter pages. Multimedia like sound and Flash should be optional elements users must click to engage with. Proper optimization can reduce page sizes and speeds load times to keep users engaged on a site.
The document discusses how to create a basic CSS layout using div tags. It explains how to create a container div to hold all content, add additional divs like header, columns, and footer, and customize each div with CSS styles. It also covers customizing the body tag for the background and link tags to change default styles. The overall process is to create div tags in HTML, then style each div and other tags like body and links using CSS to control positioning, sizing, and formatting of elements on the page.
What's New in Enterprise JavaBean Technology ?Sanjeeb Sahoo
?
This document summarizes new features in Enterprise JavaBean (EJB) technology. EJB 3.0 introduced annotations for metadata and simplified bean types. EJB 3.1 focused on further ease of use through optional local interfaces, simplified packaging, and portable global JNDI names. New features include singleton session beans, startup/shutdown callbacks, automatic timer creation, and asynchronous session bean invocations.
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...jaxLondonConference
?
Presented at JAX London 2013
The Java EE 7 platform focuses on Productivity and HTML5. JAX-RS 2 adds a new Client API to invoke the RESTful endpoints. JMS 2 is undergoing a complete overhaul to align with improvements in the Java language. The long awaited Batch Processing API and Concurrency API are also getting added to build applications using capabilities of the platform itself. Together these APIs will allow you to be more productive by simplifying enterprise development. WebSocket attempts to solve the issues and limitations of HTTP for real-time communication.
Java EE 7: Boosting Productivity and Embracing HTML5Arun Gupta
?
The document discusses the key features of Java EE 7 including improved developer productivity through more annotated POJOs, less boilerplate code, and a cohesive integrated platform. It highlights top features such as WebSocket client/server endpoints, batch applications, JSON processing, concurrency utilities, simplified JMS API, and more annotated POJOs. The document provides details on these features and code examples for concepts like WebSocket chat servers, JSON streaming API, batch job specification, and simplified JMS message sending.
EJB 3.0 Java Persistence with Oracle TopLinkBill Lyons
?
This document discusses using Oracle TopLink as a persistence framework with Java Persistence API (JPA) and EJB 3.0. It provides an overview of setting up a TopLink project in JDeveloper, generating entity objects and a session bean, and performing basic CRUD operations. The document demonstrates how to query, insert, update, and delete data using the TopLink APIs.
EJB 3.0 simplifies Java EE application development by reducing the number of required interfaces and classes. It utilizes annotations for configuration and dependency injection to reduce boilerplate code. The new persistence API allows entities to be simple POJOs and supports pluggable providers. Existing EJB 2.1 applications continue to work with EJB 3.0, and migration can be done incrementally to reduce the number of files and lines of code.
JBoss Application Server 7 includes several key features:
1. It is a lightweight Java EE 6 compliant container that provides fast startup times of less than 3 seconds.
2. It simplifies classloading and configuration for easier management and deployment.
3. It supports the use of managed beans, dependency injection and common services as specified by the CDI specification.
The document discusses the new features of Java EE 7 including WebSockets, JSON processing, batch applications, concurrency utilities, simplified JMS API, RESTful web services client API, and more annotated POJOs. It provides details on each of the top 10 features and how they improve developer productivity and meet enterprise demands. The document encourages developers to download the Java EE 7 SDK and GlassFish 4.0 implementation to use the new features.
Enterprise Java Beans (EJBs) allow developers to create reusable components called beans that can be assembled into applications. A bean represents some business logic or functionality that can then be used across different programs. EJBs handle transactions, security, and other services for beans so developers can focus on business logic. Beans run under an EJB container that manages method calls and inserts services like transactions. There are three types of beans: entity beans that represent database rows, message-driven beans that consume JMS messages, and session beans for other business processes.
Enterprise Java Beans (EJBs) allow developers to create reusable components called beans that can be assembled into applications. A bean represents some business logic or functionality that can be reused across applications, such as a customer bean that represents a customer in a database. EJBs take code reuse to a new level by allowing whole functionalities to be reused rather than just code. EJBs let developers focus on business logic while the underlying services like transactions and security are handled by the EJB server.
EJB 3.0 introduced a simplified programming model for enterprise Java with plain old Java objects (POJOs), dependency injection, and metadata-driven configuration. The new features include support for POJO session beans with simplified lifecycles, the Java Persistence API (JPA) for object-relational mapping, and the ability to define interceptors for cross-cutting concerns.
1. The document provides an overview of the major Java 2 Enterprise Edition (J2EE) technologies including Java servlets, JavaServer Pages (JSP), Enterprise JavaBeans (EJB), Java Message Service (JMS), Java Database Connectivity (JDBC), and Java Naming and Directory Interface (JNDI).
2. It describes the basic anatomy and functionality of servlets, JSP, EJB components including session and entity beans, and JMS.
3. Examples of simple servlet, JSP, EJB, and JMS code are included to illustrate how each technology can be implemented.
The document provides an overview of J2EE (Java 2 Enterprise Edition) technologies including servlets, JSP, EJB, and how they are used to build web applications. It describes the major components of J2EE like servlets, JSP, EJB, their anatomy and usage. Sample code is also included to demonstrate servlets and JSP.
This document discusses asynchronous I/O in Java and Scala using the Play Framework. It describes how LinkedIn uses a service-oriented architecture with hundreds of services making requests to each other. It then covers how Play supports non-blocking I/O using asynchronous code, promises, and futures to allow parallel requests without blocking threads. Key points covered include using map and flatMap to transform promises and futures, handling errors and timeouts, and the benefits of non-blocking I/O for scalability.
This document provides an overview of the key differences between Play Framework versions 1.0 and 2.1. It notes that Play 2.1 introduces support for Scala and Java, uses dynamic compilation via SBT, includes error reporting for JavaScript, and is designed for long browser connections. It also summarizes how to work with templates, HTML forms, databases, and JSON in Play 2.1 applications.
This document discusses Java Database Connectivity (JDBC) which is an API used to connect Java applications to databases. It describes the different types of JDBC drivers including bridge, native, network protocol, and thin drivers. It also outlines the basic steps to connect to a database using JDBC including registering the driver, getting a connection, creating statements, executing queries, and closing the connection. Key interfaces like Connection, Statement, PreparedStatement, and ResultSet are also summarized.
This document provides an introduction and overview of the Spring Framework. It discusses that Spring is an open-source application framework that provides dependency injection and inversion of control. It allows for lightweight containers and frameworks. Spring provides dependency management between objects, cleaner separation of responsibilities, and the ability to build applications from POJOs. The document covers key Spring concepts like inversion of control, dependency injection, bean scopes, lifecycle callbacks, and autowiring. It provides examples of how to configure these concepts in Spring.
Integration of Backbone.js with Spring 3.1Micha? Orman
?
This document discusses integrating Backbone.js with Spring 3.1. It begins with an overview of new features in Spring 3.1, such as cache abstraction, bean definition profiles, and Java-based configuration. It then provides an introduction to Backbone.js, explaining how it gives structure to web applications using models, collections, views and routers. The document demonstrates how to integrate Backbone.js and Spring 3.1 by using Spring to provide a RESTful JSON API for Backbone models and collections to communicate with, while keeping the UI rendered separately using Backbone views. It provides examples of tasks being managed through GET, POST, PUT and DELETE requests to the Spring API.
Hibernate is an object-relational mapping tool for Java that allows developers to persist Java objects to a relational database in a transparent way. It provides transparent persistence without needing to flatten objects or write database specific code. Hibernate uses an object-oriented query language that closely resembles SQL to retrieve and manipulate persisted objects.
This document summarizes the Guice dependency injection framework. It provides an overview of key Guice concepts like dependency injection, modules, and bindings. It also discusses Guice extensions like Warp Persist for persistence and transaction management and Google GIN which compiles Guice configuration at compile time for improved performance.
The document discusses Java EE 7 and its new features. It provides an overview of APIs added in Java EE 7 like JMS 2, batch processing, bean validation 1.1, JAX-RS 2, JSON processing, and concurrency utilities. The document also mentions some planned features for Java EE 8 like JSON-B, JCache, CDI 2.0 and highlights resources for learning more about Java EE.
4. Concept
EJB regroups several concepts
Provides different services (Session Bean),
communicates with another application (Message Bean),
saves information (Entity Bean).
Just like a brain, EJB is the
center of the application.
It proposes many functions.
5. Version 3
The previous version (2.1) was too complex
The version 3.0 tends to simplification :
Less steps, less classes, less configuration
Improvements from Java EE 5
Annotations
Generics
Java Persistance API
Concepts remain the same, but Sun integrated many ideas
from popular open-source projects like Spring or Hibernate.
6. Application servers
WebLogic, by BEA
Oracle Application Server, by Oracle
JBoss, by RedHat
GlassFish, by Sun MicroSystems
8. Facade pattern
The Session Bean acts as a ¡°facade¡±.
It's the client's interlocutor
9. Client access
Different clients can call the Session Bean methods if they
possess its interface
Desktop application
Interface
Implementation
Session Bean deployed on a server
Web application
12. Session Bean Local
Set @Local on the interface (not mandatory)
Used when the client is deployed in the same virtual
machine
Example :
A Web application deployed in the same server as the
Session Bean
Advantage :
Resource-friendly
More secure
Disadvantage :
Local scope
13. Session Bean Local
Local interfaces are not mandatory
@Stateless
public class HelloServiceBean {
public String sayHello(){
return "Hello World";
}
}
14. Session Bean Remote
Set @Remote on the interface
Used when the client is located in a different virtual
machine
Example :
A web application deployed in a different server than the
Session Bean
A rich-client
Advantage :
Open on the network
Disadvantage :
Consumes more resources (uses RMI)
Security
15. Session Bean Remote
Interface
@Remote
public interface HelloService {
public String sayHello();
}
Implementation
@Stateless
public class HelloServiceBean implements HelloService{
public String sayHello(){
return "Hello World";
}
}
16. Stateless mode
A Stateless Bean is not bound to any client
Exemples :
Retrieve a list of
products
HelloService
getPlaces() getPlaces()
Advantage : getTrips()
Resource-friendly
17. Stateless mode
@Stateless
public class HelloWorld {
public String sayHelloTo(String name){
return "Hello " + name;
}
}
18. Stateful mode
A Statefull Bean is bound to a client
Exemples :
Cart
OrderService getPlaces()
getPlaces()
Advantage : getTrips()
Impact on server
performance
19. Stateful mode
@Stateful
public class OrderService {
public void setName(String name){¡};
public void setAddress(String address){¡};
public void buyDog(){¡};
¡
}
20. Singleton mode
One Singleton Bean per JVM
Exemples :
Counter
Cache
Advantage :
Resource-friendly
One instance
Disadvantage :
One instance
21. Singleton mode
@Singleton
public class Counter {
private int i = 0;
public int getCount(){
return ++i;
}
}
22. Asynchronous calls
How to have asynchronous call in EJBs ?
Threads don't integrate well
@Asynchronous
Method returns void or java.util.concurrent.Future<T>
23. Asynchronous calls
@Stateless
public class HelloWorld {
@EJB MailManager mailManager;
public String sayHelloTo(String name){
mailManager.sendMail();
return "Hello " + name;
}
}
@Stateless
public class MailManager {
@Asynchronous
public void sendMail(){
...
}
}
24. Timer Service
Programmatic and Calendar based scheduling
? Last day of the month ?
? Every five minutes on Monday and Friday ?
Cron-like syntax
second [0..59], minute[0..59], hour[0..23], year
DayOfMonth[1..31]
dayOfWeek[0..7] or [sun, mon, tue..]
Month[0..12] or [jan,feb..]
29. Unit Test
Cactus is a simple test framework for
unit testing server-side java code
(Servlets, EJBs, Tag Libs, Filters, ...).
The Ejb3Unit project automates Entity and Session
bean testing outside the container for the EJB 3.0
specification.
31. EJB connection with lookup
The client needs the JNDI context to connect to the server.
The client also needs the Session Bean interface
Retrieve the Session Bean with a lookup()
Then it's possible to call methods from the Bean
Context context = new InitialContext();
HelloService hello = (HelloService)
context.lookup(HelloService.class.getName());
System.out.println(hello.sayHello());
The Session Bean will send you a message !
32. EJB connection with lookup
jndi.properties file example
GlassFish parameters
java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory
java.naming.factory.url.pkgs=com.sun.enterprise.naming
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
JBoss Parameters
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url = 127.0.0.1:1099
33. EJB injection
In the same JVM, it's not necessary to do a lookup()
Obtain a Session Bean with resource injection
Used in other EJBs, web applications
public class ClientServiceBean
implements ClientService {
@EJB
private OrderService orderService;
...
}
34. Soap WS in EJB module
Add @WebService and @Stateless annotation on a class
It run !
@WebService
@Stateless
public class MyBeanPublic {
@WebMethod
public String helloWorld() {
return null;
}
}
Default WSDL address : http://localhost:
8080/MyBeanPublicService/MyBeanPublic?wsdl
35. Soap WS in EJB module
Now, we use our EJB @stateless in our SOAP WS.
@WebService
@Stateless
public class MyBeanPublic {
@EJB
private MyBeanLocal ejbRef;
@WebMethod
public String helloWorld() {
return ejbRef.helloWorld();
}
}
39. Persistence Unit
Different providers
Hibernate (use by default in JBoss)
TopLink (use by default in Glassfish v2)
EclipseLink (use by default in Glassfish v3)
42. EntityManager in EJB
Obtain an EntityManager with injection
@Stateless
public class DAO {
@PersistenceContext(unitName="montrealjugPU")
protected EntityManager em;
public void createCat(Cat cat){
em.persist(cat);
}
}
44. JMS presentation
The same since 2002
Used when some information should be exchanged
between
Two applications : point-to-point model
Several applications : publish and subscribe model
Asynchronous system : messages are received when the
client request them
Similar to a mail system
47. Messages
There are three different types of messages
TextMessage to send simple text
ObjectMessage for a serialized object
MapMessage contains a map with strings as keys and
objects as values
48. Send a message
In order to send a message, we have to:
Reclaim required objects via JNDI
A ConnectionFactory (service provider)
A Destination (Queue or Topic)
Create a Connection using the factory
Open a Session using the connection
Create a MessageProducer
Send the message
49. Send a message
Context ctx = new InitialContext();
ConnectionFactory connectionFactory = (ConnectionFactory) ctx
.lookup("ConnectionFactory");
Destination destination = (Destination) ctx.lookup("queue/StockValue");
Connection cnx = connectionFactory.createConnection();
Session session = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(destination);
TextMessage message = session.createTextMessage();
message.setText("Your'microsoft' stock has been sold !");
producer.send(message);
cnx.close();
50. Receive a message
Two ways to receive a message
Blocking, waiting for a message
Non-blocking, using a message listener
A message listener is similar to an event listener : it
"subscribes" to a particular destination and receives
messages each time there's a new one
51. Receive a message
Blocking mode
MessageConsumer consumer = session.createConsumer
(destination);
// Retrieve a single message
Message receivedMessage = consumer.receive();
Non-blocking mode, using a listener
MessageConsumer consumer = session.createConsumer(destination);
// Set the listener
consumer.setMessageListener(new MessageListener() {
public void onMessage(Message message) {
// Will be called each time a message is received
}
});
52. Receive a message : Message Driven Bean
A Message Driven Bean is a specific component for
receiving messages
Annotation used is @MessageDriven
Destination name and type are declared in the annotation
Implements javax.jms.MessageListener
Method public void onMessage(Message m)
Called at the moment of receipt