- TIBCO BusinessEvents®
- Standard
- Cluster

# Cluster

## Description

Functions to operate on the cluster

## Categories

Name | Description
--- | ---
`DataGrid` | Functions to operate on the cluster
`Sequence` | Functions to operate on Sequence across the cluster

## Functions

Name | Signature and Synopsis
--- | ---
`createLocalNamedPipe` | `boolean createLocalNamedPipe(String pipeName, int capacity)` Creates a per-JVM in-memory blocking queue/pipe for inter-thread communication.
`createScheduler` | `void createScheduler(String schedulerName, long pollInterval, long refreshAhead)` Creates a cluster wide scheduler for time dependent jobs
`createWorkManager` | `void createWorkManager(String name, int threadPool)` Creates a work manager to schedule background jobs
`executeRuleFunction` | `void runRuleFunction(String workMgrName, String ruleFnURI, boolean bInPreprocessContext, Object... args)` This function runs a rule function inside the context of a work manager
`getAgentId` | `int getAgentId()` Returns the unique id of the agent
`getAgentName` | `String getAgentName()` Returns the agent name
`getClusterName` | `String getClusterName()` Returns the name of the BE cluster that this agent is connected
`getLocalNamedPipeCurrentSize` | `int getLocalNamedPipeCurrentSize(String pipeName)` Retrieves the current size of the pipe.
`getScheduleTime` | `long getScheduleTime(String schedulerName, String workKey)`
`getSiteId` | `long getSiteId()`
`isEventRecovered` | `boolean isEventRecovered(SimpleEvent evt)` This function returns true if the passed event is received from another agent in the cluster. The function will return false if the event was created in this agent.
`pollMessageFromLocalNamedPipe` | `Object pollMessageFromLocalNamedPipe(String pipeName)` Receive a message if one is available on the pipe.
`registerStateMachineTimeoutCallback` | `void registerStateMachineTimeoutCallback(String entityURI, String ruleFunctionURI)` Register a rule function to pre-process state machine timeouts. The pre-processor should be used to load and/or lock associated objects.
`removeSchedule` | `void removeSchedule(String schedulerName, String workKey)` Removes a previously scheduled task
`runRuleFunction` | `void runRuleFunction(String workMgrName, String ruleFnURI, Object[] args, boolean bInPreprocessContext)` This function runs a ruleFunction continously as per the return status of the ruleFunction
`scheduleEvent` | `void scheduleEvent(String schedulerName, String workKey, SimpleEvent event, long scheduledTime)` Schedules a simple event to be sent to the default destination after `scheduledTime`. The scheduled time is represented in milliseconds from January 1, 1970 (the UNIX epoch).
`scheduleRepeatingEvent` | `void scheduleRepeatingEvent(String schedulerName, String workKey, SimpleEvent event, DateTime startingDate, long interval)` Schedules a simple event to be sent to the default destination beginning on `startingDate`, and repeating every `interval` milliseconds. It is recommended to specify starting date/time using `DateTime.createTime()` e.g. DateTime.createTime(2014, 0, 1, 0, 0, 0, null).
`sendMessageOverLocalNamedPipe` | `void sendMessageOverLocalNamedPipe(String pipeName, Object message)` Send a message over the pipe.
`sendMessagesOverLocalNamedPipe` | `void sendMessagesOverLocalNamedPipe(String pipeName, Object collection)` Send a `java.util.Collection` full of messages over the pipe.
`stopWorkManager` | `void stopWorkManager(String name)` Shuts down the work manager. This call will wait for all the current jobs to finish
`typeIdToURI` | `String typeIdToURI(int typeId)` Returns the design time URI for the typeId
`waitForMessageFromLocalNamedPipe` | `Object waitForMessageFromLocalNamedPipe(String pipeName, long timeoutMillis)`