/*
* Factory Type
*/
int type = ObjAdminEvent.QCF;
AdministeredObject tempObj = null;
if (cfLabel.getText().equals(acr.getString(acr.I_QCF))) {
type = ObjAdminEvent.QCF;
tempObj = (AdministeredObject)
new com.sun.messaging.QueueConnectionFactory();
} else if (cfLabel.getText().equals(acr.getString(acr.I_TCF))) {
type = ObjAdminEvent.TCF;
tempObj = (AdministeredObject)
new com.sun.messaging.TopicConnectionFactory();
} else if (cfLabel.getText().equals(acr.getString(acr.I_CF))) {
type = ObjAdminEvent.CF;
tempObj = (AdministeredObject)
new com.sun.messaging.ConnectionFactory();
} else if (cfLabel.getText().equals(acr.getString(acr.I_XAQCF))) {
type = ObjAdminEvent.XAQCF;
tempObj = (AdministeredObject)
new com.sun.messaging.XAQueueConnectionFactory();
} else if (cfLabel.getText().equals(acr.getString(acr.I_XATCF))) {
type = ObjAdminEvent.XATCF;
tempObj = (AdministeredObject)
new com.sun.messaging.XATopicConnectionFactory();
} else if (cfLabel.getText().equals(acr.getString(acr.I_XACF))) {
type = ObjAdminEvent.XACF;
tempObj = (AdministeredObject)
new com.sun.messaging.XAConnectionFactory();
}
/*
* Conn Factory Object Properties.
* Go through each of the cfProps, get the userdata which is
* the property name, get the value, set it in props.
*/
Properties props = tempObj.getConfiguration();
String propName, propValue, propType = null, propLabel = null;
for (int i = 0; i < cfProps.size(); i++) {
LabelledComponent cfItem = (LabelledComponent)cfProps.elementAt(i);
propName = (String)cfItem.getClientData();
if (propName == null)
continue;
// Remove this propName from the props, no longer applies.
if (!(cfItem.getComponent().isEnabled())) {
props.remove(propName);
continue;
}
try {
propType = tempObj.getPropertyType(propName);
propLabel = tempObj.getPropertyLabel(propName);
} catch (javax.jms.JMSException jmsex) {
JOptionPane.showOptionDialog(this,
jmsex.toString(),
acr.getString(acr.I_OBJSTORE_CF_PROPS),
JOptionPane.YES_NO_OPTION,
JOptionPane.ERROR_MESSAGE, null, close, close[0]);
return;
}
if (propType == null)
continue;
propValue = getValue(cfItem.getComponent(), propType).trim();
// If blank, then use default set in Administered Object
// so no need to set to "".
if (propValue.equals(""))
continue;
try {
// Calling setProperty() will verify if this value is valid.
tempObj.setProperty(propName, propValue.trim());
props.put(propName, propValue.trim());
} catch (javax.jms.JMSException jmsex) {
if (jmsex instanceof com.sun.messaging.InvalidPropertyValueException) {
JOptionPane.showOptionDialog(this,
acr.getString(acr.E_INVALID_VALUE, propLabel),