Vous êtes sur la page 1sur 16

Developing in Java with

PeopleSoft 8

OVERVIEW AND EXAMPLES

PEOPLESOFT WHITE PAPER


MARCH 2001
DEVELOPING IN JAVA WITH PEOPLESOFT 8 MARCH 2001

Developing in Java with PeopleSoft 8–Overview and Examples

ã 2001 by PeopleSoft, Inc.


All rights reserved. Published 2001.
Printed on recycled paper.

Restricted Rights

Printed in the United States of America.

The information contained in this document is proprietary and confidential to PeopleSoft, Inc.

No part of this document may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying and recording, for any purpose without the express written permission
of PeopleSoft, Inc.

This document is subject to change without notice, and PeopleSoft does not warrant that the material
contained in this document is error-free. If you find any problems with this document, please report them to
PeopleSoft in writing.

This document contains or may contain statements of future direction concerning possible functionality for
PeopleSoft’s software products and technology. All functionality and software products will be available
for license and shipment from PeopleSoft only if and when generally commercially available. PeopleSoft
disclaims any express or implied commitment to deliver functionality or software unless or until actual
shipment of the functionality or software occurs. The statements of possible future direction are for
information purposes only and PeopleSoft makes no express or implied commitments or representations
concerning the timing and content of any future functionality or releases.

2 OVERVIEW AND EXAMPLES


MARCH 2001 DEVELOPING IN JAVA WITH PEOPLESOFT 8

Document Purpose and Scope


This white paper provides an overview and examples of how PeopleSoft customers can develop
applications in Java within the PeopleTools Development Environment of PeopleSoft 8. It is
written for a technical audience familiar with Java and contains the following sections:

Overview .................................................................................................................................. 3
Writing PeopleSoft Business Logic in Java ............................................................................. 6
Invoking PeopleSoft Components from Java ......................................................................... 10
Frequently Asked Questions Concerning PeopleSoft 8 and Java........................................... 15

Overview
Java is an extremely popular programming language today, especially for internet applications.
Many PeopleSoft customers have invested heavily in building Java skills within their IT
organization and would like to leverage this investment within their PeopleSoft environment. We
have good news for these customers: with PeopleSoft 8, developers can definitely leverage their
Java skills with PeopleSoft applications. With PeopleTools 8, PeopleSoft has added support in
several key areas to enable developers to create Java-based PeopleSoft applications.

There are two primary areas where the developer can program in Java within the PeopleTools
environment:

1. Writing PeopleSoft Business Logic in Java: The vast majority of PeopleSoft business logic
is created in PeopleTools using tools such as the Component Designer and the PeopleCode
Editor. With PeopleTools 8, developers can write business logic directly in Java, or invoke
third party Java classes from PeopleCode.

2. Invoking PeopleSoft Components from Java: All PeopleSoft Components can be invoked
from Java programs through the Component Interface technology of PeopleSoft 8. This is
useful for those developers who want to create Java servlets, applets, JSP programs, or
Enterprise Java Beans that invoke PeopleSoft business logic.

Also, one of the leading Java 2 Enterprise Edition (J2EE) web application servers on the market is
packaged with PeopleSoft 8: WebLogic Server from BEA Systems. WebLogic Server
implements the J2EE platform specification that includes Servlets, Java Server Pages (JSP),
Enterprise JavaBeans (EJB), Java Messaging Services (JMS), and other platform services. When
developing WebLogic Server applications, developers create and assemble components using
these services and APIs. PeopleSoft customers can leverage these WebLogic J2EE services when
creating PeopleSoft content in Java.

A fourth area where PeopleSoft customers can leverage their Java skills is with the PeopleSoft
Portal, which is a completely URL addressable portal. For example, a customer can develop a
custom PeopleSoft application using JSP within WebLogic, and this content can be seamlessly
integrated with the PeopleSoft Portal. Any content, developed using Java that is HTTP-based and
addressable via a URL, can be easily integrated into the PeopleSoft Portal over the internet. This
allows customers to distribute their development and runtime environments ― making for better
scalability for both.

OVERVIEW AND EXAMPLES 3


