Oracle Internet Application Server 8i Migrating from Oracle Application Server Release 1.0 A83709-01 |
|
This chapter provides information on migrating EJB, ECO for Java and JCO applications from the Oracle Application Server to Oracle8i JVM EJB objects. A working knowledge of deploying EJBs on Oracle8i JVM is assumed, as that subject is not discussed here.
To migrate EJBs from OAS 4.0.8 (or later) to Oracle8i JVM, you will need to modify code in the following areas:
These changes are described in the following sections.
Oracle8i JVM allows you to put deployment information in a text file that you can run through the ejbdescriptor command line tool to create the serialized deployment descriptors. The format of this text file resembles Java. The example below shows the basic structure, in which ejb.test.server
is the package that contains the implementation of the bean class ExampleBean
.
SessionBean ejb.test.server.ExampleBeanImpl { <attribute>=<value> ... }
The required attributes are:
Common additional attributes include:
You can also use this format to set Java environment variables for the bean. For additional information, see the Oracle 8i EJB and CORBA Developer's Guide.
Changes to the client code are made in the initial context call using JNDI. The hashtable passed to the initial context call must contain all of the properties listed in the table below.
You must also change the URL that accesses your EJB home to the Oracle 8i format:
sess_iiop://<host>:<port>:<SID>/<path>/<bean>
For example:
sess_iiop://myhost:2481:ORCL/test/myBean
If application logging was done in OAS, remove all references to oracle.oas.ejb.Logger from your EJB code. In Oracle8i JVM, you can use the println
function for simple logging, or you can log to the database.
When migrating ECO for Java to Oracle 8i, you can choose between migrating to EJB, or to CORBA. As the ECO model is very similar to EJB, the easiest migration is to EJB. You will need to change server code as described in the sections below in addition to changes for deployment descriptors and client code described in the sections above for EJB migration.
To modify your ECO for Java components to be compatible with Oracle8i JVM EJBs, you must modify the implementation file, the remote interface file, and the home interface file.
Change the remote interface to extend javax.ejb.EJBObject
instead of oracle.oas.eco.ECOObject
. Each method must throw java.rmi.RemoteException
.
Change the home interface to extend javax.ejb.EJBHome
instead of oracle.oas.eco.ECOHome
.
The create method must throw javax.ejb.CreateException
and java.rmi.RemoteException
instead of oracle.oas.eco.CreateException
.
Make the following changes to the implementation class:
oracle.oas.eco.Logger
.
oracle.oas.eco.* to javax.ejb.*
.
Oracle Application Server versions 4.0.6 and 4.0.7 provided a component model called Java CORBA Objects (JCO), a precursor to the ECO for Java model. This section discusses migrating from JCO in OAS to EJB in Oracle8i JVM.
To migrate to EJB, you must modify the server and client code as discussed in the following sections. To modify the server code, you must modify the remote interface, create a home interface, modify the JCORBA object implementation, and make parameters serializable. You must also modify the deployment descriptors as discussed in "Migrating EJBs".
Make the following changes to the remote interface:
org.omg.CORBA.Object
or oracle.oas.jco.JCORemote
to javax.ejb.EJBObject
.
java.rmi.RemoteException
for all methods in the interface.
You will need to create a home interface as defined in the EJB specification. An example is shown below.
import javax.ejb.*; import java.rmi.RemoteException; public interface ServerStackHome extends EJBHome { public ServerStackRemote create() throws CreateException, RemoteException; }
Complete the following to migrate the implementation class:
oracle.oas.jco.*
to import javax.ejb.*
.
javax.ejb.SessionBean
.
ejbCreate()
method.
setSessionContext()
method in an instance variable.
java.rmi.RemoteException
exception.
Table 4-2 ObjectManager and SessionContext methods
If any user defined parameters are being passed in the remote interface, ensure that the classes implement java.io.Serializable
.
|
Copyright © 2000 Oracle Corporation. All Rights Reserved. |
|