Search in sources :

Example 1 with AConnectionEvent

use of util.trace.port.AConnectionEvent in project GIPC by pdewan.

the class AGroupObjectServerInputPort method setGroupSendTrapper.

@Override
public void setGroupSendTrapper(GroupSendTrapper<Object, Object> newVal) {
    this.groupSendTrapper = newVal;
    ConnectiontEventBus.newEvent(new AConnectionEvent(this, newVal, true));
// groupSendTrapper.setDestination(sendTrapperDestination);
}
Also used : AConnectionEvent(util.trace.port.AConnectionEvent)

Example 2 with AConnectionEvent

use of util.trace.port.AConnectionEvent in project GIPC by pdewan.

the class AnAbstractGroupSendTrapper method setDestination.

@Override
public void setDestination(GroupNamingSender<OutMessageType> newVal) {
    destination = newVal;
    ConnectiontEventBus.newEvent(new AConnectionEvent(this, newVal, true));
}
Also used : AConnectionEvent(util.trace.port.AConnectionEvent)

Example 3 with AConnectionEvent

use of util.trace.port.AConnectionEvent in project GIPC by pdewan.

the class AGenericSimplexBufferClientInputPort method setSendTrapper.

public void setSendTrapper(SendTrapper<ByteBuffer, ByteBuffer> newVal) {
    Tracer.info(this, "Set my send trapper to:" + newVal);
    sendTrapper = newVal;
    ConnectiontEventBus.newEvent(new AConnectionEvent(this, newVal, true));
}
Also used : AConnectionEvent(util.trace.port.AConnectionEvent)

Example 4 with AConnectionEvent

use of util.trace.port.AConnectionEvent in project GIPC by pdewan.

the class AnAbstractSimplexBufferVariableServerConnectionsManager method joined.

/*
	 * This is a heavily overloaded method, called bi
	 *called by both session manager and multiserver port
	 *session manager when it joins the session
	 * a multiserver port when it does a group connect,
	 * which calls individual connects through joined
	 * very confusing as a result
	 * The other party may be a late comer server, which would not be  a CLIENT
	 * so that is how we get round to pverloading ParticipantChoice SERVER_ONLy
	 */
@Override
public void joined(SessionParticipantDescription sessionClientDescription) {
    // fillInPeerInfo(sessionClientDescription);
    if (sessionClientDescription.getName().equals(variableServerClientPort.getLocalName()))
        return;
    switch(sessionClientDescription.getParticipantChoice()) {
        case MEMBER:
        case SYMMETRIC_JOIN:
            if (!members.contains(sessionClientDescription)) {
                members.add(sessionClientDescription);
            }
            sessionMemberNames.add(sessionClientDescription.getName());
            break;
        case SERVER_ONLY:
            if (!servers.contains(sessionClientDescription))
                servers.add(sessionClientDescription);
            sessionServerNames.add(sessionClientDescription.getName());
            break;
        case CLIENT_ONLY:
            if (!clients.contains(sessionClientDescription))
                clients.add(sessionClientDescription);
            sessionClientNames.add(sessionClientDescription.getName());
            break;
    }
    sessionParticipantNames.add(sessionClientDescription.getName());
    // do not open connection if you are server and the other party is client
    if (joinChoice == ParticipantChoice.SERVER_ONLY && sessionClientDescription.getParticipantChoice() == ParticipantChoice.CLIENT_ONLY)
        return;
    Tracer.info(this, "Creating client input port for:" + sessionClientDescription);
    if (!sessionClientDescription.getName().equals(variableServerClientPort.getLocalName()) && // this is a client, we cannot open connection to it
    sessionClientDescription.getID() != null) // what does it mean to be client, not have a server port?
    // && joinChoice != ParticipantChoice.SERVER_ONLY) { // what is going on here, do we not want to be client here
    {
        // SimplexClientInputPort clientInputPort = createClientInputPort(sessionClientDescription.getHost(),
        // sessionClientDescription.getID(), sessionClientDescription.getName(), variableServerClientPort.getLocalName());
        // need duplex for the case when this is client-only
        DuplexClientInputPort<ByteBuffer> clientInputPort = createClientInputPort(sessionClientDescription.getHost(), sessionClientDescription.getID(), sessionClientDescription.getName(), variableServerClientPort.getLocalName());
        // fund of sync programming this must go in before connect exception ie caught so that not connected can delete server
        nameToClientInputPort.put(sessionClientDescription.getName(), clientInputPort);
        // clientInputPort.addConnectionListener(this);
        // clientInputPort.addSendListener(this);
        addListenersToClientPort(clientInputPort);
        ConnectiontEventBus.newEvent(new AConnectionEvent(this, clientInputPort, true));
        clientInputPort.connect();
    }
// else {
// bufferBroadcastPort.notifyConnect("session server");
// }
}
Also used : AConnectionEvent(util.trace.port.AConnectionEvent) ByteBuffer(java.nio.ByteBuffer)

Example 5 with AConnectionEvent

use of util.trace.port.AConnectionEvent in project GIPC by pdewan.

the class ASimplexObjectServerInputPort method setReceiveTrapper.

// @Override
public void setReceiveTrapper(ReceiveTrapper<Object, Object> newVal) {
    deserializedObjectForwarder = newVal;
    if (deserializer.getDestination() == null) {
        deserializer.setDestination(deserializedObjectForwarder);
        Tracer.error("deserializer destination is null!");
    }
    ConnectiontEventBus.newEvent(new AConnectionEvent(this, deserializer, false));
// deserializer.setDestination(deserializedObjectForwarder);
}
Also used : AConnectionEvent(util.trace.port.AConnectionEvent)

Aggregations

AConnectionEvent (util.trace.port.AConnectionEvent)15 ByteBuffer (java.nio.ByteBuffer)1 ServerPortDescription (port.sessionserver.ServerPortDescription)1