Pluto Project Introduction (2)-Pluto Architecture

Source: Internet
Author: User

Pluto Architecture

Let's start with explaining the architecture and some basic concepts of Pluto. First, let's briefly explain how to run the portal of the Pluto reference implementation and see where the portal will find the Portlet container in the portal architecture. Next, we will detail the architecture of Pluto. Finally, we will explain how it solves a challenging problem of the Portlet container: the deployment of the Portlet.

Portal

Pluto is an implementation of A Portlet container that meets the Portlet API specifications. It provides a working platform for developers to run portlets. However, if there is no driver, that is, the portal, it will be very troublesome to run and test the Portlet container. Pluto itself also provides a simple portal module, which is written only to meet the needs of the Portlet container and JSR 168. If you need a mature portal, refer to the jetspeed project. The jetspeed project focuses on the portal itself, not the Portlet container.

Figure 1 shows the basic architecture of the portal. The portal web application processes customer requests, extracts portlets from the current page of the customer, and then calls the Portlet container to obtain the content of each Portlet. The portal accesses the Portlet container through the invoker API of the Portlet container. These APIs are the main call interfaces of the Portlet container. They provide some request-based methods for the portal to call the Portlet. Container user (Portal, Translator's noteThe Portlet iner provider SPI (Service Provider Interface) callback interface of the Portlet container must be implemented to provide portal-related information for the Portlet container. Finally, the Portlet container calls all portlets through the Portlet API.


 

Portlet container

The Portlet container is the runtime environment of portlets and is also the core component of every portal. The Portlet container needs to obtain some information about the portal itself, and some basic information about the portal must be reused.Code. Therefore, the Portlet container can ensure that it is completely separated from other portal components. That is to say, you can insert an independent Portlet container into any portal, as long as it can meet the requirements of the Portlet container, such as implementing all the SPI.

The invoker API (also called entry point) of the Portlet container is the main call interface of the Portlet container. These APIs include the Portlet container's lifecycle control method (Init (), destroy (), request-based call method (initpage (), publish mtitle (), portletservice (), and so on ). Since the Portlet container finally calls A Portlet, the signature of these methods is similar to the main Portlet interface of the Portlet API, except for an additional Portlet ID. The Portlet container can use this additional input Portlet ID parameter to determine which Portlet to call.

In addition to using the invoker API to call the Portlet container, the portal must also implement the SPI defined by the Portlet container. Therefore, the concept of "Container Service" is introduced for reference to implementation: Container Service is used to define some pluggable components that can be registered in the container. These components either provide some basic functions, or expand the container. Pluto defines the following built-in container services by reference to the implementation (the first four are required to run the Portlet container, and the fifth is optional ):

    • Information provider): Provides information about the portal and its Framework for the Portlet container. This interface can only obtain some known or existing information in the portal. This information includes URL generation with navigational state, Portlet context, Portlet mode, and window state control.
    • Factory Manager): Defines how to obtain an implementation through the factory (the general portal should have implemented such an interface ).
    • Log Service): Defines the log output method (the portal should have implemented such an interface ).
    • Config Service): Defines how to obtain the configuration value (the portal should have implemented such an interface ).
    • Property Manager (optional): This service allows the portal to obtain the attribute values defined in the JSR 168 specification.

Strictly speaking, the Portlet object model is also an SPI, but it is in a special position than other SPI. Therefore, we do not regard it as part of the container service because it processes all the Portlet objects and contains some mixed interfaces.

 Figure 2: Architecture of the Portlet container 

Deployment of Portlet

The Portlet container is built on the servlet container, so it can reuse many functions of the servlet container. To achieve this, the Portlet container must inject some servlet attributes into the war file of each Portlet application, as shown in 3. The deployment tool of the Portlet component injects a new or modified web. xml into the original war file, and injects a servlet package into each Portlet as a call point. The Portlet deployer then transmits the modified war file to the deployment server of the application server to deploy it to the system of the application server. When A Portlet is called, the Portlet container calls the injected servlet package and uses this as the entry point of the war file of the deployed Portlet.

 Figure 3: deployment of the Portlet in implementation 

Pluto and wsrp standards

The JSR 168 specification is highly consistent with the Web Service for remote portlets (wsrp) standard. Both of these standards have released the implementation of open source code, and their implementation has completed all the necessary functions defined in the corresponding specifications. Both standards share good collaboration with each other as their common goal. Therefore, wsrp portlets can run either as a consumer or as a producer in the Portlet container.

The Pluto project must support running multiple Portlet containers in one portal. Therefore, the Pluto Portlet container can be initialized multiple times. More importantly, it can run in different ways, and each Portlet container uses a different SPI implementation.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.