distributeCredit();
}
private void processEndpoints(Connector c)
{
Connection connection = c.getConnection();
if (connection.getLocalState() == EndpointState.UNINITIALIZED)
{
connection.open();
}
Delivery delivery = connection.getWorkHead();
while (delivery != null)
{
if (delivery.getLink() instanceof Sender && delivery.isUpdated())
{
delivery.disposition(delivery.getRemoteState());
}
//TODO: delivery.clear(); What's the equivalent in java?
delivery = delivery.getWorkNext();
}
_outgoing.slide();
for (Session session : new Sessions(connection, UNINIT, ANY))
{
session.open();
_logger.log(Level.FINE, "Opened session " + session);
}
for (Link link : new Links(connection, UNINIT, ANY))
{
//TODO: the following is not correct; should only copy those properties that we understand
link.setSource(link.getRemoteSource());
link.setTarget(link.getRemoteTarget());
link.open();
_logger.log(Level.FINE, "Opened link " + link);
}
distributeCredit();
for (Link link : new Links(connection, ACTIVE, CLOSED))
{
link.close();
}
for (Session session : new Sessions(connection, ACTIVE, CLOSED))
{
session.close();
}
if (connection.getRemoteState() == EndpointState.CLOSED)
{
if (connection.getLocalState() == EndpointState.ACTIVE)
{
connection.close();
}
}
}