This section covers the following:
- Chapter, Remoting and web services using spring-using spring for remote and Web service
- Chapter, Enterprise JavaBeans (EJB) Integration -EJB integration
- Chapter, JMS (Java Message Service)--JMS (Java messaging Services)
- Chapter, JMX
- Chapter, JCA CCI
- Chapter, Email
- Chapter, task execution and scheduling --mission execution and scheduled tasks
- Chapter, dynamic language support
- Chapter, Cache Abstraction --caching abstraction
Introduction to remote and Web services using spring
Spring's remote support can be used in a variety of technologies. This remote support simplifies the development of those remote services enabled and is implemented by your spring POJOs.
Currently, spring supports the following remote technologies:
- Remote Method Invocation (RMI). Although the
Rmiproxyfactorybean
and rmiserviceexporter
used with spring support are traditional RMI (using the java.rmi.Remote
interface and java.rmi.RemoteException
) and transparently remotely via RMI Invokers (using any Java interface). The HTTP invoker of the
- spring. Spring provides a special remote policy-allowing Java serialization over HTTP to support any Java interface (like RMI invoker). The corresponding support classes are
Httpinvokerproxyfactorybean
and httpinvokerserviceexporter
.
- Hessian. By using Spring's
Hessianproxyfactorybean
and hessianserviceexporter
, you can transparently expose your service- Use the lightweight, binary, HTTP-based protocol provided by Caucho.
- Burlap. Burlap is an XML-based Hessian alternative to Caucho. Spring provides support classes such as
Burlapproxyfactorybean
and burlapserviceexporter
.
- Jax-ws. Spring provides remote support for Web services-via JAX-WS (which is a JAX-RPC successor, introduced by Java EE 5 and Java 6).
- JMS. Remote using JMS as the underlying protocol, provided by the
Jmsinvokerserviceexporter
and jmsinvokerproxyfactorybean
classes.
- AMQP. Use AMQP as the underlying protocol for remote, supported by the Spring AMQP project.
Enterprise JavaBeans (EJB) Integration Introduction
As a lightweight container, spring is often considered a substitute for ejbs. We think spring as a container for many applications and usage scenarios, combined with its rich support capabilities, is a better choice in the areas of things, ORM, and JDBC access.
However, it must be noted that using spring does not prevent you from using EJBS. In fact, spring makes it easier to access EJBS and implement EJBS and its functions.
In this chapter, we'll look at how spring can help you access and implement EJBS. Spring provides a special value--when accessing the stateless session beans (SLSBS), so we'll start with the discussion.
Introduction to JMS (Java Message Service)
Spring provides a JMS integration framework that simplifies the use of the JMS API-similar to what spring integration does for the JDBC API.
JMS can be roughly categorized into two functional areas, namely production (production) and consumption (consumption) of messages. JmsTemplate
class is used for message production and for synchronous message reception. For asynchronous reception, message-driven bean style,spring, similar to Java EE, provides a large number of message listener containers for creating message-driven POJOs (MDPs). Spring also provides a way to declaratively create a message listener.
org.springframework.jms.core
The package provides the core functionality of using JMS. It contains the JMS template classes, simplifies the use of JMS, creates and frees resources by processing, and is very similar to what JdbcTemplate
is done for JDBC. The design idea is that the spring template provides helper methods to perform common operations, and for more complex use, delegate the callback interface to the user implementation. The JMS template is the same design. These classes provide different convenient ways to send messages, synchronize consumer messages, and expose JMS sessions and message producers to users.
org.springframework.jms.support
The package provides JMSException
translation functionality. The translation transforms the checked JMSException
hierarchy into a mirrored unchecked exceptions level. If there is a provider-exclusive javax.jms.JMSException
subclass, the exception is encapsulated to unchecked UncategorizedJmsException
.
org.springframework.jms.support.converter
The package provides MessageConverter
abstraction-for conversion between Java objects and JMS messages.
org.springframework.jms.support.destination
Packages provide different strategies for managing JMS destinations, such as providing a service locator or destinations in a stored jndi.
org.springframework.jms.annotation
The package provides the necessary facilities to support the note-driven listener endpoint-using @jmslistener.
org.springframework.jms.config
The package provides the resolver implementation of the JMS namespace, as well as Java Config support to configure the listener container and create listener endpoints.
Finally, the org.springframework.jms.connection
package provides an ConnectionFactory的
implementation that is suitable for standalone applications. It also contains the spring PlatformTransactionManager的用于JMS的
implementation (name is JmsTransactionManager
). This allows JMS to be seamlessly integrated into spring's transaction management mechanism as a transactional resource.
JMX Introduction
Spring provides JMX support that allows you to easily and transparently integrate your spring applications into the JMX facility.
What is JMX?
This chapter is not an introduction to JMX ... It does not attempt to explain why someone needs to use JMX. If you do not know, you can refer to the resources at the end of this chapter. Section 31.8, "further Resources"
In particular, spring's JMX support provides 4 core features:
Automatically registers any spring bean as a jmx MBean.
Elastic mechanism to control the management interface of your beans.
The Mbeans is declared by the remote, JSR-160 connectors.
A simple proxy for local and remote Mbeans resources.
These features are used to decouple your application components from the spring or JMX interfaces and classes. In fact, for your application, most do not need to be aware of spring or JMX to be able to use spring's JMX functionality.
JCA CCI Introduction
Java EE provides a specification to standardize access to enterprise information Systems (EIS): JCA (Java ee Connector Architecture). The specification is divided into several different parts:
SPI (Service provider interfaces),
CCI (Common Client Interface),
Official Documentation Links:
Http://docs.spring.io/spring/docs/current/spring-framework-reference/html/spring-integration.html
Spring 4 Official documentation Learn about the integration of spring and Java EE technology