@Override
 public final void process() throws Exception {
   ClientEndpoint endpoint = getEndpoint();
   OperationFactory operationFactory =
       new OperationFactoryWrapper(createOperationFactory(), endpoint.getUuid());
   Map<Integer, Object> map =
       operationService.invokeOnPartitions(getServiceName(), operationFactory, getPartitions());
   Object result = reduce(map);
   endpoint.sendResponse(result, getCallId());
 }
  @Override
  public final void process() throws Exception {
    final ClientEndpoint endpoint = getEndpoint();
    Operation op = prepareOperation();
    op.setCallerUuid(endpoint.getUuid());

    InvocationBuilder builder =
        getInvocationBuilder(op).setResultDeserialized(false).setExecutionCallback(this);

    builder.invoke();
  }
  @Override
  public Set<ClientEndpoint> getEndpoints(String clientUuid) {
    checkNotNull(clientUuid, "clientUuid can't be null");

    Set<ClientEndpoint> endpointSet = new HashSet<ClientEndpoint>();
    for (ClientEndpoint endpoint : endpoints.values()) {
      if (clientUuid.equals(endpoint.getUuid())) {
        endpointSet.add(endpoint);
      }
    }
    return endpointSet;
  }
예제 #4
0
 public void bind(final ClientEndpoint endpoint) {
   final Connection conn = endpoint.getConnection();
   if (conn instanceof TcpIpConnection) {
     Address address = new Address(conn.getRemoteSocketAddress());
     ((TcpIpConnection) conn).setEndPoint(address);
   }
   ClientEvent event =
       new ClientEvent(
           endpoint.getUuid(),
           ClientEventType.CONNECTED,
           endpoint.getSocketAddress(),
           endpoint.getClientType());
   sendClientEvent(event);
 }