DEVELOPING IN JAVA WITH PEOPLESOFT 8 MARCH 2001

This white paper deals primarily with the first two areas of Java programming within the
PeopleTools Development Environment (listed above). But before diving into the details of
coding in Java with PeopleSoft, we’ll first explain how the PeopleSoft Internet Architecture uses
Java and the reasons for developing applications in PeopleTools (versus coding from scratch in
Java).

Java’s Role within the PeopleSoft Internet Architecture


Java is used extensively within the server layer of the PeopleSoft Internet Architecture. PIA
leverages Java servlets, which execute within the web application server (BEA WebLogic or
Apache JServ). There are primarily three categories of PIA Java servlets:

1. Presentation Relay Servlet—A PeopleTools Java servlet that handles all inbound and
outbound HTTP requests for PeopleSoft transactions and queries. This very thin servlet acts
as a relay between the client device and the core back-end services. It receives and serves
HTML, XML, and WML requests over HTTP and maps the data in these requests to the
Component Processor and Query Processor application services that execute under Tuxedo.

2. Integration Relay Servlet—A PeopleTools Java servlet that handles all inbound and
outbound HTTP/XML requests for the third-party system integration. This is also a very thin
servlet that acts as a relay between the external or third-party system and the core back-end
integration services. It receives and serves XML requests over HTTP and maps the data in
these requests to the integration services—Application Messaging Processor, Business
Interlinks Processor, Component Processor—that execute under Tuxedo.

3. Portal Servlet—A PeopleTools Java servlet that handles all inbound markup language and
outbound requests for the Portal. It receives and serves HTML, XML, and WML requests
over HTTP. It also manages all aspects of the PeopleSoft Portal such as search, content
management, and home page personalization.

With PeopleSoft 7 and 7.5, Java was used extensively on the client with the PeopleSoft Java
Client. The Java Client was retired with PeopleSoft 8. PeopleSoft found HTML to be a much
better client technology than Java for internet applications and that Java was best used on the
server.

Building Applications in PeopleTools Versus Coding from Scratch in Java


PeopleSoft commonly get questions from prospects, not familiar with PeopleTools, about the
value add of PeopleTools. Why not simply build everything from scratch in Java? Why not use a
pure J2EE development environment? These are not new questions. In the past, prospects have
asked very similar questions around the hot technology of the day. In the early 90’s, it was Power
Builder. In the mid 90’s, it was Visual Basic. More recently CORBA and Java applets were the
“in” technologies. Over the past year, it has been J2EE.

The reasons for building applications in PeopleTools are the same today as they were 10 years
ago:

L Investment Protection

L Full Enterprise Development Environment

4 OVERVIEW AND EXAMPLES


MARCH 2001 DEVELOPING IN JAVA WITH PEOPLESOFT 8

L Less Coding Resulting in Faster Implementations

These reasons hold true even more so today since PeopleTools has been able to put up an
outstanding track record of technology evolution and investment protection during that 10 year
period and we’ve had thousands of customers implement enterprise systems successfully on
PeopleTools. The same cannot be said about J2EE development environments.

Investment Protection
Technology is constantly changing. PeopleTools shields you from this never ending world of
technology change. The metadata-driven PeopleTools architecture allows PeopleSoft to rapidly
evolve our technology and at the same time protects our customers' investment in their strategic
customizations. PeopleSoft is completely committed to upgrade technology, which ensures that
applications built in PeopleTools can be migrated from release to release. With PeopleTools, you
can thrive when technology changes. We constantly work with our customers to integrate new
technologies. Our ability to migrate customers from two-tier client/server, three-tier client/server,
to multi-tier Internet applications is proof of our ability to adopt new technologies and insulate
customers from radical technology change.

Full Enterprise Development Environment


For enterprise application development, there is much more to development than simply writing
code. Smaller applications vendors and customers who build their applications from scratch often
overlook this point. With PeopleTools, you get a complete enterprise development environment
which includes the following functionality:

L Robust Transaction Development Environment


