Академический Документы
Профессиональный Документы
Культура Документы
Java EE is a specification. As with other Java Community Process specifications, providers must
meet certain conformance requirements in order to declare their products as Java EE compliant.
Java EE includes several API specifications, such as RMI, e-mail, JMS, web services, XML, etc.,
and defines how to coordinate them. Java EE also features some specifications unique to Java
EE for components. These include Enterprise JavaBeans, connectors, servlets, JavaServer
Pages and several web service technologies. This allows developers to create enterprise
applications that are portable and scalable, and that integrate with legacy technologies. A Java
EE application server can handle transactions, security, scalability, concurrency and
management of the components it is deploying, in order to enable developers to concentrate
more on the business logic of the components rather than on infrastructure and integration tasks.
What is EJB???
EJB (Enterprise Java Beans) is a server-side model
that encapsulates the business logic of an application.
That is why we deploy all the EJBs in deploy folder in JBOSS
application server.
Advantages of EJB ??
For several reasons, enterprise beans simplify the development of large,
distributed applications. First, because the EJB container provides
system-level services to enterprise beans, the bean developer can
concentrate on solving business problems. The EJB container, rather
than the bean developer, is responsible for system-level services, such
as transaction management and security authorization.
Annotation used with Beans:@ Stateless is used to specify component-defining annotation for a
stateless session bean.
So when to use stateless or stateful?
That mainly depends on whether you want to maintain the conversational state. For example if
you have a method that adds up to numbers and return the result you use a stateless bean
because its a one time operation. If you call this method a second time with other numbers you
are not interested in the result of the previous addition anymore.
But if you want for example count the number of requests a client has done, you have to use a
stateful bean. In this scenario it is important to know how often the client has requested the bean
method before, so you have to maintain conversational state in the bean (e.g. with a variable). If
you would use a stateless bean here the request of the client would be served each time from a
different bean what messes up your results.
3) Entity Bean
Entity beans are objects, and they can be designed using objectoriented principles and used in applications as objects. The data in these
entity bean objects are persisted in some data store, usually relational
databases.
Annotation used with Entities:@Table annotation is used to specify the table to persist the data.
@Column is used to specify a mapped column for a persistent property
or field.
@Id is used to specify the primary key of an entity.
JBOSS Application server
JBOSS internally uses Hibernate as its ORM tool. Hibernate's primary
feature is mapping from Java classes to database tables (and from Java
data types to SQL data types). Hibernate also provides data query and
retrieval facilities. It generates SQL calls and relieves the developer from
manual result set handling and object conversion. Applications using
Hibernate are portable to supported SQL databases with little
performance overhead.
description
Each module element contains an ejb , web or java element which describes the individual
modules within the application.