com.cosylab.jcosyne.server
Interface FactorizationMBean

All Superinterfaces:
RemoteTaskMBean, java.lang.Runnable
All Known Implementing Classes:
Factorization

public interface FactorizationMBean
extends RemoteTaskMBean

This example task factorizes a number into primes. The number is set as part of the factorization remote task state, namely LongNumber attribute. The result will be written to output resource, and at the same time published in Factors attribute, which will announce attribute change.

Author:
Gasper Tkacik (gasper.tkacik@cosylab.com)

Method Summary
 long[] getFactors()
          Contains the result of the calculation after factorization finishes.
 long getLongNumber()
          Returns the value set by setLongNumber().
 void setLongNumber(long number)
          Sets the long number that should be factorized.
 
Methods inherited from interface com.cosylab.jcosyne.server.RemoteTaskMBean
copyStateFrom, copyStateFrom, equals, executeScript, getLastScriptResult, getName, getPostExecutionScript, getPostInitializactionScript, getProgress, getState, hashCode, initialize, isFinished, isInitialized, isReadyToRun, isRunning, isSuspended, setPostExecutionScript, setPostInitializationScript, setRunning, setSuspended
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

setLongNumber

public void setLongNumber(long number)
Sets the long number that should be factorized.

Parameters:
number - a number greater than 1

getLongNumber

public long getLongNumber()
Returns the value set by setLongNumber().

Returns:
number to be factorized or 0 if the number has not yet been set

getFactors

public long[] getFactors()
Contains the result of the calculation after factorization finishes.

Returns:
a list of factors of LongNumber