summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/Ice/src/main/java/Ice/Util.java4
-rw-r--r--java/src/Ice/src/main/java/IceInternal/BasicStream.java24
-rw-r--r--java/src/Ice/src/main/java/IceInternal/Incoming.java3
-rw-r--r--java/src/Ice/src/main/java/IceInternal/OutgoingAsync.java2
-rw-r--r--java/src/Ice/src/main/java/IceInternal/OutgoingConnectionFactory.java119
-rw-r--r--java/src/Ice/src/main/java/IceInternal/PropertyNames.java3
-rwxr-xr-xjava/src/IceGridGUI/src/main/java/IceGridGUI/LiveDeployment/Service.java66
7 files changed, 126 insertions, 95 deletions
diff --git a/java/src/Ice/src/main/java/Ice/Util.java b/java/src/Ice/src/main/java/Ice/Util.java
index b2cc28106a3..bd2db69babb 100644
--- a/java/src/Ice/src/main/java/Ice/Util.java
+++ b/java/src/Ice/src/main/java/Ice/Util.java
@@ -571,7 +571,7 @@ public final class Util
public static String
stringVersion()
{
- return "3.6.2"; // "A.B.C", with A=major, B=minor, C=patch
+ return "3.6.3"; // "A.B.C", with A=major, B=minor, C=patch
}
/**
@@ -584,7 +584,7 @@ public final class Util
public static int
intVersion()
{
- return 30602; // AABBCC, with AA=major, BB=minor, CC=patch
+ return 30603; // AABBCC, with AA=major, BB=minor, CC=patch
}
/**
diff --git a/java/src/Ice/src/main/java/IceInternal/BasicStream.java b/java/src/Ice/src/main/java/IceInternal/BasicStream.java
index 5b40a3beb64..e83a2e5234c 100644
--- a/java/src/Ice/src/main/java/IceInternal/BasicStream.java
+++ b/java/src/Ice/src/main/java/IceInternal/BasicStream.java
@@ -412,29 +412,35 @@ public class BasicStream
_readEncapsCache.reset();
}
- public void
- skipEmptyEncaps(Ice.EncodingVersion encoding)
+ public Ice.EncodingVersion
+ skipEmptyEncaps()
{
int sz = readInt();
- if(sz != 6)
+ if(sz < 6)
{
throw new Ice.EncapsulationException();
}
-
- final int pos = _buf.b.position();
- if(pos + 2 > _buf.size())
+ if(sz - 4 > _buf.b.remaining())
{
throw new Ice.UnmarshalOutOfBoundsException();
}
- if(encoding != null)
+ Ice.EncodingVersion encoding = new Ice.EncodingVersion();
+ encoding.__read(this);
+ if(encoding.equals(Ice.Util.Encoding_1_0))
{
- encoding.__read(this);
+ if(sz != 6)
+ {
+ throw new Ice.EncapsulationException();
+ }
}
else
{
- _buf.b.position(pos + 2);
+ // Skip the optional content of the encapsulation if we are expecting an
+ // empty encapsulation.
+ _buf.b.position(_buf.b.position() + sz - 6);
}
+ return encoding;
}
public void
diff --git a/java/src/Ice/src/main/java/IceInternal/Incoming.java b/java/src/Ice/src/main/java/IceInternal/Incoming.java
index 9afd6ed4903..6f1f205854f 100644
--- a/java/src/Ice/src/main/java/IceInternal/Incoming.java
+++ b/java/src/Ice/src/main/java/IceInternal/Incoming.java
@@ -383,8 +383,7 @@ final public class Incoming extends IncomingBase implements Ice.Request
public final void
readEmptyParams()
{
- _current.encoding = new Ice.EncodingVersion();
- _is.skipEmptyEncaps(_current.encoding);
+ _current.encoding = _is.skipEmptyEncaps();
}
public final byte[]
diff --git a/java/src/Ice/src/main/java/IceInternal/OutgoingAsync.java b/java/src/Ice/src/main/java/IceInternal/OutgoingAsync.java
index 8d776c84af4..55050ec5cc6 100644
--- a/java/src/Ice/src/main/java/IceInternal/OutgoingAsync.java
+++ b/java/src/Ice/src/main/java/IceInternal/OutgoingAsync.java
@@ -382,7 +382,7 @@ public class OutgoingAsync extends ProxyOutgoingAsyncBase
public void readEmptyParams()
{
- _is.skipEmptyEncaps(null);
+ _is.skipEmptyEncaps();
}
public byte[] readParamEncaps()
diff --git a/java/src/Ice/src/main/java/IceInternal/OutgoingConnectionFactory.java b/java/src/Ice/src/main/java/IceInternal/OutgoingConnectionFactory.java
index 029de0bbc63..716550dcc78 100644
--- a/java/src/Ice/src/main/java/IceInternal/OutgoingConnectionFactory.java
+++ b/java/src/Ice/src/main/java/IceInternal/OutgoingConnectionFactory.java
@@ -871,26 +871,10 @@ public final class OutgoingConnectionFactory
connectionStartFailed(Ice.ConnectionI connection, Ice.LocalException ex)
{
assert(_current != null);
-
- if(_observer != null)
- {
- _observer.failed(ex.ice_name());
- _observer.detach();
- }
-
- _factory.handleConnectionException(ex, _hasMore || _iter.hasNext());
- if(ex instanceof Ice.CommunicatorDestroyedException) // No need to continue.
- {
- _factory.finishGetConnection(_connectors, ex, this);
- }
- else if(_iter.hasNext()) // Try the next connector.
+ if(connectionStartFailedImpl(ex))
{
nextConnector();
}
- else
- {
- _factory.finishGetConnection(_connectors, ex, this);
- }
}
//
@@ -1059,52 +1043,83 @@ public final class OutgoingConnectionFactory
private void
nextConnector()
{
- Ice.ConnectionI connection = null;
- try
+ while(true)
{
- assert(_iter.hasNext());
- _current = _iter.next();
-
- Ice.Instrumentation.CommunicatorObserver obsv = _factory._instance.initializationData().observer;
- if(obsv != null)
+ try
{
- _observer = obsv.getConnectionEstablishmentObserver(_current.endpoint,
- _current.connector.toString());
- if(_observer != null)
+ assert(_iter.hasNext());
+ _current = _iter.next();
+
+ Ice.Instrumentation.CommunicatorObserver obsv = _factory._instance.initializationData().observer;
+ if(obsv != null)
{
- _observer.attach();
+ _observer = obsv.getConnectionEstablishmentObserver(_current.endpoint,
+ _current.connector.toString());
+ if(_observer != null)
+ {
+ _observer.attach();
+ }
}
- }
- if(_factory._instance.traceLevels().network >= 2)
- {
- StringBuffer s = new StringBuffer("trying to establish ");
- s.append(_current.endpoint.protocol());
- s.append(" connection to ");
- s.append(_current.connector.toString());
- _factory._instance.initializationData().logger.trace(_factory._instance.traceLevels().networkCat,
- s.toString());
+ if(_factory._instance.traceLevels().network >= 2)
+ {
+ StringBuffer s = new StringBuffer("trying to establish ");
+ s.append(_current.endpoint.protocol());
+ s.append(" connection to ");
+ s.append(_current.connector.toString());
+ _factory._instance.initializationData().logger.trace(_factory._instance.traceLevels().networkCat,
+ s.toString());
+ }
+
+ Ice.ConnectionI connection = _factory.createConnection(_current.connector.connect(), _current);
+ connection.start(this);
}
+ catch(Ice.LocalException ex)
+ {
+ if(_factory._instance.traceLevels().network >= 2)
+ {
+ StringBuffer s = new StringBuffer("failed to establish ");
+ s.append(_current.endpoint.protocol());
+ s.append(" connection to ");
+ s.append(_current.connector.toString());
+ s.append("\n");
+ s.append(ex);
+ _factory._instance.initializationData().logger.trace(_factory._instance.traceLevels().networkCat,
+ s.toString());
+ }
- connection = _factory.createConnection(_current.connector.connect(), _current);
- connection.start(this);
+ if(connectionStartFailedImpl(ex))
+ {
+ continue;
+ }
+ }
+ break;
}
- catch(Ice.LocalException ex)
+ }
+
+ private boolean
+ connectionStartFailedImpl(Ice.LocalException ex)
+ {
+ if(_observer != null)
{
- if(_factory._instance.traceLevels().network >= 2)
- {
- StringBuffer s = new StringBuffer("failed to establish ");
- s.append(_current.endpoint.protocol());
- s.append(" connection to ");
- s.append(_current.connector.toString());
- s.append("\n");
- s.append(ex);
- _factory._instance.initializationData().logger.trace(_factory._instance.traceLevels().networkCat,
- s.toString());
- }
+ _observer.failed(ex.ice_name());
+ _observer.detach();
+ }
- connectionStartFailed(connection, ex);
+ _factory.handleConnectionException(ex, _hasMore || _iter.hasNext());
+ if(ex instanceof Ice.CommunicatorDestroyedException) // No need to continue.
+ {
+ _factory.finishGetConnection(_connectors, ex, this);
+ }
+ else if(_iter.hasNext()) // Try the next connector.
+ {
+ return true;
+ }
+ else
+ {
+ _factory.finishGetConnection(_connectors, ex, this);
}
+ return false;
}
private final OutgoingConnectionFactory _factory;
diff --git a/java/src/Ice/src/main/java/IceInternal/PropertyNames.java b/java/src/Ice/src/main/java/IceInternal/PropertyNames.java
index aa32d10549c..2cc1df08f15 100644
--- a/java/src/Ice/src/main/java/IceInternal/PropertyNames.java
+++ b/java/src/Ice/src/main/java/IceInternal/PropertyNames.java
@@ -6,7 +6,7 @@
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
-// Generated by makeprops.py from file ./config/PropertyNames.xml, Tue Apr 28 22:03:41 2015
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Thu Apr 7 10:23:17 2016
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -125,6 +125,7 @@ public final class PropertyNames
new Property("Ice\\.IPv4", false, null),
new Property("Ice\\.IPv6", false, null),
new Property("Ice\\.LogFile", false, null),
+ new Property("Ice\\.LogFile\\.SizeMax", false, null),
new Property("Ice\\.LogStdErr\\.Convert", false, null),
new Property("Ice\\.MessageSizeMax", false, null),
new Property("Ice\\.Nohup", false, null),
diff --git a/java/src/IceGridGUI/src/main/java/IceGridGUI/LiveDeployment/Service.java b/java/src/IceGridGUI/src/main/java/IceGridGUI/LiveDeployment/Service.java
index 7ad220f4ac3..0e9c108595f 100755
--- a/java/src/IceGridGUI/src/main/java/IceGridGUI/LiveDeployment/Service.java
+++ b/java/src/IceGridGUI/src/main/java/IceGridGUI/LiveDeployment/Service.java
@@ -170,28 +170,24 @@ public class Service extends ListArrayTreeNode
{
if(_showIceLogDialog == null)
{
- Ice.ObjectPrx serverAdmin = ((Server)_parent).getServerAdmin();
- if(serverAdmin == null)
+ Ice.LoggerAdminPrx loggerAdmin = Ice.LoggerAdminPrxHelper.uncheckedCast(getAdminFacet("Logger"));
+ if(loggerAdmin == null)
{
- JOptionPane.showMessageDialog(getCoordinator().getMainFrame(), "Admin not available",
+ JOptionPane.showMessageDialog(getCoordinator().getMainFrame(), "Admin not available",
"No Admin for server " + _parent.getId(), JOptionPane.ERROR_MESSAGE);
return;
}
-
- // TODO: add support for shared communicator
-
- Ice.LoggerAdminPrx loggerAdmin = Ice.LoggerAdminPrxHelper.uncheckedCast(
- serverAdmin.ice_facet("IceBox.Service." + _id + ".Logger"));
+
String title = "Service " + _parent.getId() + "/" + _id + " Ice log";
- _showIceLogDialog = new ShowIceLogDialog(this, title, loggerAdmin, _parent.getId() + "-" + _id,
+ _showIceLogDialog = new ShowIceLogDialog(this, title, loggerAdmin, _parent.getId() + "-" + _id,
getRoot().getLogMaxLines(), getRoot().getLogInitialLines());
- }
+ }
else
{
_showIceLogDialog.toFront();
}
}
-
+
@Override
public void retrieveLogFile()
{
@@ -311,14 +307,14 @@ public class Service extends ListArrayTreeNode
la.setTarget(this);
return _popup;
}
-
+
@Override
public void clearShowIceLogDialog()
{
_showIceLogDialog = null;
}
-
-
+
+
Service(Server parent, String serviceName, Utils.Resolver resolver, ServiceInstanceDescriptor descriptor,
ServiceDescriptor serviceDescriptor, PropertySetDescriptor serverInstancePSDescriptor)
{
@@ -344,7 +340,7 @@ public class Service extends ListArrayTreeNode
_showIceLogDialog.stopped();
}
}
-
+
boolean updateAdapter(AdapterDynamicInfo info)
{
for(Adapter p : _adapters)
@@ -415,9 +411,8 @@ public class Service extends ListArrayTreeNode
void showRuntimeProperties()
{
- Ice.ObjectPrx serverAdmin = ((Server)_parent).getServerAdmin();
-
- if(serverAdmin == null)
+ Ice.PropertiesAdminPrx propAdmin = Ice.PropertiesAdminPrxHelper.uncheckedCast(getAdminFacet("Properties"));
+ if(propAdmin == null)
{
_editor.setBuildId("", this);
}
@@ -467,9 +462,6 @@ public class Service extends ListArrayTreeNode
try
{
- Ice.PropertiesAdminPrx propAdmin =
- Ice.PropertiesAdminPrxHelper.uncheckedCast(serverAdmin.ice_facet("IceBox.Service." + _id +
- ".Properties"));
propAdmin.begin_getPropertiesForPrefix("", cb);
}
catch(Ice.LocalException e)
@@ -550,15 +542,12 @@ public class Service extends ListArrayTreeNode
return; // Already loaded.
}
- Ice.ObjectPrx serverAdmin = ((Server)_parent).getServerAdmin();
- if(serverAdmin == null)
+ final IceMX.MetricsAdminPrx metricsAdmin = IceMX.MetricsAdminPrxHelper.uncheckedCast(getAdminFacet("Metrics"));
+ if(metricsAdmin == null)
{
return;
}
_metricsRetrieved = true;
- final IceMX.MetricsAdminPrx metricsAdmin =
- IceMX.MetricsAdminPrxHelper.uncheckedCast(serverAdmin.ice_facet("IceBox.Service." + _id +
- ".Metrics"));
IceMX.Callback_MetricsAdmin_getMetricsViewNames cb = new IceMX.Callback_MetricsAdmin_getMetricsViewNames()
{
@@ -603,7 +592,7 @@ public class Service extends ListArrayTreeNode
else
{
e.printStackTrace();
- JOptionPane.showMessageDialog(getCoordinator().getMainFrame(),
+ JOptionPane.showMessageDialog(getCoordinator().getMainFrame(),
"Error: " + e.toString(), "Error",
JOptionPane.ERROR_MESSAGE);
}
@@ -653,6 +642,27 @@ public class Service extends ListArrayTreeNode
getRoot().getTreeModel().nodeStructureChanged(this);
}
+ private Ice.ObjectPrx getAdminFacet(String facet)
+ {
+ Server parent = (Server)_parent;
+ Ice.ObjectPrx serverAdmin = parent.getServerAdmin();
+ if(serverAdmin == null)
+ {
+ return null;
+ }
+ try
+ {
+ if(Integer.valueOf(parent.getProperties().get("IceBox.UseSharedCommunicator." + _id)) > 0)
+ {
+ return serverAdmin.ice_facet("IceBox.SharedCommunicator." + facet);
+ }
+ }
+ catch(NumberFormatException ex)
+ {
+ }
+ return serverAdmin.ice_facet("IceBox.Service." + _id + "." + facet);
+ }
+
private final ServiceInstanceDescriptor _instanceDescriptor;
private final ServiceDescriptor _serviceDescriptor;
private final PropertySetDescriptor _serverInstancePSDescriptor;
@@ -666,7 +676,7 @@ public class Service extends ListArrayTreeNode
private boolean _metricsRetrieved = false;
private ShowIceLogDialog _showIceLogDialog;
-
+
static private ServiceEditor _editor;
static private DefaultTreeCellRenderer _cellRenderer;
static private JPopupMenu _popup;