L Data Management Tools
L Reporting Tools
L Integration Tools
L Data Warehousing Tools
L Portal Tools
L Upgrade Tools
L Workflow Tools
L System Monitoring and Management Tools
L Full Security Maintenance and Management
L Robust, Proven, Scalable Application Server Environment
L Complete Batch Environment with Process Scheduler and Application Engine
L Global Technology (Unicode and Built-in Multi-Language)
L Enterprise Class Portability Across the Web Browser, Web Server, Application Server, and
Database Server Tiers

Less Coding Resulting in Faster Implementations


Java is the most modern 3rd generation language that exists, much better than COBOL, C, or C++
that came before it; however, for truly higher levels of application development productivity you
need to go beyond 3rd generation languages into a declarative development platform.

OVERVIEW AND EXAMPLES 5


DEVELOPING IN JAVA WITH PEOPLESOFT 8 MARCH 2001

PeopleTools is a very declarative development platform, meaning that your developers will write a
fraction of the code with PeopleTools-based applications compared to writing applications
natively in JSP, Java, or Active Server Pages. And in the long run, this means much less code to
maintain and port to new platforms and technology.

PeopleTools allows your developers to deal with the business requirements and focus on
application design instead of focusing on the low level code. The application developers of
PeopleSoft 8 were able to deliver pure internet applications without writing a single line of
HTML, Java, or XML code. The PeopleSoft Internet Architecture leverages these leading edge
technologies when deploying and executing the business applications defined in PeopleTools.

J2EE (and it’s underlying technologies such as Servlets, EJB, and JSP) development currently has
a lot of interest and momentum in the IT world for application development. J2EE is basically a
Java coding standard, which is a very good thing compared to no standards. But the bottom line is
that is it still coding. Building applications from scratch in J2EE is a very time consuming, coding
intensive process.

Writing PeopleSoft Business Logic in Java


There are many reasons why a developer would want to write business logic for their PeopleSoft
applications in Java. Perhaps they have licensed a third party set of Java classes to do some very
specific processing (e.g. tax calculation). Or maybe they have developed some internal Enterprise
Java Beans in house for their specific business processes. Or perhaps the developer simply likes
to code in Java. Whatever the reason, with PeopleSoft 8 you can now easily integrate Java code
with your PeopleSoft applications through the new Java PeopleCode functions.

Further details on developing in Java with PeopleSoft 8 can be found in the PeopleTools 8
PeopleBooks.

Invoking Java from PeopleCode


There are three primary Java PeopleCode functions that are used to invoke Java from PeopleCode:

1. GetJavaClass

2. CreateJavaObject

3. CreateJavaArray

GetJavaClass
The GetJavaClass function finds a Java class you can manipulate in PeopleCode. This is used for
those classes that have static members, where it isn't appropriate to instantiate an object of the
class. You can only call static methods, that is, class methods, with the object created with this
function.

In Java, you access such static members of a class by using the class name:

result = java.class.name.SomeStaticMethod();

6 OVERVIEW AND EXAMPLES


MARCH 2001 DEVELOPING IN JAVA WITH PEOPLESOFT 8

To do this in PeopleCode, do the following:

&Result = GetJavaClass("java.class.name").SomeStaticMethod();

The following is a simple PeopleCode example which uses GetJavaClass that gets a system class.

&Sys = GetJavaClass("java.lang.System");
&Sys.setProperty("java.security.policy", "C:\java\policy");
WinMessage("The security property is: " | &Sys.getProperty("java.security.policy"));
&Props = &Sys.getProperties();
&Props.put("java.security.policy", "C:\java\policy");
&Sys.setProperties(&Props);
WinMessage("The security property is: " | &Sys.getProperty("java.security.policy"));

CreateJavaObject
The CreateJavaObject function creates a Java object that can be manipulated in your
PeopleCode. You can use the CreateJavaObject function to create a Java array. If ClassName is
the name of an array class (ending with []), ConstructorParams are used to initialize the array.

In Java, you would do the following to initialize an array:

intArray = new int[]{1, 2, 3, 5, 8, 13};

Do the following to initialize a Java array from PeopleCode:

&IntArray = CreateJavaObject("int[]", 1, 2, 3, 5, 8, 13);

