railo.runtime.tag
Class Lock

java.lang.Object
  extended by railo.runtime.ext.tag.TagImpl
      extended by railo.runtime.ext.tag.BodyTagImpl
          extended by railo.runtime.ext.tag.BodyTagTryCatchFinallyImpl
              extended by 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.


Field Summary
 
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()
           
 
Method Summary
 void doFinally()
           
 int doStartTag()
           
 void release()
           
 void setId(String id)
           
 void setName(String name)
          set the value name
 void setScope(String scope)
          set the value scope Specifies the scope as one of the following: Application, Server, or Session.
 void setThrowontimeout(boolean throwontimeout)
          set the value throwontimeout Yes or No.
 void setTimeout(double timeout)
           
 void setTimeout(Object oTimeout)
          set the value timeout Specifies the maximum amount of time, in seconds, to wait to obtain a lock.
 void setType(String type)
          set the value type readOnly or Exclusive.
 
Methods inherited from class railo.runtime.ext.tag.BodyTagTryCatchFinallyImpl
doCatch
 
Methods inherited from class railo.runtime.ext.tag.BodyTagImpl
doAfterBody, doInitBody, setBodyContent
 
Methods inherited from class railo.runtime.ext.tag.TagImpl
doEndTag, getParent, required, required, required, required, setPageContext, setPageContext, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, getParent, setPageContext, setParent
 

Constructor Detail

Lock

public Lock()
Method Detail

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class BodyTagImpl

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)

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

doFinally

public void doFinally()
Specified by:
doFinally in interface javax.servlet.jsp.tagext.TryCatchFinally
Overrides:
doFinally in class BodyTagTryCatchFinallyImpl


Copyright © 2012 Railo