EJB - Marco Ronchetti - Università di Trento

annuncio pubblicitario
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Roles
J0
1
EJB Roles
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
MAIN ROLES: Enterprise Bean Provider
The Enterprise Bean Provider is typically an application domain
expert. The Bean Provider develops reusable enterprise beans that
typically implement business tasks or business entities.
The Bean Provider is not required to be an expert at system-level
programming. Therefore, the Bean Provider usually does not
program transactions, concurrency, security, distribution, or other
services into the enterprise Beans. The Bean Provider relies on the
EJB Container for these services.
A Bean Provider of multiple enterprise beans often performs the
EJB Role of the Application Assembler.
J0
2
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
MAIN ROLES: Application Assembler
J0
3
The Application Assembler is a domain expert who composes
applications that use enterprise Beans.
The Application Assembler works with the enterprise Bean’s
deployment descriptor and the enterprise Bean’s client-view
contract.
Although the Assembler must be familiar with the functionality
provided by the enterprise Bean’s home and component interfaces,
he or she does not need to have any knowledge of the enterprise
Bean’s implementation.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
MAIN ROLES: Deployer
J0
4
The Deployer is an expert at a specific operational environment and
is responsible for the deployment of enterprise Beans.
The Deployer takes one or more ejb-jar files produced by a Bean
Provider or Application Assembler and deploys the enterprise beans
contained in the ejb-jar files in a specific operational environment.
The Deployer must resolve all the external dependencies declared
by the Bean Provider, and must follow the application assembly
instructions defined by the Application Assembler. To perform his
or her role, the Deployer uses tools provided by the EJB Container
Provider.
The Deployer’s output are enterprise beans (or an assembled
application that includes enterprise beans) that have been
customized for the target operational environment, and that are
deployed in a specific EJB Container.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
AUXILIARY ROLES: EJB Server Provider
J0
5
The EJB Server Provider is a specialist in the area of distributed
transaction management, distributed objects, and other lower-level
system-level services.
A typical EJB Server Provider is an OS vendor, middleware vendor,
or database vendor.
The current EJB architecture assumes that the EJB Server Provider
and the EJB Container Provider roles are the same vendor.
Therefore, it does not define any interface requirements for the EJB
Server Provider.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
AUXILIARY ROLES: Container Provider
J0
6
The Container Provider provides:
• The deployment tools for the deployment of enterprise beans.
• The runtime support for the deployed enterprise bean instances.
The Container Provider insulates the enterprise Bean from the
specifics of an underlying EJB Server by providing a simple,
standard API between the enterprise Bean and the container. This
API is the Enterprise JavaBeans component contract.
The Container Provider typically provides:
•support for versioning the installed enterprise Bean components.
•tools that allow the system administrator to monitor and manage
the container and the Beans running in the container at runtime.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
AUXILIARY ROLES: System Administrator
J0
7
The System Administrator is responsible for the configuration and
administration of the enterprise’s computing and networking
infrastructure that includes the EJB Server and Container.
The System Administrator is also responsible for overseeing the
well-being of the deployed enterprise beans applications
at runtime.
The EJB architecture does not define the contracts for system
management and administration. The System Administrator
typically uses runtime monitoring and management tools provided
by the EJB Server and Container Providers to accomplish these
tasks.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
ROLES: Overall view
J0
8
Image taken from
“Mastering EJ2B”
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Co-tech
J0
9
Collaborating technologies
Marco Ronchetti - [email protected] 
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
J0
10
Typical
ROLES: Overall view
Architectural
View
Image taken from
“Mastering EJ2B”
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Collaborating technologies (Co-tech): the core
J0
11
Enterprise JavaBeans (EJB)
EJB defines how server-side components are written and
provides a standard contract between components and the
application servers that manage them. EJB is the cornerstone
for J2EE and uses several other J2EE technologies.
Java Remote Method Invocation (RMI) and RMI-IIOP
RMI is the Java language’s native way to communicate
between distributed objects, such as two different objects
running on different machines. RMI-IIOP is an extension of
RMI that can be used for CORBA integration. RMI-IIOP is the
official API that we use in J2EE (not RMI).
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Co-tech: interface for Web clients
J0
12
Java Servlets. Servlets are networked components that you
can use to extend the functionality of a Web server. Servlets
are request/response oriented in that they take requests from
some client host (such as a Web browser) and issue a
response back to that host.
Java Pages (JSPs). JSPs are dual to servlets: Servlets
embed HTML into Java code, while JSP scripts embed Java
code into HTML pages. Especially when using JSP Custom
Tags, JSP pages can be easily written and maintained by
non-Java savvy staff members You would use JSP when you
want the look and feel of your deployment to be physically
separate and easily maintainable from the rest of your
deployment.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Co-tech: interface for non-Web clients
J0
13
Java IDL. Java IDL is Sun Microsystems’ Java-based
implementation of CORBA. Java IDL allows for integration
with other languages. Java IDL also allows for distributed
objects to leverage CORBA’s full range of services. J2EE is
thus fully compatible with CORBA, completing the Java 2
Platform, Enterprise Edition.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Co-tech: access to Back-ends
J0
14
Java Database Connectivity (JDBC). JDBC is an API for
accessing relational databases. The value of JDBC is that
you can access any relational database using the same API.
Java Transaction API (JTA) Java Transaction Service
(JTS). The JTA and JTS specifications allow for components
to be bolstered with reliable transaction support.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Co-Tech: access to legacy/proprietary systems
J0
15
J2EE Connector Architecture (JCA).
Connectors allow you to access existing enterprise
information systems from a J2EE deployment. This could
include any existing system, such as a mainframe systems
running highend transactions (such as those deployed with
IBM’s CICS or BEA’s TUXEDO), Enterprise Resource
Planning (ERP) systems, or your own proprietary
systems. Connectors are useful because they automatically
manage
the details of middleware navigation to existing systems, such
as
handling transaction and security concerns. Another value of
the JCA is that you can write a driver to access an existing
system once, and then deploy that driver into any J2EE-
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Co-Tech: general communication
J0
16
Java Messaging Service (JMS). JMS allows for your J2EE
deployment to communicate using messaging. You can use
messaging to communicate within your J2EE system as well
as outside your J2EE system. For example, you can connect
to existing message-oriented middleware (MOM) systems
such as IBM MQSeries or Microsoft Message Queue
(MSMQ). Messaging is
an alternative paradigm to RMI-IIOP, and has its advantages
and disadvantages.
JavaMail. The JavaMail service allows you to send email
messages in a platform-independent, protocol-independent
manner from your Java programs.
Note that JavaMail depends on the JavaBeans Activation
Framework (JAF), which makes JAF part of J2EE as well.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Co-tech: general services
J0
17
Java Naming and Directory Interface (JNDI). JNDI is used
to access naming and directory systems. You use JNDI from
your application code for a variety of purposes, such as
connecting to EJB components or other resources across the
network, or accessing user data stored in a naming service
such as LDAP, Microsoft Exchange or Lotus Notes.
The Java Authentication and Authorization Service
(JAAS). JAAS is a standard API for performing securityrelated operations in J2EE. Conceptually, JAAS also enables
you to plug in a security system to a J2EE deployment.
“Basi di Dati Web e Distribuite” – Laurea Specialistica in Informatica – Università di Trento
Marco Ronchetti - [email protected] 
Collaborating technologies: XML
J0
18
The Java API for XML Parsing (JAXP). There are many
applications of XML in a J2EE deployment. For example, you
might need to parse XML if you are performing B2B
interactions (such as through Web services), if you are
accessing legacy systems and mapping data to and from
XML, or if you are persisting XML documents to a database.
JAXP is the de facto standard API for parsing XML
documents in a J2EE deployment and is an implementationneutral interface to XML parsers (SAX, DOM…).
Scarica