eu.larkc.core
Class Larkc

java.lang.Object
  extended by eu.larkc.core.Larkc

public final class Larkc
extends java.lang.Object

Main entry point to the LarKC platform

Author:
Blaz Fortuna, Luka Bradesko, Christoph Fuchs, Matthias Assel

Constructor Summary
Larkc()
           
 
Method Summary
static void addWorkflowExecutorMapping(java.util.UUID workflowId, Executor executor)
          This method adds a workflow - executor mapping.
static int findNextFreePort(int port)
          Gets a free port for next executor trial and error.
static java.lang.String getClassName(java.lang.String type)
          Gets the class name for the endpoint of the specific type.
static Executor getExecutor(java.util.UUID workflowId)
          This method returns executor for a specific workflow id.
static LarkcKBStatus getKBStatus()
          Returns the status of the KB
static PlatformStatus getPlatformStatus()
          Returns the status of the platform
static PluginRegistry getPluginRegistry()
          Getter.
static ResourceRegistry getResourceRegistry()
          Getter.
static void initialize()
          Deprecated. 
static boolean isInitialized()
          Checks if the platform is running and has been initialized properly.
static void main(java.lang.String[] args)
          Main method of the LarKC platform.
static void setKBStatus(LarkcKBStatus status)
          Sets the status of the KB
static void start()
          Starts the LarKC platform.
static void stop()
          Stops the LarKC platform.
static void terminateExecutor(java.util.UUID workflowId)
          This method terminates the executor which is responsible for the specific workflow.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Larkc

public Larkc()
Method Detail

main

public static void main(java.lang.String[] args)
Main method of the LarKC platform. If no arguments are provided the following arguments will be used:
-i path_to/larkc-init.lisp -b
-i is the parameter for specifying the larkc-init.lisp file, where are commands what to run after initial (skeleton) start -b is a switch, which prevents the console input, which is disabled in LarKC

Parameters:
args -

start

public static void start()
Starts the LarKC platform. Call this to start and initialize the platform. Calls the main method without any arguments.

See Also:
main(String[])

initialize

@Deprecated
public static void initialize()
Deprecated. 

Initializes the platform. Invoked via LarkcInit Should not be called directly. This method is marked Deprecated since it should not be called directly. Use start() instead.

See Also:
start()

getPlatformStatus

public static PlatformStatus getPlatformStatus()
Returns the status of the platform

Returns:
the PlatformStatus which indicates the current status of the platform
See Also:
PlatformStatus

getKBStatus

public static LarkcKBStatus getKBStatus()
Returns the status of the KB

Returns:
the LarkcKBStatus which indicates the current status of the KB
See Also:
LarkcKBStatus

setKBStatus

public static void setKBStatus(LarkcKBStatus status)
Sets the status of the KB

Parameters:
status - the new LarkcKBStatus
See Also:
LarkcKBStatus

isInitialized

public static boolean isInitialized()
Checks if the platform is running and has been initialized properly.

Returns:
true if the platform is running and has been initialized properly, false otherwise.

getPluginRegistry

public static PluginRegistry getPluginRegistry()
Getter. Retrieves the pluginRegistry.

Returns:
the pluginRegistry

getResourceRegistry

public static ResourceRegistry getResourceRegistry()
Getter. Retrieves the resourceRegistry.

Returns:
the resourceRegistry

addWorkflowExecutorMapping

public static void addWorkflowExecutorMapping(java.util.UUID workflowId,
                                              Executor executor)
This method adds a workflow - executor mapping.

Parameters:
workflowId - the workflow id
executor - the executor

terminateExecutor

public static void terminateExecutor(java.util.UUID workflowId)
                              throws EndpointShutdownException
This method terminates the executor which is responsible for the specific workflow.

Parameters:
workflowId - the workflow
Throws:
EndpointShutdownException - if one or more endpoints are unable to shutdown

getExecutor

public static Executor getExecutor(java.util.UUID workflowId)
This method returns executor for a specific workflow id.

Parameters:
workflowId - the workflow id
Returns:
the executor for this workflow id

getClassName

public static java.lang.String getClassName(java.lang.String type)
Gets the class name for the endpoint of the specific type.

Parameters:
type - type of the endpoint
Returns:
the class name

findNextFreePort

public static int findNextFreePort(int port)
Gets a free port for next executor trial and error. On error (if the port is already used) the port will be incremented.

Parameters:
port - the port to start from
Returns:
a free port for next executor

stop

public static void stop()
                 throws EndpointShutdownException
Stops the LarKC platform. The intention of this method is to provide a clear teardown of the platform and all its components.

Throws:
EndpointShutdownException - on endpoint shutdown errors (e.g. if a server was unable to shutdown)