diff options
author | Mark Spruiell <mes@zeroc.com> | 2013-07-08 16:17:45 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2013-07-08 16:17:45 -0700 |
commit | a730826e277b632d002b649fa9de2c6517261e6c (patch) | |
tree | def4940768b03efbc4faea995c2be9d95744c1bd /java/src/IceInternal/Instance.java | |
parent | minor - getMesssage could be null in connectionRefused implementation. (diff) | |
download | ice-a730826e277b632d002b649fa9de2c6517261e6c.tar.bz2 ice-a730826e277b632d002b649fa9de2c6517261e6c.tar.xz ice-a730826e277b632d002b649fa9de2c6517261e6c.zip |
ICE-5338 - null reference error in metrics
Diffstat (limited to 'java/src/IceInternal/Instance.java')
-rw-r--r-- | java/src/IceInternal/Instance.java | 78 |
1 files changed, 49 insertions, 29 deletions
diff --git a/java/src/IceInternal/Instance.java b/java/src/IceInternal/Instance.java index bd20af30ff6..03fbc58c434 100644 --- a/java/src/IceInternal/Instance.java +++ b/java/src/IceInternal/Instance.java @@ -18,36 +18,16 @@ public final class Instance _instance = instance; } - @Override public void + @Override public void updateConnectionObservers() { - try - { - _instance.outgoingConnectionFactory().updateConnectionObservers(); - _instance.objectAdapterFactory().updateConnectionObservers(); - } - catch(Ice.CommunicatorDestroyedException ex) - { - } + _instance.updateConnectionObservers(); } - @Override public void + @Override public void updateThreadObservers() { - try - { - _instance.clientThreadPool().updateObservers(); - ThreadPool serverThreadPool = _instance.serverThreadPool(false); - if(serverThreadPool != null) - { - serverThreadPool.updateObservers(); - } - _instance.objectAdapterFactory().updateThreadObservers(); - _instance.endpointHostResolver().updateObserver(); - } - catch(Ice.CommunicatorDestroyedException ex) - { - } + _instance.updateThreadObservers(); } final private Instance _instance; @@ -585,7 +565,7 @@ public final class Instance public void setThreadHook(Ice.ThreadNotification threadHook) { - // + // // No locking, as it can only be called during plug-in loading // _initData.threadHook = threadHook; @@ -829,15 +809,15 @@ public final class Instance MetricsAdminI admin = new MetricsAdminI(_initData.properties, _initData.logger); _adminFacets.put("Metrics", admin); - + PropertiesAdminI props = new PropertiesAdminI("Properties", _initData.properties, _initData.logger); _adminFacets.put("Properties", props); - + // // Setup the communicator observer only if the user didn't already set an // Ice observer resolver and if the admininistrative endpoints are set. // - if(_initData.observer == null && + if(_initData.observer == null && (_adminFacetFilter.isEmpty() || _adminFacetFilter.contains("Metrics")) && _initData.properties.getProperty("Ice.Admin.Endpoints").length() > 0) { @@ -1089,7 +1069,7 @@ public final class Instance _servantFactoryManager.destroy(); _servantFactoryManager = null; } - + //_referenceFactory.destroy(); // No destroy function defined. _referenceFactory = null; @@ -1160,6 +1140,46 @@ public final class Instance } } + private void + updateConnectionObservers() + { + try + { + assert(_outgoingConnectionFactory != null); + _outgoingConnectionFactory.updateConnectionObservers(); + assert(_objectAdapterFactory != null); + _objectAdapterFactory.updateConnectionObservers(); + } + catch(Ice.CommunicatorDestroyedException ex) + { + } + } + + private void + updateThreadObservers() + { + try + { + if(_clientThreadPool != null) + { + _clientThreadPool.updateObservers(); + } + if(_serverThreadPool != null) + { + _serverThreadPool.updateObservers(); + } + assert(_objectAdapterFactory != null); + _objectAdapterFactory.updateThreadObservers(); + if(_endpointHostResolver != null) + { + _endpointHostResolver.updateObserver(); + } + } + catch(Ice.CommunicatorDestroyedException ex) + { + } + } + private String[] validatePackages() { |