Package com.swiftmq.impl.streams
Class Stream
java.lang.Object
com.swiftmq.impl.streams.Stream
Stream is the entry point for SwiftMQ Streams.
 
 It is passed as a global variable "stream" to Stream Scripts and is used to create and
 access Stream resources such as Memories, Timers, Inputs etc.
- Author:
- IIT Software GmbH, Muenster/Germany, (c) 2016, All Rights Reserved
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionStream(StreamContext ctx, String domainName, String packageName, String name, int restartCount) Internal use only
- 
Method SummaryModifier and TypeMethodDescriptionInternal use onlyaddJDBCLookup(String name, JDBCLookup jdbcLookup) Internal use onlyaddMailServer(String name, MailServer mailServer) Internal use onlyInternal use onlyaddMemoryGroup(String name, MemoryGroup memoryGroup) Internal use onlyInternal use onlyaddTempQueue(String name, TempQueue tempQueue) Internal use onlyInternal use onlyWraps an async callback with a proxy that implements the interface given by the "interfaceClassName" and runs the callback on the Stream's event queue.cli()Returns the stream's CLIvoidclose()Internal use onlyvoidcollect(long interval) Internal use onlycreate()Returns a stream builder to create stream resourcescurrent()Returns the currently processed Message.Sets/overwrites the currently processed Message.voidInternal use onlyReturns the Domain Name of this Stream.executeCallback(FunctionCallback functionCallback, Object context) Executes a function callback in the Stream's event queue.voidInternal use onlyvoidInternal use onlyvoidInternal use onlyvoidInternal use onlyReturns the fully qualified Stream name: domain.package.nameInput[]Internal use onlyInternal use onlyInternal use onlyMemory[]Internal use onlyInternal use onlyOutput[]Internal use onlyInternal useInternal use onlyTimer[]Internal use onlyReturns the working directory of the routerReturns the Input for this TempQueue.Returns the Input with the given name.jdbcLookup(String name) Returns the JDBCLookup with the given name.Returns the last exception occurred on the streamReturns the formatted stack trace of the last exception occurred on the streamlog()Returns the stream's LogDestinationlookupJNDI(String name) Returns a Destination registered in JNDI under this name.mailserver(String name) Returns the MailServer with the given name.Returns the Memory with the given name.memoryGroup(String name) Returns the MemoryGroup with the given name.name()Returns the name of this streamonException(ExceptionCallback runnable) Sets the onException callback.Sets the onMessage callback.Sets the onStart callback.Sets the onStop callback.Returns the Output with the given name.Returns the Package Name of this StreamCloses all Outputs that were not used between the last and this call to this method.QueueImplFactory method to return a new QueueImpl (address)removeInput(Input input) Internal use onlyremoveJDBCLookup(String name) Internal use onlyremoveMailServer(String name) Internal use onlyvoidremoveMemory(Memory memory) Internal use onlyvoidremoveMemoryGroup(MemoryGroup memoryGroup) Internal use onlyremoveOutput(String name) Internal use onlyremoveTempQueue(TempQueue tempQueue) Internal use onlyremoveTimer(Timer timer) Internal use onlyintReturns the restart count of this streamReturns the name of the local Router.voidstart()Internal use onlyReturns the Stream's State Memory that is used by MemoryGroups to store their associated Memories.Returns the TempQueue with the given name.Returns the Timer with the given name.TopicImplFactory method to return a new TopicImpl (address)toString()
- 
Field Details- 
closedpublic boolean closed
 
- 
- 
Constructor Details- 
Streampublic Stream(StreamContext ctx, String domainName, String packageName, String name, int restartCount) Internal use only
 
- 
- 
Method Details- 
getStreamCtxInternal use- Returns:
- stream context
 
- 
routerNameReturns the name of the local Router.- Returns:
- routerName
 
- 
domainNameReturns the Domain Name of this Stream.- Returns:
- domain name
 
- 
packageNameReturns the Package Name of this Stream- Returns:
- package name
 
- 
nameReturns the name of this stream- Returns:
- name
 
- 
fullyQualifiedNameReturns the fully qualified Stream name: domain.package.name- Returns:
- fully qualified name
 
- 
restartCountpublic int restartCount()Returns the restart count of this stream- Returns:
- restart count
 
- 
logReturns the stream's Log- Returns:
- Log
 
- 
cliReturns the stream's CLI- Returns:
- CLI
 
- 
getWorkingDirectoryReturns the working directory of the router- Returns:
 
- 
stateMemoryReturns the Stream's State Memory that is used by MemoryGroups to store their associated Memories.- Returns:
- stateMemory
 
- 
addMemoryInternal use only
- 
addMemoryGroupInternal use only
- 
removeMemoryInternal use only
- 
removeMemoryGroupInternal use only
- 
addTimerInternal use only
- 
removeTimerInternal use only
- 
addInputInternal use only- Throws:
- Exception
 
- 
removeInputInternal use only
- 
addOutputInternal use only
- 
removeOutputInternal use only
- 
addMailServerInternal use only
- 
removeMailServerInternal use only
- 
addJDBCLookupInternal use only
- 
removeJDBCLookupInternal use only
- 
addTempQueueInternal use only
- 
removeTempQueueInternal use only
- 
getTimersInternal use only
- 
getInputsInternal use only
- 
getOutputsInternal use only
- 
getMemoriesInternal use only
- 
deferredClosepublic void deferredClose()Internal use only
- 
getMemoryGroupsInternal use only
- 
getMailserversInternal use only
- 
getJDBCLookupsInternal use only
- 
getTempQueuesInternal use only
- 
createReturns a stream builder to create stream resources- Returns:
- stream builder
 
- 
inputReturns the Input with the given name.- Parameters:
- name- Name of the Input
- Returns:
- Input
 
- 
inputReturns the Input for this TempQueue.- Parameters:
- tempQueue- temp queue
- Returns:
- Input
 
- 
outputReturns the Output with the given name.- Parameters:
- name- Name of the Output
- Returns:
- Output
 
- 
jdbcLookupReturns the JDBCLookup with the given name.- Parameters:
- name- Name of the JDBCLookup
- Returns:
- JDBCLookup
 
- 
mailserverReturns the MailServer with the given name.- Parameters:
- name- Name of the MailServer
- Returns:
- MailServer
 
- 
timerReturns the Timer with the given name.- Parameters:
- name- Name of the Timer
- Returns:
- Timer
 
- 
memoryReturns the Memory with the given name.- Parameters:
- name- Name of the Memory
- Returns:
- Memory
 
- 
memoryGroupReturns the MemoryGroup with the given name.- Parameters:
- name- Name of the MemoryGroup
- Returns:
- MemoryGroup
 
- 
tempQueueReturns the TempQueue with the given name.- Parameters:
- name- Name of the TempQueue
- Returns:
- TempQueue
 
- 
queueFactory method to return a new QueueImpl (address)- Parameters:
- name- queue name
- Returns:
- QueueImpl
 
- 
topicFactory method to return a new TopicImpl (address)- Parameters:
- name- topic name
- Returns:
- TopicImpl
 
- 
lookupJNDIReturns a Destination registered in JNDI under this name.- Parameters:
- name- Name at which the Destination is registered
- Returns:
- Destination
- Throws:
- Exception
 
- 
purgeOutputsCloses all Outputs that were not used between the last and this call to this method.- Returns:
- this
 
- 
currentSets/overwrites the currently processed Message.- Parameters:
- current- current Message
- Returns:
- Stream
 
- 
currentReturns the currently processed Message. This is automatically set from the stream processor before calling onMessage and set to null thereafter.- Returns:
- current Message
 
- 
onMessageSets the onMessage callback.- Parameters:
- runnable- callback
- Returns:
- Stream
 
- 
onExceptionSets the onException callback.- Parameters:
- runnable- callback
- Returns:
 
- 
onStartSets the onStart callback.- Parameters:
- runnable- callback
- Returns:
 
- 
onStopSets the onStop callback.- Parameters:
- runnable- callback
- Returns:
 
- 
executeCallbackExecutes a function callback in the Stream's event queue. This is one method to execute asynchronous calls from libraries. This does not work in GraalVM. Please use stream.async(...)- Parameters:
- functionCallback- callback
- context- optional context
- Returns:
- this
 
- 
asyncWraps an async callback with a proxy that implements the interface given by the "interfaceClassName" and runs the callback on the Stream's event queue. This works on GraalVM and Nashorn.- Parameters:
- interfaceClassName- Fully qualified class name of the interface to implement
- callback- Callback
- Returns:
- proxy object
- Throws:
- Exception
 
- 
lastExceptionReturns the last exception occurred on the stream- Returns:
- last exception
 
- 
lastStackTraceReturns the formatted stack trace of the last exception occurred on the stream- Returns:
- stack trace
 
- 
executeOnExceptionCallbackpublic void executeOnExceptionCallback()Internal use only
- 
executeOnMessageCallbackInternal use only- Throws:
- Exception
 
- 
executeOnStartCallbackpublic void executeOnStartCallback()Internal use only
- 
executeOnStopCallbackpublic void executeOnStopCallback()Internal use only
- 
collectpublic void collect(long interval) Internal use only
- 
startInternal use only- Throws:
- Exception
 
- 
closepublic void close()Internal use only
- 
toString
 
-