If you want to initialize a Java array without knowing the number of parameters until runtime, use
the CreateJavaArray function.

The following is a simple PeopleCode program that creates a Java object from a sample program
that generates a random password.

/* Example to return Random Passwords from a Java class */


Local JavaObject &oGpw;
/* Create an instance of the object */
&oGpw = CreateJavaObject("com.PeopleSoft.Random.Gpw_Demo");
&Q = "1";
/* Call the method within the class */
&NEW_VALUE = &oGpw.getNewPassword(&Q, PSRNDMPSWD.LENGTH);
/* This is just returning one value for now */
PSRNDMPSWD.PSWD = &NEW_VALUE;

CreateJavaArray
The CreateJavaArray function allows you to create a Java array without knowing the number or
value of the elements.

When you create an array in Java, you already know the number of elements in the array. If you
don't know the number of elements in the array, but you want to use a Java array, use the

OVERVIEW AND EXAMPLES 7


DEVELOPING IN JAVA WITH PEOPLESOFT 8 MARCH 2001

CreateJavaArray function in PeopleCode. This will create a Java object that is a Java array, and
you can pass in the number of elements that are to be in the array.

The following PeopleCode example passes a PeopleCode array of strings (&Parms) that we to a
Java method xyz of class Abc. This example assumes that you don't know when you write the
code just how many parameters you will have.

Local JavaObject &Abc, &RefArray;


Local array of String &Parms;

&Parms = CreateArray();
/* Populate array how ever you want to populate it */
&Abc = GetJavaObject("com.peoplesoft.def.Abc");
/* Create the java array object. */
&JavaParms = CreateJavaArray("java.lang.String[]", &Parms.Len);
/* Populate the java array from the PeopleCode array. */
&RefArray = GetJavaClass("java.lang.reflect.Array");
For &I = 1 to &Parms.Len
&RefArray.set(&JavaParms, &I - 1, &Parms[&I]);
End-For;
/* Call the method. */
&Abc.xyz(&JavaParms);

Invoking PeopleCode from Java


Not only can you invoke Java from PeopleCode, but you can also invoke PeopleCode functions
from Java. This allows the Java programmer, who is also familiar with PeopleCode, to leverage
the rich functionality available in PeopleCode.

SysVar Java Class


The SysVar Java class can be used to refer to PeopleSoft system variables, such as %Language or
%Oprid.

For example, %Session, becomes SysVar.Session().

SysCon Java Class


The SysCon Java class can be used to refer to system constants, such as %SQLStatus_OK or
%FilePath_Absolute.

For example, %CharType_Matched becomes SysCon.CharType_Matched.

Func Java Class


The Func Java Class can be used to refer to built-in PeopleCode functions, such as CreateRowset
or GetFile.

For example, SetLanguage(LANG_CD) becomes Func.SetLanguage(LANG_CD).

8 OVERVIEW AND EXAMPLES


MARCH 2001 DEVELOPING IN JAVA WITH PEOPLESOFT 8

Name Java Class


The Name Java Class allows you to use the PeopleSoft reserved item references. This allows you
to reference pages, components, records, fields, and so on.

For example, in PeopleCode you can refer to a record field using the following:

recname.fieldname

With the Name class, you can use a similar construct:

new PeopleSoft.PeopleCode.Name("RECNAME", "FIELDNAME");

As another example, in PeopleCode you can refer to a PeopleSoft page using the following:

PAGE.pagename

In Java, it would be:

new PeopleSoft.PeopleCode.Name("PAGE", "PAGENAME");

Invoking PeopleCode Classes


The existing PeopleCode classes (like Array, Rowset, and so on) have properties and methods you
can access from Java. PeopleCode classes have the same names, so Record becomes Record, SQL
becomes SQL, and so on. Methods are accessed by the method name. The name of a property is
pre-pended with either get or set, depending on whether you're reading or writing to the property.

For example, to get the IsChanged property would be getIsChanged. To set the value for a field
would be &MyField.setValue.

Here is an example of a Java program that uses PeopleCode objects to access the database:

/* This code is used to test the Java/PeopleCode interface. */


