Exemplo n.º 1
0
  @Override
  public boolean setValue(Object target, String attrName, Object value, String type) {
    if (JsonIdMap.REMOVE.equals(type) && value != null) {
      attrName = attrName + type;
    }

    if (SocketThread.PROPERTY_IP.equalsIgnoreCase(attrName)) {
      ((SocketThread) target).withIp((String) value);
      return true;
    }

    if (SocketThread.PROPERTY_PORT.equalsIgnoreCase(attrName)) {
      ((SocketThread) target).withPort(Integer.parseInt(value.toString()));
      return true;
    }

    if (SocketThread.PROPERTY_IDMAP.equalsIgnoreCase(attrName)) {
      ((SocketThread) target).withIdMap((org.sdmlib.serialization.SDMLibJsonIdMap) value);
      return true;
    }

    if (SocketThread.PROPERTY_DEFAULTTARGETTHREAD.equalsIgnoreCase(attrName)) {
      ((SocketThread) target).withDefaultTargetThread((Object) value);
      return true;
    }

    return false;
  }
Exemplo n.º 2
0
 @Override
 public void removeObject(Object entity) {
   ((SocketThread) entity).removeYou();
 }