org.apache.servicemix.eip.support
Class SwitchPredicate

java.lang.Object
  extended by org.apache.servicemix.eip.support.SwitchPredicate
All Implemented Interfaces:
Predicate, org.springframework.beans.factory.InitializingBean

public class SwitchPredicate
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, Predicate

Switch (on/off) predicate based on a property that can come from a system property, a property from a property file (specified as Spring resource), or a property from the exchange.

The property is interpreted as a boolean value.


Constructor Summary
SwitchPredicate()
           
 
Method Summary
 void afterPropertiesSet()
           
 void createResource(java.lang.String resource)
           
 boolean getFromExchange()
           
 java.lang.String getPropertyName()
           
 org.springframework.core.io.Resource getPropertyResource()
           
 boolean isOn()
           
 boolean matches(javax.jbi.messaging.MessageExchange exchange)
           
 void setFromExchange(boolean fromExchange)
          Boolean flag indicating that the value is retrieved from the exchange properties.
 void setOn(boolean status)
          Default value of this predicate
 void setPropertyName(java.lang.String newPropertyName)
          The name of the property to retrieve
 void setPropertyResource(org.springframework.core.io.Resource newPropertyResource)
          A spring resource to load a set of properties from.
 java.lang.String showResource()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwitchPredicate

public SwitchPredicate()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

isOn

public boolean isOn()

setOn

public void setOn(boolean status)
Default value of this predicate


getPropertyName

public java.lang.String getPropertyName()

setPropertyName

public void setPropertyName(java.lang.String newPropertyName)
The name of the property to retrieve


getPropertyResource

public org.springframework.core.io.Resource getPropertyResource()

setPropertyResource

public void setPropertyResource(org.springframework.core.io.Resource newPropertyResource)
A spring resource to load a set of properties from.


getFromExchange

public boolean getFromExchange()

setFromExchange

public void setFromExchange(boolean fromExchange)
Boolean flag indicating that the value is retrieved from the exchange properties.


createResource

public void createResource(java.lang.String resource)

showResource

public java.lang.String showResource()
                              throws java.io.IOException
Throws:
java.io.IOException

matches

public boolean matches(javax.jbi.messaging.MessageExchange exchange)
Specified by:
matches in interface Predicate


Copyright © 2005-2011 FuseSource. All Rights Reserved.