Class APITypeManager

java.lang.Object
org.bonitasoft.engine.util.APITypeManager

public class APITypeManager extends Object
Specify how the client communicate with the engine. There are three ways of doing it:
  • Using Java System Properties
  • Programmatically
  • DEPRECATED: using a file inside bonita-home. See online documentation.

Using Java System Properties

Use System property -Dorg.bonitasoft.engine.api-type=

  • LOCAL:

    connect to the server in the local JVM (default). No other configuration is necessary.

  • HTTP

    connect to the server using HTTP. You must also specify:

    • -Dorg.bonitasoft.engine.api-type.server.url=HTTP_SERVER_URL, e.g. http://localhost:8080
    • -Dorg.bonitasoft.engine.api-type.application.name=WEBAPP_NAME, this is the name of the web application, e.g. bonita
    Optionally you can specify the maximum number of connections (JVM-wide) using -Dorg.bonitasoft.engine.api-type.connections.max=CONNECTIONS_MAX

  • TCP

    not recommended, only for testing purpose.

Programmatically

  • LOCAL access:

    APITypeManager.setAPITypeAndParams(ApiAccessType.LOCAL, null);

  • HTTP access:
     HashMap<String, String> parameters = new HashMap<>();
     parameters.put("server.url", "http://myserver.com:8080");
     parameters.put("application.name", "bonita-application");
     parameters.put("connections.max", "5");
     APITypeManager.setAPITypeAndParams(ApiAccessType.HTTP, parameters);
     
See Also: