.net人员用Java 之Java EE

简介: 上篇文章对Java的基本概念作了简要总结(http://www.cnblogs.com/2018/archive/2011/04/05/1993163.html),本文把对java EE的学习过程总结一下。

上篇文章对Java的基本概念作了简要总结(http://www.cnblogs.com/2018/archive/2011/04/05/1993163.html),本文把对java EE的学习过程总结一下。

基础

https://javaeetutorial.dev.java.net/files/documents/7232/141115/javaeetutorial6.zip

这个里面有介绍文档和例子代码,这些例子在netbeans可直接打开,参考文档部署和运行

这个文档介绍了整个Java EE的基本概念和示范例子,熟悉这个基本对Java EE的概念就比较了解了。

Java EE的基本概念

实际的开发中,只要理解了下面的几个图表和规范,只要针对具体的规范和标准进行学习即可。因为本身Java EE规范范围很大,我们实际中用的只是其中的部分。

【以下是做的一些图书资料记录,我认为很重要】

Java EE is based on standards.

Containers are Java EE runtime environments that provide certain services to the components they host such as life-cycle management, dependency injection, and so on. These components use well-defined contracts to communicate with the Java EE infrastructure and with the other components.

 

containers

Applet containers are provided by most web browsers to execute applet components. When you develop applets, you can concentrate on the visual aspect of the application while the container givesou a secure environment. The applet container uses a sandbox security model where code executed inhe “sandbox” is not allowed to “play outside the sandbox.” This means that the container prevents anyode downloaded to your local computer from accessing local system resources, such as processes oriles.

The application client container (ACC) includes a set of Java classes, libraries, and other files required to bring injection, security management, and naming service to Java SE applications (Swing,atch processing, or just a class with a main() method). ACC communicates with the EJB container usingRMI-IIOP and the web container with HTTP (e.g., for web services).

The web container provides the underlying services for managing and executing web componentsservlets, EJBs Lite, JSPs, filters, listeners, JSF pages, and web services). It is responsible for instantiating,nitializing, and invoking servlets and supporting the HTTP and HTTPS protocols. It is the containersed to feed web pages to client browsers.

The EJB container is responsible for managing the execution of the enterprise beans containing theusiness logic tier of your Java EE application. It creates new instances of EJBs, manages their life cycle, and provides services such as transaction, security, concurrency, distribution, naming service, or theossibility to be invoked asynchronously.

image

Services

Containers provide underlying services to their deployed components.

Java Transaction API (JTA): This service offers a transaction demarcation API usedby the container and the application. It also provides an interface between thetransaction manager and a resource manager at the Service Provider Interface(SPI) level.

Java Persistence API (JPA): Standard API for object-relational mapping (ORM). With its Java Persistence Query Language (JPQL), you can query objects stored in the underlying database.

Validation: Bean Validation provides a class level constraint declaration and validation facility.

Java Message Service (JMS): This allows components to communicate asynchronously through messages. It supports reliable point-to-point (P2P) messaging as well as the publish-subscribe (pub-sub) model.

Java Naming and Directory Interface (JNDI): This API, included in Java SE, is used to access naming and directory systems. Your application uses it to associate (bind) names to objects and then to find these objects (lookup) in a directory. You can look up datasources, JMS factories, EJBs, and other resources. Omnipresent in your code until J2EE 1.4, JNDI is used in a more transparent way through injection.

JavaMail: Many applications require the ability to send e-mails, which can be implemented through use of the JavaMail API.

JavaBeans Activation Framework (JAF): The JAF API, included in Java SE, provides a framework for handling data in different MIME types. It is used by JavaMail.

XML processing: Most Java EE components can be deployed with optional XML deployment descriptors, and applications often have to manipulate XML documents. The Java API for XML Processing (JAXP) provides support for parsing documents with SAX and DOM APIs, as well as for XSLT. The Streaming API for XML (StAX) provides a pull-parsing API for XML.

• Java EE Connector Architecture (JCA): Connectors allow you to access EIS from a Java EE component. These could be databases, mainframes, or Enterprise Resource Planning (ERP) programs.

• Security services: Java Authentication and Authorization Service (JAAS) enables services to authenticate and enforce access controls upon users. The Java Authorization Service Provider Contract for Containers (JACC) defines a contract between a Java EE application server and an authorization service provider, allowing custom authorization service providers to be plugged into any Java EE product.

• Web services: Java EE provides support for SOAP and RESTful web services. The Java API for XML Web Services (JAX-WS), replacing the Java API for XML-based RPC (JAX-RPC), provides support for web services using the SOAP/HTTP protocol. The Java API for RESTful Web Services (JAX-RS) provides support for web services using the REST style.

• Dependency injection: Since Java EE 5, some resources (datasources, JMS factories, persistence units, EJBs…) can be injected in managed components. Java EE 6 goes further by using CDI (Context and Dependency Injection) as well as the DI (Dependency Injection for Java) specifications.

• Management: Java EE defines APIs for managing containers and servers using a special management enterprise bean. The Java Management Extensions (JMX) API is also used to provide some management support.

• Deployment: The Java EE Deployment Specification defines a contract between deployment tools and Java EE products to standardize application deployment.

clip_image002

image

参考资料

Java EE 6规范中文版.chm

Java+EE+6+API+Specifications.CHM

javadocee6.zip

servlet-2_3-fcs-docs.zip

javaeetutorial6.zip[The Java EE 6Tutorial]

The Java EE 6 Tutorial Basic Concepts, 4th Edition

Beginning Java EE 6 with GlassFish 3, 2nd Edition

这些资料在网上都可以找到

例子实战

http://netbeans.org/kb/docs/javaee/ecommerce/design.html

很实用的一个例子,覆盖了多个方面的内容,理解了这个基本对如何实施一个Java EE的项目就有一个比较清晰的概念了。

Java EE发展了十几年,相关的资料和开源框架等浩如烟海,我们只要把握这些基础的概念,然后结合相应的实例学习和开发改造,在项目中就可以顺利应用了。

相关文章
|
18天前
|
Java C# 开发者
【干货】Java开发者快速上手.NET指南
【干货】Java开发者快速上手.NET指南
|
3月前
|
网络协议 Java Linux
Java 异常 java.net.UnknownHostException 的原因和解决方案
Java 异常 java.net.UnknownHostException 的原因和解决方案
528 0
|
4月前
|
Java API
Java基础知识:什么是Java平台,包括Java SE,Java EE和Java ME?
Java基础知识:什么是Java平台,包括Java SE,Java EE和Java ME?
53 2
|
1月前
|
分布式计算 安全 Java
Java的三大体系架构:深入剖析Java的三大体系架构,包括Java SE、Java ME和Java EE等
Java的三大体系架构:深入剖析Java的三大体系架构,包括Java SE、Java ME和Java EE等
45 1
|
6月前
|
Java
已解决Java.net.MalformedURLException异常的有效方法java.net.MalformedURLException: no protocol异常处理
已解决Java.net.MalformedURLException异常的有效方法java.net.MalformedURLException: no protocol异常处理
359 0
|
6月前
|
Oracle Java 关系型数据库
JAVA 那些事 - 聊聊那些易混淆的概念:JVM/JRE/JDK,openJDK/oracleJDK,JAVA SE/JAVA EE/Jakarta EE
JAVA 那些事 - 聊聊那些易混淆的概念:JVM/JRE/JDK,openJDK/oracleJDK,JAVA SE/JAVA EE/Jakarta EE
|
4月前
in thread “main“ java.lang.IllegalArgumentException:java.net.UnknownHostException:hadoop102
in thread “main“ java.lang.IllegalArgumentException:java.net.UnknownHostException:hadoop102
24 0
|
9月前
|
Java
JAVA 端口被占用 报错解决方案:java.net.BindException: Address already in use: bind
JAVA 端口被占用 报错解决方案:java.net.BindException: Address already in use: bind
121 0
|
9月前
|
开发框架 安全 网络协议
java基础 --- 浅谈Java SE、Java EE、Java ME三者的区别
java基础 --- 浅谈Java SE、Java EE、Java ME三者的区别
92 0
|
10月前
|
存储 安全 网络协议
JAVA EE十三大规范(1)RMI(全网最深入浅出)
1.概述 RPC: RPC(Remote Procedure Call),一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议,RPC可以用HTTP协议实现,并且用HTTP是建立在 TCP 之上最广泛使用的 RPC,但是互联网公司往往用自己的私有协议,比如鹅厂的JCE协议,私有协议不具备通用性但是相比于HTTP协议,RPC采用二进制字节码传输,更加高效也更加安全。 用一个比较形象的例子来形容,你老婆出去打麻将,然后想起家里洗衣机里的衣服还没洗,于是打电话给在家里的你,叫你把洗衣机里的衣服洗了,这就是远程过程调用。微服务中服务的调用底层就是使用的RPC机制。
104 0