Oracle   发布时间:2022-05-17  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Oracle EBS新建Java 并发程序(Java Concurrent Program)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

Oracle Java Concurrent Program

Goal

How to create a Java Concurrent Program?

ApplIEd To

Oracle eBusiness Suite (EBS) R11/R12
Solution
@H_882_13@most of us write Concurrent Programs using the following TechnologIEs:
  1. Oracle Reports
  2. pl/sql Stored Procedure
  3. sql*PLUS
But there are times when we require Java instead of Oracle native pl/sql progrAMMing language. We require Java ProgrAMMingespecially (but notlimitedto) in the following cases:

  1. file handling (More efficIEnt using Java instead of pl/sql )
  2. Secure FTP of files between servers
  3. Networking
  4. ConnecTing to other non Oracle Databases

First of all let me assure you that wriTing a Java Concurrent Program is an easy task,just need some basic skills of Java ProgrAMMing.
Oracle EBS provIDes many java classes to support Java Concurrent ProgrAMMing.The most important and common classes are as follows:

  • JavaConcurrentProgram.class
  • CpContext.class
  • Logfile.class
  • Outfile.class
You can find full List of Java classes related to Java Concurrent ProgrAMMing under Oracle EBSApplication serverat$JAVA_top/Oracle/apps/fnd/cp/request.

@H_967_57@most of the newbIEs raise the following common questions related to Java Concurrent Program:

  1. what is the starTing point
  2. Where should I keep the Java file
  3. How to compile the Java class
  4. I kNow how toresistera concurrent program in EBS,but in case of Java Concurrent Program what should be the Execution file Path
The starTing point is to create your own package where you will keep you custom Java Classes. In order to create your package,you should follow the Oracle Standards. As per the Oracle Standard,you should create the package using the following structure: Oracle.apps.yourcustomappname.packagename.subpackage.....
Let us presume the name of your custom application is xxcust and the directory where we will keep your new custom Java class is request directory . and therequest is under cp . This means the fullyqualifIEd path for our custom Java Class isOracle.apps.xxcust.cp.request.
Now you will be wondering where to create this above mentioned directory/package structure. You have to create this structure in the EBS Application Server under $JAVA_top. Since our directory structure starts withOraclefollowed byapps,both of these directorIEs already exist. So to create our directory structure,follow the below steps:
$cd $JAVA_top/Oracle/apps
$mkdir -p xxcust/cp/request
$cd xxcust/cp/request
$pwd
....../Oracle/apps/xxcust/cp/request
and this is directory where you write your Java Class.

Structure of your Java Class
Oracle EBS provIDes an interface Class "JavaConcurrentProgram"with abstract methodrunProgram()which passes the concurrent processing context "CpContext". And you will write you business logic in the runProgram() method. TheCpContext will Feed log and output file specific information to the runProgram method.The name of the custom class which will implement the JavaConcurrentProgram interface will be used in EBS to register it as a Java concurrent program Executable.
The basic structure of the Java Class (to be used as a concurrent program) is given below:
//**************Template.java****************************//
package Oracle.apps.xxcust.cp.request;
import Oracle.apps.fnd.cp.request.*;
public class Template implements JavaConcurrentProgram{
public voID runProgram(CpContext ctX){
// Write your Business Logic here

//This line will signal successful end of the program to the concurrent manager.
ctx.getReqCompletion().setCompletion(ReqCompletion.norMAL,"Completed");
}
}
//**************End of Template.java********************//

Example
Let us start wriTing a Java Concurrent program "Test.java" to do the following tasks:

  1. Write text to Output file
  2. Write Test to Log file
  3. Get username of the concurrent Program run requester and write to Output file
  4. Send success message to the Concurrent Manager
@H_967_57@make sure you are insIDe "$JAVA_top/Oracle/apps/xxcust/cp/request" LOCATIOn,and create the following Test.java file.
//*************************Test.java****************************/
package Oracle.apps.xxadfd.cp.request;

public classTestimplements JavaConcurrentProgram{

public voID runProgram(CpContext ctX){
// get reference to Out and Log files
Outfile out = ctx.getoutfile();
Logfile log = ctx.getLogfile();
out.writeln("This is my Output file ! ");
log.writeln("This is my Log file",Logfile.STATEMENT);
//get concurrent program request Details
ReqDetails rDet = ctx.getReqDetails();
String username = rDet.getUserInfo().getUsername();

// write username to the Out file
out.writeln("User name = "+userName);
// success message to the Concurrent Manager
ctx.getReqCompletion().setCompletion(ReqCompletion.norMAL,"Completed");
}
//***********************End of Test.java****************************/
Compile the Java Program Test.java
@H_185_81@make sure you are insIDe " $JAVA_top/Oracle/apps/xxcust/cp/request " LOCATIOn,and run the following command:
$java Test[without extension]
It will generateTest.classfile in the current directory i.e. " ".
Program Registration in EBS
Registration of Executable
Executable: TestJavaProg[Any meaningful name]
Short name: T estJavaProg [Any meaningful short name]
Application: Application name[SELEct (Custom or any other) Application name]
Execution Method: Java Concurrent Program
Execution file name: Test [name of our Java Class Compiled above]
Execution file Patch: Oracle.apps.xxadfd.cp.request [Our Java Class Package name]

Registration of Program
Program: Test Java Prog
Short name: TESTJAVAPROG
Application: Application name [SELEct any Application name]
Executable: TestJavaProg [name of the Executable registered above]
本图文内容来源于网友网络收集整理提供,作为学习参使用,版权属于原作者。
编程之家官方1群(满)
编程之家官方2群(满)
编程之家官方3群(满)
编程之家官方4群
编程之家官方5群(新)

大佬总结

以上是大佬教程为你收集整理的Oracle EBS新建Java 并发程序(Java Concurrent Program)全部内容,希望文章能够帮你解决Oracle EBS新建Java 并发程序(Java Concurrent Program)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: