String instanceName = this.glob.validateJmxValue(this.queueId.getId());
this.contextNode = new ContextNode(ContextNode.QUEUE_MARKER_TAG, instanceName,
this.glob.getContextNode()); // TODO: pass from real parent like SubjectInfo
this.mbeanHandle = this.glob.registerMBean(this.contextNode, this);
QueuePluginManager pluginManager = glob.getQueuePluginManager();
QueuePropertyBase queuePropertyBase = (QueuePropertyBase)userData;
try {
this.maxFetchSize = Long.valueOf(pluginProperties.getProperty("maxFetchSize", ""+maxFetchSize)).longValue();
}
catch (Throwable e) {
log.warning(ME+"Setting maxFetchSize failed: " + e.toString());
}
//instantiate and initialize the underlying queues
String defaultTransient = pluginProperties.getProperty("transientQueue", "RAM,1.0").trim();
if (defaultTransient.startsWith(getType())) {
log.severe(ME+"Cache queue configured with transientQueue=CACHE, to prevent recursion we set it to 'RAM,1.0'");
defaultTransient = "RAM,1.0";
}
QueuePropertyBase ramProps = createRamCopy(queuePropertyBase);
ramProps.setEmbedded(true);
this.transientQueue = pluginManager.getPlugin(defaultTransient, uniqueQueueId, ramProps);
//log.error(ME, "Debug only: " + this.transientQueue.toXml(""));
try {
String defaultPersistent = pluginProperties.getProperty("persistentQueue", "JDBC,1.0").trim();
if (defaultPersistent.startsWith(getType())) {
log.severe(ME+"Cache queue configured with persistentQueue=CACHE, to prevent recursion we set it to 'JDBC,1.0'");
defaultPersistent = "JDBC,1.0";
}
boolean oldEmbedded = queuePropertyBase.isEmbedded(); // since a CACHE could be inside a CACHE
queuePropertyBase.setEmbedded(true);
this.persistentQueue = pluginManager.getPlugin(defaultPersistent, uniqueQueueId, queuePropertyBase);
queuePropertyBase.setEmbedded(oldEmbedded); // since it is not a clone we make sure to reset it to its original
this.isConnected = true;
// to be notified about reconnections / disconnections
// this.glob.getJdbcQueueManager(this.queueId).registerListener(this);