1. Implement a class that extends oracle.jbo.common.ampool.EnvInfoProvider
2. Override the "public Object getInfo(String infoType, Object env)"-method
i.e. body for the above method to be overridden below:
if(EnvInfoProvider.INFO_TYPE_JDBC_PROPERTIES.equals(infoType)) {
String dsName = DEFAULT_DS_JNDI_NAME; // the default Data Source' JNDI Name
if(ADFContext.getCurrent().getSecurityContext().getSubject() != null) {
Subject sbj = ADFContext.getCurrent().getSecurityContext().getSubject();
String dsName = DEFAULT_DS_JNDI_NAME; // the default Data Source' JNDI Name
if(ADFContext.getCurrent().getSecurityContext().getSubject() != null) {
Subject sbj = ADFContext.getCurrent().getSecurityContext().getSubject();
// utitlity method to extract the FcoCode principal from the given subject
String fcoCode = AMUtil.interrogateSubjectForFinanceCompanyPrincipal(sbj);
if(fcoCode != null) {
String fcoCode = AMUtil.interrogateSubjectForFinanceCompanyPrincipal(sbj);
if(fcoCode != null) {
// calling private method to determine the appropriate Data Source JNDI Name
// based on FcoCode
dsName = this.determineDataSourceFromFcoCode(fcoCode);
} dsName = this.determineDataSourceFromFcoCode(fcoCode);
}
((Hashtable) env).put(Configuration.JDBC_DS_NAME, dsName);
}
return null;
3. Configure the Application Module to make use of the implemented Environment Info Provider by
specifying your custom class as value for property: "jbo.envinfoprovider".
(see screenshot below)
No comments:
Post a Comment