railo.runtime.tag
Class Lock
java.lang.Object
railo.runtime.ext.tag.TagImpl
railo.runtime.ext.tag.BodyTagImpl
railo.runtime.ext.tag.BodyTagTryCatchFinallyImpl
railo.runtime.tag.Lock
- All Implemented Interfaces:
- javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
public final class Lock
- extends BodyTagTryCatchFinallyImpl
Provides two types of locks to ensure the integrity of shared data: Exclusive lock and Read-only
lock. An exclusive lock single-threads access to the CFML constructs in its body. Single-threaded access
implies that the body of the tag can be executed by at most one request at a time. A request executing
inside a cflock tag has an "exclusive lock" on the tag. No other requests can start executing inside the
tag while a request has an exclusive lock. CFML issues exclusive locks on a first-come, first-served
basis. A read-only lock allows multiple requests to access the CFML constructs inside its body concurrently.
Therefore, read-only locks should be used only when the shared data is read only and not modified. If another
request already has an exclusive lock on the shared data, the request waits for the exclusive lock to be
released.
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary |
Lock()
|
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
doEndTag, getParent, setPageContext, setParent |
Lock
public Lock()
release
public void release()
- Specified by:
release
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
release
in class BodyTagImpl
- See Also:
Tag.release()
setId
public void setId(String id)
- Parameters:
id
- the id to set
setTimeout
public void setTimeout(Object oTimeout)
throws PageException
- set the value timeout
Specifies the maximum amount of time, in seconds, to wait to obtain a lock. If a lock can be
obtained within the specified period, execution continues inside the body of the tag. Otherwise, the
behavior depends on the value of the throwOnTimeout attribute.
- Parameters:
timeout
- value to set
- Throws:
PageException
setTimeout
public void setTimeout(double timeout)
throws PageException
- Throws:
PageException
setType
public void setType(String type)
throws ApplicationException
- set the value type
readOnly or Exclusive. Specifies the type of lock: read-only or exclusive. Default is Exclusive.
A read-only lock allows more than one request to read shared data. An exclusive lock allows only one
request to read or write to shared data.
- Parameters:
type
- value to set
- Throws:
ApplicationException
setScope
public void setScope(String scope)
throws ApplicationException
- set the value scope
Specifies the scope as one of the following: Application, Server, or Session. This attribute is mutually
exclusive with the name attribute.
- Parameters:
scope
- value to set
- Throws:
ApplicationException
setThrowontimeout
public void setThrowontimeout(boolean throwontimeout)
- set the value throwontimeout
Yes or No. Specifies how timeout conditions are handled. If the value is Yes, an exception is
generated to provide notification of the timeout. If the value is No, execution continues past the
cfclock tag. Default is Yes.
- Parameters:
throwontimeout
- value to set
setName
public void setName(String name)
throws ApplicationException
- set the value name
- Parameters:
name
- value to set
- Throws:
ApplicationException
doStartTag
public int doStartTag()
throws PageException
- Specified by:
doStartTag
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in class TagImpl
- Throws:
PageException
- See Also:
Tag.doStartTag()
doFinally
public void doFinally()
- Specified by:
doFinally
in interface javax.servlet.jsp.tagext.TryCatchFinally
- Overrides:
doFinally
in class BodyTagTryCatchFinallyImpl
- See Also:
TryCatchFinally.doFinally()
Copyright © 2012 Railo