com.caucho.rewrite
Class IfMBeanEnabled

java.lang.Object
  extended by com.caucho.rewrite.IfMBeanEnabled
All Implemented Interfaces:
RequestPredicate

@Configurable
public class IfMBeanEnabled
extends java.lang.Object
implements RequestPredicate

Matches if the MBean is enabled and does not match if it's not enabled. The MBean is registered as resin:name=<name>,type=IfMBean

 <resin:Allow url-pattern="/admin/*">
                  xmlns:resin="urn:java:com.caucho.resin">
   <resin:IfMBeanEnabled name="admin"/>
 </resin:Allow>
 

RequestPredicates may be used for security and rewrite actions.


Constructor Summary
IfMBeanEnabled()
           
 
Method Summary
 boolean isMatch(HttpServletRequest request)
          True if the predicate matches.
 void setEnabled(boolean isEnabled)
          Sets true if the default is to enable.
 void setName(java.lang.String name)
          Sets the MBean name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IfMBeanEnabled

public IfMBeanEnabled()
Method Detail

setName

@Configurable
public void setName(java.lang.String name)
Sets the MBean name.


setEnabled

@Configurable
public void setEnabled(boolean isEnabled)
Sets true if the default is to enable.


isMatch

public boolean isMatch(HttpServletRequest request)
True if the predicate matches.

Specified by:
isMatch in interface RequestPredicate
Parameters:
request - the servlet request to test