Top Fields Constructors Methods
org.apache.derby.impl.store.raw.data

pack-priv final Class RemoveFile

Located in compilation unit of org.apache.derby.impl.store.raw.data.RFResource.

extends Object
implements Serviceable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.daemon.Serviceable

Field Summary

Modifier and TypeField and Description
private final StorageFile

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
performWork(ContextManager
the contextManager set up by the DaemonService. There may or may not be the necessary context on it, depending on which other Serviceable object it has done work for.
context
)

Implements org.apache.derby.iapi.services.daemon.Serviceable.performWork.

Do whatever it is that you want the daemon to do for you.

public Object
run()

public boolean
serviceASAP()

Implements org.apache.derby.iapi.services.daemon.Serviceable.serviceASAP.

If this work should be done as soon as possible, then return true.

public boolean

Returns:

true, this work needs to done on user thread.
serviceImmediately
()

Implements org.apache.derby.iapi.services.daemon.Serviceable.serviceImmediately.

File deletion is a quick operation and typically releases substantial amount of space very quickly, this work should be done on the user thread.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fileToGoback to summary
private final StorageFile fileToGo

Constructor Detail

RemoveFileback to summary
pack-priv RemoveFile(StorageFile fileToGo)

Method Detail

performWorkback to summary
public int performWork(ContextManager context) throws StandardException

Implements org.apache.derby.iapi.services.daemon.Serviceable.performWork.

Doc from org.apache.derby.iapi.services.daemon.Serviceable.performWork.

Do whatever it is that you want the daemon to do for you. There may be multiple daemon objects on different thread calling performWork at the same time. The DaemonService will always call performWork with a context manager set up. the DaemonService will clean up the context if an exception is thrown. However, it is up to performWork to manage its own transaction. If you start a transaction in performWork, you must commit or abort it at the end. You may leave the transaction open so that other serviceable may use the transaction and context without starting a new one. On the same token, there may already be an opened transaction on the context. Serviceable performWork should always check the state of the context before use. A Serviceable object should be well behaved while it is performing the daemon work, i.e., it should not take too many resources or hog the CPU for too long or deadlock with anyone else.

Parameters
context:ContextManager

the contextManager set up by the DaemonService. There may or may not be the necessary context on it, depending on which other Serviceable object it has done work for.

Returns:int

the return status is only significant if the Serviceable client was enqueued instead of subscribed. For subscribed client, the return status is ignored. For enqueue client, it returns DONE or REQUEUE. If a REQUEUEd is returned, it would be desirable if this should not be serviceASAP, although no harm is done if this still maintains that this should be serviced ASAP ...

Exceptions
StandardException:
Standard Derby exception policy

MT - depends on the work. Be wary of multiple DaemonService thread calling at the same time if you subscribe or enqueue multiple times.

runback to summary
public Object run() throws StandardException
serviceASAPback to summary
public boolean serviceASAP()

Implements org.apache.derby.iapi.services.daemon.Serviceable.serviceASAP.

Doc from org.apache.derby.iapi.services.daemon.Serviceable.serviceASAP.

If this work should be done as soon as possible, then return true. If it doesn't make any difference if it is done sooner rather than later, then return false. The difference is whether or not the daemon service will be notified to work on this when this work is enqueued or subscribed, in case the serviceable work is put together but not sent to the daemon service directly, like in post commit processing

MT - MT safe

Returns:boolean

true if this should work as soon as possible

serviceImmediatelyback to summary
public boolean serviceImmediately()

Implements org.apache.derby.iapi.services.daemon.Serviceable.serviceImmediately.

File deletion is a quick operation and typically releases substantial amount of space very quickly, this work should be done on the user thread.

Returns:boolean

true, this work needs to done on user thread.