destName = getPhysicalDestinationFromConfiguration(jndiName, appName, moduleName);
}
//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));
_logger.log(Level.INFO, "endpoint.determine.destinationtype", new
Object[]{descriptor_.getDestinationType(), jndiName, descriptor_.getName()});
} else if (isValidDestination(destination) &&
ConnectorConstants.DEFAULT_JMS_ADAPTER.equals(destination.getResourceAdapterName())) {
descriptor_.putRuntimeActivationConfigProperty(
new EnvironmentProperty(DESTINATION_TYPE,
destination.getClassName(), null));
_logger.log(Level.INFO, "endpoint.determine.destinationtype", new
Object[]{destination.getClassName(), destination.getName(), descriptor_.getName()});
} 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.
*/
try {
AdminObjectResource aor = (AdminObjectResource)
ResourcesUtil.createInstance().getResource(jndiName, appName, moduleName, AdminObjectResource.class);
if(aor != null && ConnectorConstants.DEFAULT_JMS_ADAPTER.equals(aor.getResAdapter())){
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 (Exception e) {
}
}
}
//1.3 durable-subscription-name == 1.4 setSubscriptionName
descriptor_.putRuntimeActivationConfigProperty(
new EnvironmentProperty(SUBSCRIPTION_NAME,
descriptor_.getDurableSubscriptionName(), null));
String mdbCF = null;
try {
mdbCF = descriptor_.getMdbConnectionFactoryJndiName();
} 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