Thirty-minute learning WebGLogic6.1

zhaozj2021-02-16  93

WEBLOGIC 6.1 installation stateless sessionbean development data source settings JMS's use brief introduction

WebLogic 6.1 installation

The software you need: a file with a compressed package and a crack

Installation process:

1. Double-click the installation file to install WebLogic to D: / BEA

Select NO when you ask if you as a WINGDOW Server

The rest of the default

2. Follow the crack description, readme file, remove 30 days restrictions

3. Edit D: /Bea/wlser 15.1/config/mydomain/startweblogic.cmd

69 lines set WLS_PW = YourPassword

56 lines set copath =.; ./ lib / weblogic_sp.jar ;./ LIB / WebLogic.jar

It is the classpath used in WebGloic running.

Here you can join the desired class and path

73 line set startmode = true

Set mode true is Product mode

False is developments

This mode can automatically find and publish the Applications directory and EJB's JAR package in its subdirectories.

4. Start WebLogic in the menu

Start Default Console test service

No status sessionbean development

EJB is a service provided by WebLogic, using RMI

Calling process:

Client, find EJB server via URL

Find concrete EJB through JNDI

Send a request, get the return value (remote method invoking protocol)

The client gets a remote interface, and WebLogic provides services to the client through this interface.

EJB is released through the JAR package, contains EJB Class files and EJB description documents

Specific reference to the process of helloworld.jar

Where HelloHome creates a remote interface Hello, the client passes this interface

Call the corresponding method in Hellobean.

Among them, hellobean.class is only used in server-side

Hello and HelloHome Interface clients and servers must be used

Note WebLogic-Ejb-jar.xml com.helloWorld

COM.HELLOWORLD is used to mark EJB and join JNDI namespace

After preparing the EJB JAR package, copy to the Applications directory

Publish using the WebLogic console

Click the Domain / Deployments / EJB node in the left tree

Select "Install A New Ejb ..." on the right.

Operation according to the prompt

WebLogic 6.1's use of JDBC buffer pool

1. Set the Drive Class to WebLogic's ClassPath

Start WebLogic Open Console

2. Click the Domain / Servcies / JDBC / Connection Pools node in the tree

Configuration_general page

Name: myoraclepool (any name is ok!)

URL: JDBC

Racle: Thin: @serverip: 1521: SID

Driverclassname: Oracle.jdbc.driver.Oracledriver

Properties: user = YouruserName Password = Yourpassword

Then CLIKE The "create" Button

The pool is created.

3.configuration_connections page:

Initial Capacity: The number of initial connections after the buffer pool is created.

Maximum Capacity: The maximum number of connections.

Capacity Increment: When the connection is not enough, the number of connections (not more than maximum capacity) is created in the buffer pool. Login Delay Seconds: Allow delay time when creating a connection.

Refresh Period: When the Testing page is configured with TestTableName, if this cycle is not zero,

Each idle connection must be tested according to this cycle. If the connection is incorrect, turn it off and try to rebuild the connection.

Allow Shrinking: Buffer pool Press Capacity Increment to create a new connection,

If there is an idle connection, whether it is allowed to automatically delete the idle connection (until the INITIAL CAPACIT)

Shrink period: Delete the cycle of idle connection.

We can set it as follows:

Initial Capacity: 5

Maximum Capacity: 10

Capacity Increment: 1

Login delay seconds: 0

Refresh period: 0

Allow Shrinking: True

Shrink period: 15

When the configuration_general page is set, press the "Apply" button in the lower right corner to save the settings.

Target page: Server tied to the buffer pool

After the buffer pool is created, you can modify it, and the result of the modified result is only valid after restarting the WebLogic server.

You can delete and copy the buffer pool by right-click menu.

4. Set the data source

1. Click on the left tree on WebLogic console

Domain / servcies / JDBC / Data Sources node.

2. Select "Create A New JDBC Data Source ..." hyperlink to create a new data source.

Press the prompt operation.

Note: It is best to use TX Data Source --- TRANACTION process. Method.

5. Use data sources

With EJB, find the URL to find JNDI to get a connection

JMS Introduction

Message system

The message system allows reliably intellectual communication between the separate unpocked applications.

Class with the mail system.

There are usually two messages.

Publish / Subscribe

The publish / subscription message system supports an event-driven model, message generator, and user participating in the message.

Generator publishing an event, while the user subscribes to the incident of interest and uses an event.

Generator will connect messages and a specific topic (Topic), and the message system transmits the message to the user according to the interest of the user registered.

2. Point-to-PEER TO PEER

In the point-to-point message system, the message is distributed to a separate user.

It maintains an "enter" message queue. Message application sends a message to a specific queue, and the client gets the message JMS and EJB from a queue to the service provided by WebLogic. The client finds a JMS in the console through JNDI name, set a JNDI (Refer to the prompt, introduce the lead in front of the leader)

A typical JMS client is created by several basic steps below:

Create a connection to a message system provider (Connection)

Create a session for receiving and sending messages

Create MessageProducer and MessageConSumer to create and receive messages

When the above steps are completed, a message generator client will create and publish a message to a topic, (JNDI)

The message user client will receive a message related to a topic.

1. Create a Connection

A Connection provides access to the client to the underlying message system. And achieve resource allocation and management.

Create a Connection by using a ConnectionFactory, usually specified by JDNI: Connection Message = New InitialContext ();

TopicConnectionFactory TopicConnectionFactory = (TopicConnectionFactory);

Topic = (TOPIC) JNDICONTEXT.LOOKUP (TopicName);

TopicConnection = TopicConnectionFactory.createtopicConnection ();

2. Create a session

Session is a relatively large JMS object that provides a means of production and consumption messages.

Used to create a message user and message generator.

TopicSession = TopicConnection.createtopicSession (false, session.auto_acknowledge);

Two parameters are used to control transactions and messages confirmation.

3. Position a Topic

Use JDNI to locate a Topic, TOPIC is used to identify messages sent or received, in the publish / subscription system.

Subscribe subscribe to a given Topic, and the publisher will be connected to a Topic.

Here is to create a Topic "WeatherReport"

Topic Weathertopic = Messaging.lookup ("WeatherReport");

4. Start Connection

After the above initialization step, the message flow is prohibited, and it is for preventing unpredictable behavior during initialization.

Once the initialization ends, the Connection will be enabled to start the message system.

TopicConnection.Start ();

5. Create a message generator

In the release / subscription, a generator issued a message to a specified Topic.

The following code shows creates a generator, as well as subsequent establishment and releases a simple text message.

TopicPublisher Publisher = session.createpublisher (WeatherTopic);

TexeMessage Message = session.createMessage ();

Message.setText ("SSSS");

Publisher.publish (Message);

Below is a message user code

TopicConnection = TopicConnectionFactory.createtopicConnection ();

TopicSession = TopicConnection.createtopicSession (false, session.auto_acknowledge);

Topicsbscriber = TopicSession.createsubscriber (Topic);

Topiclistener = new msglistener ();

Topicsbscriber.setMessageListener (this);

TopicConnection.Start ();

(Source: Java Developer)

转载请注明原文地址:https://www.9cbs.com/read-12887.html

New Post(0)