Skip to main content

The J2EE(TM) 1.4 Tutorial

Popularity Report

Total Popularity Score: 0

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Rank

Related Lists

Bookmark History

Saved by 36 people (-26 private), first by anonymouse user on 2006-03-02


Public Comment

on 2006-10-25 by slackorama

Sun's J2EE 1.4 tutorial

Public Sticky notes

Security The J2EE application programming model insulates developers from mechanism-specific implementation details of application security. The J2EE platform provides this insulation in a way that enhances the portability of applications, allowing them to be deployed in diverse security environments. Some of the material in this chapter assumes that you understand basic security concepts. To learn more about these concepts, we recommend that you explore http://java.sun.com/j2se/1.5.0/docs/guide/security/index.html before you begin this chapter. If you need to make changes to the Sun Java System Application Server 8, and have administrator privileges, read the Application Server's Administration Guide. If you are a developer who wants to add security to existing J2EE and web services applications, you are in the right place.

Highlighted by bvbhavsar

Security The J2EE application programming model insulates developers from mechanism-specific implementation details of application security. The J2EE platform provides this insulation in a way that enhances the portability of applications, allowing them to be deployed in diverse security environments. Some of the material in this chapter assumes that you understand basic security concepts. To learn more about these concepts, we recommend that you explore http://java.sun.com/j2se/1.5.0/docs/guide/security/index.html before you begin this chapter. If you need to make changes to the Sun Java System Application Server 8, and have administrator privileges, read the Application Server's Administration Guide. If you are a developer who wants to add security to existing J2EE and web services applications, you are in the right place.

Highlighted by bvbhavsar

Security The J2EE application programming model insulates developers from mechanism-specific implementation details of application security. The J2EE platform provides this insulation in a way that enhances the portability of applications, allowing them to be deployed in diverse security environments. Some of the material in this chapter assumes that you understand basic security concepts. To learn more about these concepts, we recommend that you explore http://java.sun.com/j2se/1.5.0/docs/guide/security/index.html before you begin this chapter. If you need to make changes to the Sun Java System Application Server 8, and have administrator privileges, read the Application Server's Administration Guide. If you are a developer who wants to add security to existing J2EE and web services applications, you are in the right place.

Highlighted by bvbhavsar

messaging system that implements the JMS interfaces and provides administrative and control features

Highlighted by atinsood

Messaging enables distributed communication that is loosely coupled. A component sends a message to a destination, and the recipient can retrieve the message from the destination.

Highlighted by atinsood

However, the sender and the receiver do not have to be available at the same time in order to communicate.

Highlighted by atinsood

JMS clients are the programs or components, written in the Java programming language, that produce and consume messages

Highlighted by atinsood

The sender and the receiver need to know only which message format and which destination to use. In this respect, messaging differs from tightly coupled technologies, such as Remote Method Invocation (RMI), which require an application to know a remote application's methods.

Highlighted by atinsood

Messages are the objects that communicate information between JMS clients.

Highlighted by atinsood

Administered objects are preconfigured JMS objects created by an administrator for the use of clients.

Highlighted by atinsood

destinations and connection factories

Highlighted by atinsood

dministrative tools allow you to bind destinations and connection factories into a JNDI namespace

Highlighted by atinsood

hrough the JMS provider.

Highlighted by atinsood

Figure 1-6 EAR File Structure

A J2EE module consists of one or more J2EE components for the same container type and one component deployment descriptor of that type. An enterprise bean module deployment descriptor, for example, declares transaction attributes and security authorizations for an enterprise bean. A J2EE module without an application deployment descriptor can be deployed as a stand-alone module. The four types of J2EE modules are as follows:

  • EJB modules, which contain class files for enterprise beans and an EJB deployment descriptor. EJB modules are packaged as JAR files with a .jar extension.
  • Web modules, which contain servlet class files, JSP files, supporting class files, GIF and HTML files, and a web application deployment descriptor. Web modules are packaged as JAR files with a .war (web archive) extension.
  • Application client modules, which contain class files and an application client deployment descriptor. Application client modules are packaged as JAR files with a .jar extension.
  • Resource adapter modules, which contain all Java interfaces, classes, native libraries, and other documentation, along with the resource adapter deployment descriptor. Together, these implement the Connector architecture (see J2EE Connector Architecture) for a particular EIS. Resource adapter modules are packaged as JAR files with an .rar (resource adapter archive) extension.

Highlighted by jiteshgangwani

llow programs written in the Java programming language to communicate with other messaging implementations.

Highlighted by atinsood

-destinations and connection factories

Highlighted by atinsood

Asynchronous

Highlighted by atinsood

Reliable

Highlighted by atinsood

point-to-point or the publish/subscribe approach to messaging.

Highlighted by atinsood

A stand-alone JMS provider can implement one or both domains

Highlighted by atinsood

A J2EE provider must implement both domains.

Highlighted by atinsood

some JMS clients combine the use of both domains in a single application. In this way, the JMS API has extended the power and flexibility of messaging products.

Highlighted by atinsood

factory encapsulates a set of connection configuration parameters that has been defined by an administrator

Highlighted by atinsood

It provides common interfaces that enable you to use the JMS API in a way that is not specific to either domain.

Highlighted by atinsood

The provider wants the components not to depend on information about other components' interfaces, so that components can be easily replaced

Highlighted by atinsood

Each connection factory is an instance of the ConnectionFactory, QueueConnectionFactory, or TopicConnectionFactory interface

Highlighted by atinsood

The provider wants the application to run whether or not all components are up and running simultaneously.

Highlighted by atinsood

The application business model allows a component to send information to another and to continue to operate without receiving an immediate response.

Highlighted by atinsood

message queues, senders, and receivers.

Highlighted by atinsood

Each message is addressed to a specific queue, and receiving clients extract messages from the queues established to hold their messages

Highlighted by atinsood

Queues retain all messages sent to them until the messages are consumed or until the messages expire.

Highlighted by atinsood

In the PTP messaging domain, destinations are called queues. In the pub/sub messaging domain, destinations are called topics.

Highlighted by atinsood

Each message has only one consumer.

Highlighted by atinsood

You create a JMS destination resource that specifies the JNDI name of the destination. You also create a physical destination to which the JNDI name refers.

Highlighted by atinsood

A sender and a receiver of a message have no timing dependencies. The receiver can fetch the message whether or not it was running when the client sent the message.

Highlighted by atinsood

The receiver acknowledges the successful processing of a message

Highlighted by atinsood

when every message you send must be processed successfully by one consumer.

Highlighted by atinsood

A JMS application can use multiple queues or topics (or both).

Highlighted by atinsood

Unlike connection factories, destinations are specific to one domain or the other.

Highlighted by atinsood

clients address messages to a topic, which functions somewhat like a bulletin board

Highlighted by atinsood

Topics retain messages only as long as it takes to distribute them to current subscribers.

Highlighted by atinsood

Each message can have multiple consumers.

Highlighted by atinsood

Publishers and subscribers have a timing dependency. A client that subscribes to a topic can consume only messages published after the client has created a subscription, and the subscriber must continue to be active in order for it to consume messages

Highlighted by atinsood

You use a connection to create one or more sessions.

Highlighted by atinsood

. Closing a connection also closes its sessions and their message producers and message consumers.

Highlighted by atinsood

Before your application can consume messages, you must call the connection's start method; for details, see Message Consumers. If you want to stop message delivery temporarily without closing the connection, you call the stop method.

Highlighted by atinsood

You use sessions to create message producers, message consumers, and messages. Sessions serialize the execution of message listeners;

Highlighted by atinsood

single-threaded context f

Highlighted by atinsood

the second means that the session automatically acknowledges messages when they have been received successfully.

Highlighted by atinsood

created by a session

Highlighted by atinsood

used for sending messages to a destination.

Highlighted by atinsood

reate an unidentified producer by specifying null as the argument to createProducer

Highlighted by atinsood

f you created an unidentified producer, use an overloaded send method that specifies the destination as the first parameter. For example:

Highlighted by atinsood

created by a session and used for receiving messages sent to a destination.

Highlighted by atinsood

ession.createDurableSubscriber

Highlighted by atinsood

is method is valid only if you are using a topi

Highlighted by atinsood

You can use the close method for a MessageConsumer to make the message consumer inactive.

Highlighted by atinsood

Message delivery does not begin until you start the connection you created by calling its start method. (Remember always to call the start method; forgetting to start the connection is one of the most common JMS programming errors

Highlighted by atinsood

o consume a message asynchronously, you use a message listen

Highlighted by atinsood

cts as an asynchronous event handler for messag

Highlighted by atinsood

plements the MessageListener interface,

Highlighted by atinsood

ou define the actions to be taken when a message arrives.

Highlighted by atinsood

egister the message listener with a specific MessageConsumer by using the setMessageListener method.

Highlighted by atinsood

egister the message listener, you call the start method on the Connection to begin message delivery. (If you call start before you register the message listener, you are likely to miss messages.)

Highlighted by atinsood

onMessage method takes one argument of type Message, which your implementation of the method can cast to any of the other message types

Highlighted by atinsood

Your onMessage method should handle all exceptions. It must not throw checked exceptions, and throwing a RuntimeException is considered a programming error

Highlighted by atinsood

At any time, only one of the session's message listeners is running.

Highlighted by atinsood

allows a message consumer to specify the messages it is interested in

Highlighted by atinsood

work of filtering messages to the JMS provider rather than to the application

Highlighted by atinsood

MS message has three parts: a header, properties, and a body

Highlighted by atinsood

redefined fields that contain values that both clients and providers use to identify and to route messages

Highlighted by atinsood