import PeopleSoft.PeopleCode.*;
public class Test {
/*
* Add up and return the length of all the
* item labels on the UTILITIES menu,
* found two different ways.
*/
public static int Test() {
/* Get a Rowset to hold all the menu item records. */
Rowset rs = Func.CreateRowset(new Name("RECORD", "PSMENUITEM"), new Object[]{});
String menuName = "UTILITIES";
int nRecs = rs.Fill(new Object[]{"WHERE FILL.MENUNAME = :1", menuName});
int i;
int nFillChars = 0;
for (i = 1; i <= rs.getActiveRowCount(); i++) {
String itemLabel = (String)rs.GetRow(i)
.GetRecord(new Name("RECORD", "PSMENUITEM"))
.GetField(new Name("FIELD", "ITEMLABEL"))
.getValue();

OVERVIEW AND EXAMPLES 9


DEVELOPING IN JAVA WITH PEOPLESOFT 8 MARCH 2001

nFillChars += itemLabel.length();
}

/* Do this a different way - use the SQL object to read each menu
item record. */
int nSQLChars = 0;
Record menuRec = Func.CreateRecord(new Name("RECORD", "PSMENUITEM"));
SQL menuSQL = Func.CreateSQL("%SelectAll(:1) WHERE MENUNAME = :2",
new Object[]{menuRec, menuName});
while (menuSQL.Fetch(new Object[]{menuRec})) {
String itemLabel = (String)menuRec
.GetField(new Name("FIELD", "ITEMLABEL"))
.getValue();
nSQLChars += itemLabel.length();
}
return nFillChars + 100000 * nSQLChars;
}
}

This can be run from PeopleCode like this:

Local JavaObject &Test;


Local number &chars;

&Test = GetJavaClass("Test");
&chars = &Test.Test();

&Test = Null;
WinMessage("The character counts found are: " | &chars, 0);

Invoking PeopleSoft Components from Java


All PeopleSoft 8 Components can be invoked from Java programs through the Component
Interface technology of PeopleSoft 8. This is useful for those developers who want to create Java
servlets, applets, JSP programs, or Enterprise Java Beans that invoke PeopleSoft business logic.

This section walks through an example of how to invoke a PeopleSoft Component from Java. A
Business Expense Component is used as the example.

Creating the Component Interface


The following is a the Business Expense Component user interface running via PIA:

10 OVERVIEW AND EXAMPLES


MARCH 2001 DEVELOPING IN JAVA WITH PEOPLESOFT 8

To expose this Component to a third party, you must first create a Component Interface definition.
This is done through the Component Interface Designer. Using drag and drop, the developer can
specify the properties and methods of the Component that he wishes to expose. Numerous
Component Interface definitions come delivered out of the box with PeopleSoft 8.

The Business Expenses Component definition is in the left frame below. The Component
Interface definition is in the right frame (the properties and methods that are exposed through this
interface).

Component Interface Designer

OVERVIEW AND EXAMPLES 11


DEVELOPING IN JAVA WITH PEOPLESOFT 8 MARCH 2001

Once the Component Interface definition is saved, you can then generate the Java classes for
invoking this interface. This is also done from the Component Interface Designer:

Building the Java Classes for Invoking this Component Interface

Invoking the Component Interface from Java


The following walks through the steps of invoking this Business Expense Component Interface
from Java.

Connecting to the Application Server


To access a Component Interface, you need to establish a PeopleSoft session.

To create a session object, use the Session.Connect () method. The Connect method, which takes
five parameters, actually logs into a PeopleSoft session. The Connect() method connects a session
object to a PeopleSoft application server. Note that there are various options available on using an
existing connection and disconnecting and switching connections.

import PeopleSoft.ObjectAdapter.*;
import PeopleSoft.Generated.PeopleSoft.*;
import PeopleSoft.Generated.CompIntfc.*;
private ISession oSession;
private CAdapter oAdapter;

12 OVERVIEW AND EXAMPLES


MARCH 2001 DEVELOPING IN JAVA WITH PEOPLESOFT 8

oAdapter = new CAdapter();


