org.kde.koala
public class Scheduler extends QObject implements DCOPObjectInterface
TransferJob job = KIO.get(KURL("http://www.kde.org"));
TransferJob job = KIO.get(KURL("http://www.kde.org")); KIO.Scheduler.scheduleJob(job);
Slave slave = KIO.Scheduler.getConnectedSlave( KURL("pop3://bastian:password@mail.kde.org")); TransferJob job1 = KIO.get( KURL("pop3://bastian:password@mail.kde.org/msg1")); KIO.Scheduler.assignJobToSlave(slave, job1); TransferJob job2 = KIO.get( KURL("pop3://bastian:password@mail.kde.org/msg2")); KIO.Scheduler.assignJobToSlave(slave, job2); TransferJob job3 = KIO.get( KURL("pop3://bastian:password@mail.kde.org/msg3")); KIO.Scheduler.assignJobToSlave(slave, job3); // ... Wait for jobs to finish... KIO.Scheduler.disconnectSlave(slave);Note that you need to explicitly disconnect the slave when the connection goes down, so your error handler should contain:
if (error == KIO.ERR_CONNECTION_BROKEN) KIO.Scheduler.disconnectSlave(slave);See SchedulerSignals for signals emitted by Scheduler
UNKNOWN: The KIO.Scheduler manages io-slaves for the application.
Constructor Summary | |
---|---|
protected | Scheduler(Class dummy) |
Scheduler() |
Method Summary | |
---|---|
static boolean | assignJobToSlave(Slave slave, SimpleJob job) |
DCOPClient | callingDcopClient()
Returns the DCOPClient responsible for making the call.
|
static void | cancelJob(SimpleJob job)
Stop the execution of a job. |
static void | checkSlaveOnHold(boolean b)
When true, the next job will check whether KLauncher has a slave
on hold that is suitable for the job. |
String | className() |
boolean | connect(QObject sender, String signal, String member) |
static boolean | connect(String signal, QObject receiver, String member)
Function to connect signals emitted by the scheduler. |
static boolean | connect(QObject sender, String signal, QObject receiver, String member) |
boolean | connectDCOPSignal(String sender, String senderObj, String signal, String slot, boolean Volatile)
Connects to a DCOP signal. |
void | debug_info() |
static boolean | disconnect(QObject sender, String signal, QObject receiver, String member) |
boolean | disconnectDCOPSignal(String sender, String senderObj, String signal, String slot)
Disconnects a DCOP signal.
|
static boolean | disconnectSlave(Slave slave) |
static void | doJob(SimpleJob job)
Register job with the scheduler.
|
void | emitDCOPSignal(String signal, byte[] data)
Emit signal as DCOP signal from this object with data as
arguments |
static DCOPObjectInterface | find(String objId)
Try to find a dcop object with the given id.
|
ArrayList | functions() |
ArrayList | functionsDynamic()
This function is of interest when you used an IDL compiler
to generate the implementation for functions() but
you still want to list some functions dynamically.
|
static Slave | getConnectedSlave(KURL url)
Requests a slave for use in connection-oriented mode. |
static boolean | hasObject(String objId)
Checks whether an object with the given id is known in this process.
|
ArrayList | interfaces()
Returns the names of the interfaces, specific ones last. |
ArrayList | interfacesDynamic()
This function is of interest when you used an IDL compiler
to generate the implementation for interfaces() but
you still want to list some interfaces dynamically.
|
static void | jobFinished(SimpleJob job, Slave slave)
Called when a job is done. |
QMetaObject | metaObject() |
static String | objectName(QObject arg1)
Creates an object id for the QObject obj. This is done
using the QObject.name() function. |
String | objId()
Returns the object id of the DCOPObject. |
boolean | process(String fun, byte[] data, StringBuffer replyType, byte[] replyData) |
boolean | processDynamic(String fun, byte[] data, StringBuffer replyType, byte[] replyData)
This function is of interest when you used an IDL compiler
to generate the implementation for process() but
you still want to dispatch some functions dynamically.
|
static void | publishSlaveOnHold()
Send the slave that was put on hold back to KLauncher. |
static void | putSlaveOnHold(SimpleJob job, KURL url)
Puts a slave on notice. |
static void | registerWindow(QWidget wid)
Send the slave that was put on hold back to KLauncher. |
static void | removeSlaveOnHold()
Removes any slave that might have been put on hold. |
static void | scheduleJob(SimpleJob job)
Calling ths function makes that job gets scheduled for later
execution, if multiple jobs are registered it might wait for
other jobs to finish. |
void | setCallingDcopClient(DCOPClient arg1) |
boolean | setObjId(String objId)
Renames a dcop object, if no other with the same name exists
Use with care, all dcop signals are disconnected |
protected void | setupSlave(Slave slave, KURL url, String protocol, String proxy, boolean newSlave) |
protected void | slotCleanIdleSlaves() |
protected void | slotScheduleCoSlave() |
protected void | slotSlaveConnected() |
void | slotSlaveDied(Slave slave) |
protected void | slotSlaveError(int error, String errorMsg) |
void | slotSlaveStatus(int pid, String protocol, String host, boolean connected) |
protected void | slotUnregisterWindow(QObject arg1) |
protected boolean | startJobDirect() |
protected void | startStep() |
static void | unregisterWindow(QObject wid)
Unregisters the window registered by registerWindow(). |
Returns: the DCOPClient responsible for making the call. This information is only guaranteed to be correct when entering your DCOP function.
UNKNOWN: Returns the DCOPClient responsible for making the call.
Parameters: job the job to cancel
UNKNOWN: Stop the execution of a job.
Parameters: b true when KLauncher has a job on hold
UNKNOWN: When true, the next job will check whether KLauncher has a slave on hold that is suitable for the job.
UNKNOWN: Function to connect signals emitted by the scheduler.
Parameters: sender the name of the client that emits the signal. When empty
the signal will be passed from any client. senderObj the name of the sending object that emits the signal. signal the name of the signal. The arguments should match with slot. slot The name of the slot to call. Its arguments should match with signal. Volatile If true, the connection will not be reestablished when
sender
unregisters and reregisters with DCOP. In this case the sender
must be registered when the connection is made.
If false, the connection will be reestablished when sender
reregisters.
In this case the connection can be made even if sender
is not registered
at that time.
Volatile
is true and sender
does not exist.
signal
and slot
do not have matching arguments.
UNKNOWN: Connects to a DCOP signal.
sender
& signal
are empty. In this
case all connections related to this object in the current client
are disconnected. (Both connections from as well as to this object!)Parameters: sender the name of the client that emits the signal. senderObj the name of the object that emits the signal. If empty all objects will be disconnected. signal the name of the signal. The arguments should match with slot. If empty all objects will be disconnected. slot The name of the slot the signal is connected to. If empty all slots will be disconnected.
Returns: false if no connection(s) where removed.
UNKNOWN: Disconnects a DCOP signal.
job
with the scheduler.
The default is to create a new slave for the job if no slave
is available. This can be changed by calling scheduleJob.Parameters: job the job to register
UNKNOWN: Register job
with the scheduler.
signal
as DCOP signal from this object with data
as
argumentsParameters: signal the signal to emit data the data to send
UNKNOWN: Emit signal
as DCOP signal from this object with data
as arguments
Parameters: objId the object id to search
Returns: the DCOPObject for the id objId.
UNKNOWN: Try to find a dcop object with the given id.
Returns: A list of the additional functions, default is an empty list.
See Also: Scheduler
UNKNOWN: This function is of interest when you used an IDL compiler to generate the implementation for functions() but you still want to list some functions dynamically.
Parameters: url This defines the username,password,host & port to connect with. config Configuration data for the slave.
Returns: A pointer to a connected slave or 0 if an error occurred.
UNKNOWN: Requests a slave for use in connection-oriented mode.
Returns: true if an object with the questionable objId
is
known in this process. This query does not ask proxies.
UNKNOWN: Checks whether an object with the given id is known in this process.
Returns: a list of interfaces
See Also: Scheduler
UNKNOWN: Returns the names of the interfaces, specific ones last.
Returns: A list of the additional interfaces, default is an empty list.
See Also: Scheduler
UNKNOWN: This function is of interest when you used an IDL compiler to generate the implementation for interfaces() but you still want to list some interfaces dynamically.
Parameters: job the finished job slave the slave that executed the job
UNKNOWN: Called when a job is done.
obj.
This is done
using the QObject.name() function.Parameters: obj the object whose name will be used
Returns: the created object id
UNKNOWN: Creates an object id for the QObject obj.
Returns: the object's id
UNKNOWN: Returns the object id of the DCOPObject.
Parameters: fun is the normalized function signature. Such a signature usually looks like foobar(String,int). The return type, qualifiers like "const" etc. are not part of the signature. data the received data replyType write the reply type in this string replyData write the reply data in this array
Returns: true if successful, false otherwise. The default implementation returns always false.
See Also: Scheduler DCOPClient Scheduler DCOPClient
UNKNOWN: This function is of interest when you used an IDL compiler to generate the implementation for process() but you still want to dispatch some functions dynamically.
UNKNOWN: Send the slave that was put on hold back to KLauncher.
Parameters: job the job that should be stopped url the URL that is handled by the url
UNKNOWN: Puts a slave on notice.
wid
with the KIO subsystem
Do not call this, it is called automatically from
void KIO.Job.setWindow(QWidget).Parameters: wid the window to register
UNKNOWN: Send the slave that was put on hold back to KLauncher.
UNKNOWN: Removes any slave that might have been put on hold.
job
gets scheduled for later
execution, if multiple jobs are registered it might wait for
other jobs to finish.Parameters: job the job to schedule
UNKNOWN: Calling ths function makes that job
gets scheduled for later execution, if multiple jobs are registered it might wait for other jobs to finish.
UNKNOWN:
Parameters: objId the new object id
UNKNOWN: Renames a dcop object, if no other with the same name exists Use with care, all dcop signals are disconnected
UNKNOWN: