String destName = getPhysicalDestinationFromConfiguration(jndiName);
//1.3 jndi-name ==> 1.4 setDestination
descriptor_.putRuntimeActivationConfigProperty(
new EnvironmentProperty(DESTINATION,
destName, null));
//1.3 (standard) destination-type == 1.4 setDestinationType
//XXX Do we really need this???
if (descriptor_.getDestinationType() != null &&
!"".equals(descriptor_.getDestinationType())) {
descriptor_.putRuntimeActivationConfigProperty(
new EnvironmentProperty(DESTINATION_TYPE,
descriptor_.getDestinationType(), null));
} else {
/*
* If destination type is not provided by the MDB component
* [typically used by EJB3.0 styled MDBs which create MDBs without
* a destination type activation-config property] and the MDB is for
* the default JMS RA, attempt to infer the destination type by trying
* to find out if there has been any JMS destination resource already
* defined for default JMS RA. This is a best attempt guess and if there
* are no JMS destination resources/admin-objects defined, AS would pass
* the properties as defined by the MDB.
*/
ConfigBean[] cb;
try {
cb = ResourcesUtil.createInstance().getEnabledAdminObjectResources(
ConnectorConstants.DEFAULT_JMS_ADAPTER);
for (int i = 0; i < cb.length; i++) {
AdminObjectResource aor = (AdminObjectResource) cb[i];
if (aor.getJndiName().equals(jndiName)) {
descriptor_.putRuntimeActivationConfigProperty(
new EnvironmentProperty(DESTINATION_TYPE,
aor.getResType(), null));
logger.log(Level.INFO, "endpoint.determine.destinationtype", new
Object[]{aor.getResType() , aor.getJndiName() , descriptor_.getName()});
}
}
} catch (ConfigException e) {
}
}
//1.3 durable-subscription-name == 1.4 setSubscriptionName
descriptor_.putRuntimeActivationConfigProperty(
new EnvironmentProperty(SUBSCRIPTION_NAME,
descriptor_.getDurableSubscriptionName(), null));
String mdbCF = null;
try {
mdbCF = descriptor_.getIASEjbExtraDescriptors().
getMdbConnectionFactory().getJndiName();
} catch(NullPointerException ne ) {
// Dont process connection factory.
}
if (mdbCF != null && mdbCF != "") {
setValuesFromConfiguration(mdbCF, descriptor_);
}
// a null object is passes as a PoolDescriptor during recovery.
// See com/sun/enterprise/resource/ResourceInstaller
if (poolDescriptor != null) {
descriptor_.putRuntimeActivationConfigProperty
(new EnvironmentProperty (MAXPOOLSIZE, ""+
poolDescriptor.getMaxPoolSize(),"", "java.lang.Integer" ));
descriptor_.putRuntimeActivationConfigProperty
(new EnvironmentProperty (MINPOOLSIZE,""+
poolDescriptor.getSteadyPoolSize(),"", "java.lang.Integer"));
descriptor_.putRuntimeActivationConfigProperty
(new EnvironmentProperty (RESIZECOUNT,""+
poolDescriptor.getPoolResizeQuantity(),"", "java.lang.Integer"));
descriptor_.putRuntimeActivationConfigProperty
(new EnvironmentProperty (RESIZETIMEOUT,""+
poolDescriptor.getPoolIdleTimeoutInSeconds(),"", "java.lang.Integer"));
/**
* The runtime activation config property holds all the
* vendor specific properties, unfortunately the vendor
* specific way of configuring exception count and the
* standard way of configuring redelivery attempts is
* through the same property REDELIVERYCOUNT . So, we first
* check if the user (MDB assember) has configured a value
* if not we set the one from mdb-container props
* We have to check for both cases here because it has been
* documented as "endpointExceptionRedeliveryAttempts" but
* used in the code as "EndpointExceptionRedeliveryAttempts"
*/
if ((descriptor_.getActivationConfigValue
(REDELIVERYCOUNT) == null)
&& (descriptor_.getActivationConfigValue
(LOWERCASE_REDELIVERYCOUNT) == null)) {
descriptor_.putRuntimeActivationConfigProperty
(new EnvironmentProperty (REDELIVERYCOUNT,""+
MdbContainerProps.getMaxRuntimeExceptions(),"", "java.lang.Integer"));
}
}
//Set SE/EE specific MQ-RA ActivationSpec properties