oSession = new CSession(oAdapter.getSession());
oSession.Connect(1,"//EHARRIS032000:9000","PTDMO","PTDMO",new byte[0]);

Getting an Instance of the Component Interface


Use the GetComponent() method with a session object to get an instance of a previously created
component interface.

busExpense = new CBusExp( oSession.GetComponent( "BUS_EXP" ));

Finding an Existing Record


You can query a component interface to find what data instances are possible based on primary
and alternate search keys.

busExpense.setName( searchDialogStrings[ 0 ]);


busExpense.setLastNameSrch( searchDialogStrings[ 1 ]);
busExpense.setEmplid( searchDialogStrings[ 2 ] );
return( busExpense.Find() );

Getting an Instance of Data


GetKeys are the key values required to return a unique instance of existing data. GetKeys can be
set using simple assignment to the properties of the component interface and then the Get()
method can be invoked. This will populate the component interface with data based on the key
values you set; this is what has been referred to here as a data instance.

busExpense.setEmplid( getKey );
boolean result = busExpense.Get();

Migrating through Collections of Data


After getting a data instance, the next step will be to get access to the data in the Component
Interface. PeopleSoft organizes Component Interface data within collections, and rows of data in
a collection are called items.

The following code creates a connection to the application server, gets the Component Interface,
and fetches the first item in a collection.

oAdapter = new CAdapter();


oSession = new CSession(oAdapter.getSession());
oSession.Connect(1,"//EHARRIS032000:9000","PTDMO","PTDMO",new byte[0]);
busExpense = new CBusExp( oSession.GetComponent( "BUS_EXP" ));
busExpense.setEmplid( getKey );
boolean result = busExpense.Get();
busExpenseFirstScrollItemCollection = busExpense.getBusExpensePer();
busExpenseFirstScrollItem = firstScrollCollection.Item( firstScrollIndex );
return( busExpenseFirstScrollItem.getBusExpenseDtl() );

Editing and Accessing Data in an Item


Editing and accessing Component Interface data in Java is rather straightforward. The following
Java code accesses the various public members of the class.

OVERVIEW AND EXAMPLES 13


DEVELOPING IN JAVA WITH PEOPLESOFT 8 MARCH 2001

long j = busExpenseSecondScrollCollection.getCount();
Object [][] data = new Object[ ((int)j + 1) ][ 7 ];
for( int i = 1; i < j + 1 ; i++ )
{
busExpenseSecondScrollItem = busExpenseSecondScrollCollection.Item( i );
data[(i - 1)][0] = busExpenseSecondScrollItem.getBusinessPurpose();
data[(i - 1)][1] = busExpenseSecondScrollItem.getChargeDt();
data[(i - 1)][2] = busExpenseSecondScrollItem.getCurrencyCd();
data[(i - 1)][3] = busExpenseSecondScrollItem.getDeptid();
data[(i - 1)][4] = busExpenseSecondScrollItem.getExpenseAmt();
data[(i - 1)][5] = busExpenseSecondScrollItem.GetPropertyByName("ExpenseCd");
data[(i - 1)][6] = busExpenseSecondScrollItem.GetPropertyByName("CurrencyCd");
}return( data );

In the following example, data is accessed using the getNAME_OF_PRPERTY() method of an


Item or by using the generic getPropertyByName() method. These code lines show how an entire
collection of data can be captured and packaged into an Object for transfer to a calling Object.

busExpenseFirstScrollItem.setEmplid( emplid );
busExpenseFirstScrollItem.setExpensePeriodDt( expensePeriodDt );
return( busExpense.Save() );

Just as before, data is edited using Item objects and using the setNameOfPropery() method of
those Items. Also, note that we needed to call the Save() method on the Component Interface to
commit the changes.

Inserting an Item into a Collection and Deleting an Item from a Colleciton


Collection objects in Java have the InsertItem() method where the return value is the Item just
inserted. After a new Item is created, simply edit data in it and then remember to call the Save()
method to commit the changes.

busExpenseSecondScrollItem = busExpenseSecondScrollCollection.InsertItem( secondScrollIndex );

