Java concurrency architecture and java Architecture

Source: Internet
Author: User

Java concurrency architecture and java Architecture

  • Concurrent Programming
    • Thread Communication
      • Shared Memory and message passing
    • Thread Synchronization
      • Control the execution sequence of different threads
  • Java concurrency
    • Based on the shared memory model
    • Command Re-sorting
      • Compiler re-sorting
      • Processor re-sorting
        • Cpu re-sorting
        • Write cache area (cache, register)
    • Memory barrier
    • Order consistency and Happens-before
    • Execution result orderliness
      • Volatile
        • Solve memory visibility problems
      • Lock
        • Lock display lock
          • Resumable
          • Timed
      • Synchronize built-in lock
        • Underlying operating system
        • Non-disruptive
      • Atomic variable
      • Final principles

References

Foreign: http://gee.cs.oswego.edu/dl/jmm/cookbook.html

Http://www.cs.umd.edu /~ API/java/memoryModel/jsr-133-faq.html.

Http://www.cs.umd.edu /~ API/java/memoryModel/

China

Http://ifeve.com/java-memory-model-0/

Http://www.infoq.com/cn/articles/memory_barriers_jvm_concurrency


Architecture in Java EE

1. Java EE
Java EE is a set of specifications for designing, developing, compiling, and deploying enterprise-level applications.
Multi-layered WEB applications;
Supports Distributed Computing Application Models;
Takes server computing as the core;
Based on primary key development and loose coupling;
Supports security transactions, Server Load balancer, and concurrent processing of Stream 1.
2. Java EE Architecture
It is usually divided into four layers of Architecture (customer layer, presentation/WEB layer, business layer, data layer)
Customer layer presentation layer (WEB layer) business layer data layer
IE servlet ejb DB
Jsp javabean (generic)
3. Java EE Component Technology
(1) JDBC (java Database Connectivity) Database System
(2) JNDI (java Name and Directory Interface) java Naming and Directory Interface
(3) JSP (java server Pages) is to add the VB Script or jiavaScript code on the server to the HTML file to form the dynamic web page technology.
(4) Servlet: servlet was launched by Sun Microsystems in 1997. It uses java programs to implement dynamic web page technology.
(5) EJB (Enterprise JavaBean) EJB is an Enterprise-level javaBean
(6) RMI (Remote Method Invoke) RMI is a Remote Method call.
(7) IDL (java Interface Defiation Language) IDL is the Interface Definition Language
(8) XML (Extensible Markup Language) is a Language that can be used to define other Markup languages. It is used to share data in different business processes.
(9) JMS (java Message Service) JMS is a java Message Service. It is an application interface (API) used to communicate with Message-oriented middleware)
(10) Java transaction API (JTA) and java Transaction Service (JTS) are used to keep the system in a consistent state.
(11) JavaMail: supports POP3 and SMTP services and IMAP servers.
4. Java EE Product Introduction
Tomcat (web Server), Weblogic (J2EE server), Websphere (J2EE server ),
Sun One Application (J2EE server), Oracle9iAS (J2EE server), JBoss (open-source EJB server)
5. Web application access process
A. It is the request/response process.
B. If the client has a request, the server will respond to the client. If there is no request, the server will not respond.
For example, communication between the client and the server: 1. First start the server (in MyEclipse)
2. Start the browser
3. enter 127.0.0.1: 8088/index. doa. The web. xml file must be in the WEB-INF directory.
B. Create a jsp file in the parent directory of the WEB-INF. C. Create your own DAO layer, SERVICE layer, MODEL, and ACTION under src, and then proceed to the rest of the text of st...>
 
Java features, implementation mechanism and architecture

Any object in can be viewed as an object. Objects interact with each other through messages. In addition, any entity in the real world can belong to a certain kind of things, and any object is an instance of a certain kind of things. If the traditional procedural programming language is process-centric and algorithm-driven, the object-oriented programming language is object-centric and message-driven. The formula indicates that the procedural programming language is program = Algorithm + data, and the object-oriented programming language is program = Object + message. All object-oriented programming languages support three concepts: encapsulation, polymorphism, and inheritance, and Java is no exception. Objects in the real world have attributes and behaviors mapped to computer programs. properties represent the data of objects and actions represent the methods of objects (which are used to process data or interact with the outside world ). The so-called encapsulation is to use an autonomous framework to combine object data and methods to form a whole. It can be said that objects are the means to support encapsulation and the basic unit of encapsulation. Java is highly encapsulated Because Java does not have full variables or primary functions. In Java, most of the members are objects, except for simple numeric, character, and Boolean types. For these types, Java also provides the corresponding object types for interaction with other objects.

Portability: The program made on this system can be transplanted to other systems for interpretation and execution after a compilation, as long as it is simply pasted and copied, without affecting the effect of the program.

Security: Most Java (TM) programs running on iSeries servers are applications rather than applets, so the sandbox security model has no limits on them. From the security perspective, Java applications are subject to the same security restrictions as any other program on the iSeries server. To run Java programs on the iSeries server, you must have permissions on class files in the integrated file system. Once the program is started, it runs under the user permission control. You can use the following permissions to access objects with the permissions of the user running the program and the permissions of the owner of the program. Grant temporary permissions to users for objects that are not authorized to access.

Concurrency: JAVA supports multithreading technology, which is a mechanism for parallel threads. multithreading is an important method of Java and is particularly conducive to implementing concurrent tasks in programs. java provides Thread classes to implement multi-threaded concurrency. however, concurrent execution of a program will inevitably lead to the situation where multiple threads are mutually exclusive to access critical resources. Therefore, the key to the solution of the concurrent system is the management and allocation of critical resources, there are two considerations for critical resource allocation: security and fairness. this paper first discusses the security and fairness of multi-threaded concurrent systems, and points out the importance of security and fairness when accessing critical resources in a concurrent system. this problem is further explained by using the example of a single-line train tunnel to demonstrate the driving conditions under various conditions.

Visualization: it is hard to say that a program like vb is also a visual program.
I have borrowed some answers from my friends and found some answers by myself, hoping to help you.

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.