code: public String serialize(final Object serviceState) throws InvalidStateException, CouldNotPerformException {
          String jsonStringRep;
          if (serviceState instanceof Message) {
              try {
                  jsonStringRep = jsonFormat.printToString((Message) serviceState);
              } catch (Exception ex) {
                  throw new CouldNotPerformException("Could not serialize service argument to string!", ex);
              }
          } else {
              throw new InvalidStateException("Service attribute Class[" + serviceState.getClass().getSimpleName() + "] not a protobuf message!");
          }
  
          return jsonStringRep;
      }
docs: Serialize a serviceState which can be a proto message, enumeration or
  a java primitive to string. If its a primitive toString is called while
  messages or enumerations will be serialized into JSon
  
  @param serviceState
  
  @return
  
  @throws org.openbase.jul.exception.InvalidStateException in case the given service argument does not contain any context.
  @throws CouldNotPerformException                         in case the serialization failed.
  <p>
  TODO: release: change parameter type to message since java primitives cannot be de-/serialized anymore anyway