Please enable JavaScript.
Coggle requires JavaScript to display documents.
Programming Frameworks: JEE - Coggle Diagram
Programming Frameworks: JEE
APIs inside JEE
EJB
: Business logic and connections between various JEE APIs
JPA
: DB connectivity
JMS
: Message protocols, communications between apps
JTA
: Transactions
JEE Implementation
JEE Architecture
UN component per ogni tier tranne che per la EIS tier che è la db tier
Client tier
Components
: Applet, Application Client, Web Client (thin client)
Containers
: Applet container, Application client container, (Java enabled browser)
Applet
Applet Container
Environments that runs Java Applet
It follows these steps:
Init
Start
Stop
Destroy
It provides secure Applet execution
Applet Component
Smal clients written in java
Integrated as part of a web page
Executed on a web browser (or via applet-viewer)
Require java-plugin enabled in the browser and a proper security policy file
Application
Application Client Component
Run on the client machine
Used when GUI is rich
Interacts directly with the business tier
The application platform allows to build a more complex and powerful client
Application Client Container
Manages security
Communicate with application server
Web Client
Web Client Component
Dynamically web pages generated by web components
A web Browser renders pages received by the server
The web client simplifies the distribution, deployment, and update of the system
Handles transaction management
Web Tier
Components
: JavaServer Pages, JavaServer, Servlets
Containers
: Web Container
Web Container
It is the interface between web components and the web server
◆ Servlet
It is a java class, used to extends the capabilities of servers, and lets applications and server communicate via of a request-response model
Java Servlet Technology defines HTTP-specific servlet classes (HttpServlet)
Servlets support multithreading and concurrent managing of request
Or the send data OR they receive data. They are like server functions. They interoperate with the beans and are called by the web server upon an HTTP request with particular messages inside.
◆ JSP Pages
A JSP page is a text document that contains two types of data: static data (which can be written as HTML, SVG, XML,..) and dynamic data create by JSP elements
They execute as Servlets so it enables request and response
They are used for forms and they are sent and receives by two different servlets
Business Tier
Enterprise JavaBeans
server-side component that encapsulates business logic
◆ Session bean
Performs a task for a client, optionally, may implement a web service.
Stateful Bean (previous messages have an impact on new ones through vars, there is a convo between server and client)
Stateless bean (there is not prior knowledge of a conversation between server and client) it can't memorize anything unless it saves the info in db
Singleton session beans (like stateless but valid for the whole app, it is opened once and destroyed once)
They call function on entities to update the DB and instantiate new entities
Message driven bean
Acts as a listeners for particular messaging types, such as the java message service API
EJB Container
Acts as a intermediary between the user-written business logic within the bean and the rest of the application server enviroment
Platform Basics
Injection mechanism
Resource Injection
To provide certain resources to objects that don't have it. It uses annotations
(@Resource
) to mark fields or methods as injection points. You can refer to instances via the JNDI (Java Names and Directory Interface) (It's like a path)
Dependency Injection
It injects real instantiations of objects via
Inject
Resource Management
To optimize the system
instance Pooling
Shares the instance of an object to various objects for example Database Connection Pooling which allows less independent single connections
Passivation/Activation
Used for stateful widget when they are idle. They get passivated and moved to secondary storage. When needed again they are moved back to main memory and being activated
JEE APIS
Java Messaging Service JMS
Point to point messaging
Messages are sent to a queue
Publish/Subscribe Messaging
Subscribers subscribe on a topic and then there are publishers that publish messages about a topic
Java Persistence API JPA
Interaction with the DB
Transforms tuples into data objects automatically