ARTEMIS-756 disabling finalize check over CDI Connection Factories
This commit is contained in:
parent
2ee742bd75
commit
e71f3d8a34
|
@ -572,7 +572,9 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
|
||||||
@Override
|
@Override
|
||||||
protected final void finalize() throws Throwable {
|
protected final void finalize() throws Throwable {
|
||||||
if (!closed) {
|
if (!closed) {
|
||||||
ActiveMQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack);
|
if (this.factoryReference.isFinalizeChecks()) {
|
||||||
|
ActiveMQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack);
|
||||||
|
}
|
||||||
|
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,8 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
|
||||||
|
|
||||||
private String deserializationWhiteList;
|
private String deserializationWhiteList;
|
||||||
|
|
||||||
|
private boolean finalizeChecks;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeExternal(ObjectOutput out) throws IOException {
|
public void writeExternal(ObjectOutput out) throws IOException {
|
||||||
URI uri = toURI();
|
URI uri = toURI();
|
||||||
|
@ -148,6 +150,16 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActiveMQConnectionFactory disableFinalizeChecks() {
|
||||||
|
this.finalizeChecks = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFinalizeChecks() {
|
||||||
|
return finalizeChecks;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDeserializationBlackList() {
|
public String getDeserializationBlackList() {
|
||||||
return deserializationBlackList;
|
return deserializationBlackList;
|
||||||
|
|
|
@ -97,6 +97,7 @@ public class ConnectionFactoryProvider {
|
||||||
activeMQConnectionFactory.setUser(configuration.getUsername());
|
activeMQConnectionFactory.setUser(configuration.getUsername());
|
||||||
activeMQConnectionFactory.setPassword(configuration.getPassword());
|
activeMQConnectionFactory.setPassword(configuration.getPassword());
|
||||||
}
|
}
|
||||||
return activeMQConnectionFactory;
|
// The CF will probably be GCed since it was injected, so we disable the finalize check
|
||||||
|
return activeMQConnectionFactory.disableFinalizeChecks();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue