if (logger.isLoggable(Level.FINE)) {
logger.log(Level.WARNING,
".createReferenceFactory->: " + poaId + " " + repoid);
}
ReferenceFactoryManager rfm =
(ReferenceFactoryManager)orb.resolve_initial_references(
ORBConstants.REFERENCE_FACTORY_MANAGER ) ;
List<Policy> policies = new ArrayList<Policy>();
// Servant caching for local RMI-IIOP invocation performance
policies.add(ServantCachingPolicy.getPolicy());
// OTS Policy
policies.add(new OTSPolicy());
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.WARNING,
".createReferenceFactory: " + poaId + " " + repoid
+ ": " + ejbDescriptor);
}
// CSIv2 Policy
policies.add(new CSIv2Policy(ejbDescriptor));
IASEjbExtraDescriptors extraDesc
= ejbDescriptor.getIASEjbExtraDescriptors();
String threadPoolName = extraDesc.getUseThreadPoolId();
int threadPoolNumericID = 0;
boolean usePassByReference = extraDesc.getPassByReference();
if (usePassByReference) {
policies.add(new CopyObjectPolicy(PASS_BY_REFERENCE_ID));
}
// Set per-request-load-balancing policy on ejb object references
if( !home && extraDesc.hasPerRequestLoadBalancing() ) {
policies.add( new LoadBalancingPolicy(ORBConstants.PER_REQUEST_LOAD_BALANCING));
logger.log(Level.FINE, "Setting per-request-load-balancing policy " +
"for Ejb " + ejbDescriptor.getName());
}
if (threadPoolName != null) {
ThreadPoolManager threadPoolManager
= S1ASThreadPoolManager.getThreadPoolManager();
try {
threadPoolNumericID = threadPoolManager.getThreadPoolNumericId(
threadPoolName);
policies.add(new RequestPartitioningPolicy(threadPoolNumericID));
} catch (Exception ex) {
logger.log(Level.WARNING, "Not using threadpool-request-partitioning...", ex);
}
}
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "POARemoteRefFactory checking if SFSBVersionPolicy need to be added");
}
/* Findbugs
EJBServerConfigLookup ejbConfigLookup =
new EJBServerConfigLookup(ejbDescriptor);
*/
boolean addSFSBVersionPolicy = EJBServerConfigLookup.needToAddSFSBVersionInterceptors();
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "POARemoteRefFactory addSFSBVersionPolicy? " + addSFSBVersionPolicy);
}
if (addSFSBVersionPolicy) {
if (container instanceof StatefulSessionContainer) {
StatefulSessionContainer sfsbCon = (StatefulSessionContainer) container;
if (sfsbCon.isHAEnabled()) {
policies.add(new SFSBVersionPolicy(ejbDescriptor.getUniqueId()));
}
}
}
if (logger.isLoggable(Level.FINE)) {
String jndiName = ejbDescriptor.getJndiName();
logger.log(Level.FINE, "Using Thread-Pool: ["
+ threadPoolName + " ==> " + threadPoolNumericID
+ "] for jndi name: " + jndiName);
logger.log(Level.FINE, "Pass by reference: ["
+ usePassByReference
+ "] for jndi name: " + usePassByReference);
}
// DisableClearTextIIOP policy which sets IIOP Profile port to 0
// if EJB allows only SSL invocations
CSIV2TaggedComponentInfo ctc = new CSIV2TaggedComponentInfo(orb);
Set iorDescSet = ejbDescriptor.getIORConfigurationDescriptors();
if ( ctc.allMechanismsRequireSSL(iorDescSet) ) {
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.WARNING,
".createReferenceFactory: " + poaId + " " + repoid
+ ": adding ZeroPortPolicy");
}
policies.add(ZeroPortPolicy.getPolicy());
}
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.WARNING,
".createReferenceFactory: " + poaId + " " + repoid
+ ": policies: " + policies);
}
ReferenceFactory rf = rfm.create( poaId, repoid, policies, this ) ;
return rf ;
} finally {
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.WARNING,