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 Object
implements org.springframework.beans.factory.InitializingBean, Predicate

switch (on/off) predicate based on a property that can come from 1. a system property 2. a property from a property file (specified as Spring resource) 3. a property from the exchange 4. swtich on/off via JMX MBean (not yet implemented)

the property is interpreted as a boolean value If fromExchange is true --> 3. If propertyResource is specified --> 2. else --> 1.


Constructor Summary
SwitchPredicate()
           
 
Method Summary
 void afterPropertiesSet()
           
 void createResource(String resource)
           
 boolean getFromExchange()
           
 String getPropertyName()
           
 org.springframework.core.io.Resource getPropertyResource()
           
 boolean isOn()
           
 boolean matches(javax.jbi.messaging.MessageExchange exchange)
           
 void setFromExchange(boolean fromExchange)
           
 void setOn(boolean status)
           
 void setPropertyName(String newPropertyName)
           
 void setPropertyResource(org.springframework.core.io.Resource newPropertyResource)
           
 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 Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

isOn

public boolean isOn()

setOn

public void setOn(boolean status)

getPropertyName

public String getPropertyName()

setPropertyName

public void setPropertyName(String newPropertyName)

getPropertyResource

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

setPropertyResource

public void setPropertyResource(org.springframework.core.io.Resource newPropertyResource)

getFromExchange

public boolean getFromExchange()

setFromExchange

public void setFromExchange(boolean fromExchange)

createResource

public void createResource(String resource)

showResource

public String showResource()
                    throws IOException
Throws:
IOException

matches

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


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.