Similarly, there is a DeleteItem() method:

busExpenseSecondScrollCollection.DeleteItem( secondScrollIndex );

Disconnecting from a Session


After a session is no longer needed, it should be disconnected from the application server. This is
done by calling the Disconnect() method on the session object.

oSession.Disconnect();

14 OVERVIEW AND EXAMPLES


MARCH 2001 DEVELOPING IN JAVA WITH PEOPLESOFT 8

Frequently Asked Questions Concerning PeopleSoft 8 and Java


The following is a list of frequently asked question concerning PeopleSoft 8 and Java.

Q: Can PeopleSoft Component Interfaces be invoked as Java Beans with PeopleTools 8?


Can they be invoked as Enterprise Java Beans?
Component Interfaces can be invoked as Java Beans (i.e. property get/set methods) starting with
PeopleTools 8.12. PeopleTools provides native Java Bean support for CI’s. But native Enterprise
Java Bean support is not provided. Component Interfaces can be invoked from an EJB, which
means that a customer can wrap a PeopleSoft Component Interface within an EJB.

The PeopleTools Component Interface Designer does not generate EJB’s when generating the
Java bindings. This was a conscious decision that was made for several reasons:

L One is that we wanted to make sure that we didn't limit the integration that we provided only
to EJB environments. There are enough developers out there writing Java servlets and other
Java applications that don't run in an EJB environment that we didn't want to lock those folks
out just to get the marketing checkbox for EJB support. It made more sense to have good
Java support that would allow all environments, EJB and non-EJB, to be able to call
PeopleSoft Components.

L The other reason is that the EJB specification is still fairly immature, especially when you
consider the various implementations of the spec. The differences between the deployment
descriptors for WebLogic, WebSphere, iPlanet, etc. are pretty large. Also, not all of the
current EJB implementations are even up to the current EJB 1.1. spec and the EJB 2.0 spec is
out for public comment right now.

As the spec matures and existing Java environments move to EJB’s, then PeopleSoft will most
likely add native EJB support. Until then, we'll be open to all Java environments.

Q: How is WebLogic’s EJB support used within the PeopleSoft Internet Architecture: server
provider, container provider, EJB provider, application developer, and deployment
developer?
PeopleSoft does not currently leverage WebLogic's EJB functionality. PIA uses WebLogic for
Java servlet and web server support.

Q: What are PeopleSoft recommendations on the EJB design approach (stateless server,
sessions-oriented, and persistent) and EJB type (stateless session, stateful session, and
entity) with WebLogic Server and the PeopleSoft Internet Architecture?
PeopleSoft has no formal recommendations at this time concerning this issue. The work that has
been done in 8.12 will allow someone to develop a stateful session bean that is implemented in
terms of a Component Interface (or set of CIs) as long as the CI is used (retrieved, created,
accessed, released) within the scope of an EJB method call.

In the PeopleTools 8.4 release of the Java binding for Component Interfaces, PeopleSoft will be
providing support for Java serialization of all CI related classes (i.e. Session, MessageCollection,
CI, CIRow, etc). This will allow developers to create stateful session beans that can support being
activated and passivated by the EJB container. This requires that non-transient data members of
the EJB be serializable - something that was not possible in 8.12 because the CI API did not

OVERVIEW AND EXAMPLES 15


DEVELOPING IN JAVA WITH PEOPLESOFT 8 MARCH 2001

provide support for Java serialization and not enough of the CI internals was exposed (by design)
to API callers to bolt on serialization support in a reasonable manner.

Q: If calls are made to multiple Java classes from PeopleCode, are all of these done
through one JVM instance?
Yes. Each process is limited (by current JVM implementations) to one JVM instance. However,
multiple PeopleSoft Application Servers each have their own JVM instance, since they are in
separate processes.

Q: What version of Java is supported from PeopleCode?


PeopleSoft supports Java version 1.2.2 for all its platforms (except OS/390, which uses Java
version 1.1.8). We PeopleTools 8.4, we plan to have all our platforms support Java 1.3.

16 OVERVIEW AND EXAMPLES

Vous aimerez peut-être aussi