String className = ref.getClassName();
if (className.equals(XBConnectionFactory.class.getName())) {
String[] args = new String[ref.size()-2];
Enumeration iter = ref.getAll();
RefAddr addr = (RefAddr)iter.nextElement();
String forQueuesTxt = addr.getType();
boolean forQueues = false;
try {
forQueues = Boolean.getBoolean(forQueuesTxt);
}
catch (Throwable ex) {
}
addr = (RefAddr)iter.nextElement();
String qosLitteral = addr.getType();
int i = 0;
while (iter.hasMoreElements()) {
addr = (RefAddr)iter.nextElement();
args[i] = addr.getType();
i++;
}
String connectQos = (String)getProperty(XBPropertyNames.CONNECT_QOS, context, env);
if (connectQos != null) qosLitteral = connectQos;
return new XBConnectionFactory(qosLitteral, args, forQueues);
}
if (className.equals(XBDestination.class.getName())) {
RefAddr topicRef = ref.get("topicName");
RefAddr queueRef = ref.get("queueName");
RefAddr forceQueuingRef = ref.get("forceQueuing");
String topicName = (String)topicRef.getContent();
String queueName = (String)queueRef.getContent();
String forceQueuingTxt = (String)forceQueuingRef.getContent();
boolean forceQueuing = (new Boolean(forceQueuingTxt)).booleanValue();
return new XBDestination(topicName, queueName, forceQueuing);
}
}
return null;