|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface JboContext
Defines additional properties (or environment variables) for the initial context. The following table describes the properties, their possible values, and the platforms for which they are required.
| Context Property | Description | Required on Platforms |
| DEPLOY_PLATFORM | Platform to which an Application Module is deployed. One of PLATFORM_LOCAL, PLATFORM_VB, PLATFORM_EJB, or PLATFORM_ORACLE8I. | ALL |
| INITIAL_CONTEXT_FACTORY | Must be JBO_CONTEXT_FACTORY. | ALL |
| HOST_NAME | Host on which the Application Module server is deployed. Required on Visibroker for USE_BIND mode only. | Oracle8i,
Visibroker |
| CONNECTION_PORT | Port number where the ORB listens for IIOP requests | Oracle8i |
| CONNECTION_MODE | Specifies how to connect to Application Module server. Clients can connect to an Application Module server started on a remote host (USE_BIND mode), find the server using the Visibroker naming service (REMOTE mode), or load the server in the client's VM (COLOCATED mode). | Visibroker |
| ORACLE_SID | Oracle8i service ID to identify the ORB service. | Oracle8i |
| APPLICATION_PATH | JNDI path under which an Application Module is registered. Full path under which an Application Module is published. | Oracle8i |
| USE_APPLET | Must be used whenever the client is an applet. | Visibroker, Oracle8i |
| SECURITY_PRINCIPAL | User name. Required for connecting to an Application Module deployed as CORBA server or an EJB session bean. | Oracle8i |
| SECURITY_CREDENTIALS | Password. Required for connecting to an Application Module deployed as CORBA server or an EJB session bean. | Oracle8i |
static Hashtable env = new Hashtable(10);Your code must also include a definition of the Application Module home:
static ApplicationModuleHome mHome ;You must include code to connect to the database. Then set the properties for deploying.
// Component running locally
{
public static void setLocalEnv() {
env.put(JboContext.INITIAL_CONTEXT_FACTORY,
JboContext.JBO_CONTEXT_FACTORY);
env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
}
}
// Component deployed to Oracle8i CORBA Server.
// Set up the 8i environment
public static void set8iEnv() {
env.put(JboContext.INITIAL_CONTEXT_FACTORY,
JboContext.JBO_CONTEXT_FACTORY);
env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_ORACLE8I);
env.put(JboContext.SECURITY_PRINCIPAL, "scott");
env.put(JboContext.SECURITY_CREDENTIALS, "tiger");
env.put(JboContext.HOST_NAME, "localhost");
env.put(JboContext.CONNECTION_PORT, "2481");
env.put(JboContext.ORACLE_SID, "ORA815");
env.put(JboContext.APPLICATION_PATH, "test");
}
// Component deployed to Oracle8i as EJB.
// Set up the 8i environment
public static void set8iEnv() {
env.put(JboContext.INITIAL_CONTEXT_FACTORY,
JboContext.JBO_CONTEXT_FACTORY);
env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_EJB);
env.put(JboContext.SECURITY_PRINCIPAL, "scott");
env.put(JboContext.SECURITY_CREDENTIALS, "tiger");
env.put(JboContext.HOST_NAME, "localhost");
env.put(JboContext.CONNECTION_PORT, "2481");
env.put(JboContext.ORACLE_SID, "ORA815");
env.put(JboContext.APPLICATION_PATH, "test");
}
ConnectionModeConstants
// Load the Application Module
ApplicationModule appMod = null;
try
{
Context ic = new InitialContext(env);
String theAMDefName = "d2e.D2eModule";
ApplicationModuleHome home =
(ApplicationModuleHome)ic.lookup(theAMDefName);
ApplicationModule appMod = home.create();
appMod.getTransaction().connect("jdbc:oracle:thin:scott/tiger@pc3:1521:ORCL");
return appMod;
}
catch(Exception e) {
e.printStackTrace();
}
Context| Field Summary | |
|---|---|
static java.lang.String |
APPLICATION_PACKAGES
Reserved for future use. |
static java.lang.String |
APPLICATION_PATH
JNDI path under which an Application Module is registered. |
static java.lang.String |
CONNECTION_MODE
Specifies how to connect to Application Module server. |
static java.lang.String |
CONNECTION_PORT
Port number where the ORB listens for IIOP requests. |
static java.lang.String |
DEPLOY_PLATFORM
Platform to which an Application Module is deployed. |
static java.lang.String |
HOST_NAME
Host on which the Application Module server is started. |
static java.lang.String |
JBO_CONTEXT_FACTORY
|
static java.lang.String |
JBO_PROJECT
Used to pass the Project substitution name for Oracle8i. |
static java.lang.String |
ORACLE_SID
Oracle8i CORBA Server service ID to identify the ORB service. |
static java.lang.String |
PLATFORM_COLO
Colocated platform. |
static java.lang.String |
PLATFORM_EJB
EJB on the Oracle8i platform. |
static java.lang.String |
PLATFORM_EJB_IAS
Oracle Application Server platform. |
static java.lang.String |
PLATFORM_LOCAL
Local platform. |
static java.lang.String |
PLATFORM_ORACLE8I
Oracle8i platform. |
static java.lang.String |
PLATFORM_SDO
SDO Service Interface platform. |
static java.lang.String |
PLATFORM_VB
Visibroker platform. |
static java.lang.String |
PLATFORM_WLS
EJB on the Oracle Application Server platform. |
static java.lang.String |
USE_APPLET
Must be used whenever the client is an applet. |
static java.lang.String |
USE_DEFAULT_CONTEXT
|
| Fields inherited from interface javax.naming.Context |
|---|
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES |
| Method Summary |
|---|
| Methods inherited from interface javax.naming.Context |
|---|
addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind, unbind |
| Field Detail |
|---|
static final java.lang.String DEPLOY_PLATFORM
Required for all platforms.
static final java.lang.String HOST_NAME
Required on
Visibroker for USE_BIND mode only. Also required for
PLATFORM_ORACLE8I.
static final java.lang.String CONNECTION_PORT
Required for PLATFORM_ORACLE8I.
static final java.lang.String CONNECTION_MODE
Required for PLATFORM_VB.
static final java.lang.String ORACLE_SID
Required for PLATFORM_ORACLE8I.
static final java.lang.String APPLICATION_PATH
Required for PLATFORM_VB.
static final java.lang.String PLATFORM_VB
static final java.lang.String PLATFORM_LOCAL
static final java.lang.String PLATFORM_COLO
static final java.lang.String PLATFORM_EJB_IAS
static final java.lang.String PLATFORM_ORACLE8I
static final java.lang.String PLATFORM_EJB
static final java.lang.String PLATFORM_WLS
static final java.lang.String JBO_CONTEXT_FACTORY
static final java.lang.String PLATFORM_SDO
static final java.lang.String APPLICATION_PACKAGES
static final java.lang.String USE_APPLET
Required for PLATFORM_ORACLE8I and PLATFORM_VB.
static final java.lang.String JBO_PROJECT
static final java.lang.String USE_DEFAULT_CONTEXT
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||