org.apache.camel
Class ExchangeProperty<T>

java.lang.Object
  extended by org.apache.camel.ExchangeProperty<T>

Deprecated. will be removed in Camel 2.0

public class ExchangeProperty<T>
extends Object

Represents an instance and a type safe registry of well known Camel Exchange properties.

Usage pattern:
In your code register a property that you wish to pass via Camel Exchange:

      public static final ExchangeProperty myProperty =
            new ExchangeProperty("myProperty", "org.apache.myproject.mypackage.myproperty", Boolean.class);

  Then in your code set this property's value:
      myProperty.set(exchange, Boolean.TRUE);

  Check the value of this property where required:
      ExchangeProperty property = ExchangeProperty.get("myProperty");
      if (property != null && property.get(exchange) == Boolean.TRUE) {
           // do your thing ...
       }
  Or
      Boolean value = myProperty.get(exchange);
      if (value == Boolean.TRUE) {
          // do your thing
      }

  When your code no longer requires this property then deregister it:
      ExchangeProperty.deregister(myProperty);
  Or
      ExchangeProperty.deregister("myProperty");
  
Note: that if ExchangeProperty instance get or set methods are used then type checks of property's value are performed and a runtime exception can be thrown if type safety is violated.


Constructor Summary
ExchangeProperty(String literal, String name, Class<T> type)
          Deprecated.  
 
Method Summary
static void deregister(ExchangeProperty<?> property)
          Deprecated.  
static void deregister(String literal)
          Deprecated.  
 T get(Exchange exchange)
          Deprecated.  
static ExchangeProperty<?> get(String literal)
          Deprecated.  
static ExchangeProperty<?> getByName(String name)
          Deprecated.  
 String literal()
          Deprecated.  
 String name()
          Deprecated.  
static void register(ExchangeProperty<?> property)
          Deprecated.  
 T remove(Exchange exchange)
          Deprecated.  
 T set(Exchange exchange, T value)
          Deprecated.  
 String toString()
          Deprecated.  
 Class<T> type()
          Deprecated.  
static ExchangeProperty<?>[] values()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExchangeProperty

public ExchangeProperty(String literal,
                        String name,
                        Class<T> type)
Deprecated. 
Method Detail

literal

public String literal()
Deprecated. 

name

public String name()
Deprecated. 

type

public Class<T> type()
Deprecated. 

get

public T get(Exchange exchange)
Deprecated. 

get

public static ExchangeProperty<?> get(String literal)
Deprecated. 

getByName

public static ExchangeProperty<?> getByName(String name)
Deprecated. 

set

public T set(Exchange exchange,
             T value)
Deprecated. 

remove

public T remove(Exchange exchange)
Deprecated. 

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object

register

public static void register(ExchangeProperty<?> property)
Deprecated. 

deregister

public static void deregister(ExchangeProperty<?> property)
Deprecated. 

deregister

public static void deregister(String literal)
Deprecated. 

values

public static ExchangeProperty<?>[] values()
Deprecated. 


Copyright © 2009 Apache Software Foundation. All Rights Reserved.