RSS Feed for This PostCurrent Article

Apache XBean

The goal of XBean project is to created a plugin based server analogous to Eclipse being a plugin based IDE. XBean will be able to discover, download and install server plugins from an Internet based repository. In addition, we include support for multiple IoC systems, support for running with no IoC system, JMX without JMX code, lifecycle and class loader management, and a rock solid Spring integration.

   1: <beans xmlns:p="java://org.apache.xbean.spring.example">
   2:  
   3:   <p:PizzaService id="pizzaService" topping="Salami" cheese="Edam" size="17"/>
   4:   
   5: </beans>

maps to

   1: public class PizzaService {
   2:  
   3:     private static final Log log = LogFactory.getLog(PizzaService.class);
   4:     
   5:     private String topping;
   6:     private String cheese;
   7:     private int size;
   8:     private double price;
   9:  
  10:     public void makePizza() {
  11:         log.info("Making a pizza with topping: " + topping + " cheese: " + cheese + " with size: " + size);
  12:     }
  13:  
  14:     public String getCheese() {
  15:         return cheese;
  16:     }
  17:  
  18:     public void setCheese(String cheese) {
  19:         this.cheese = cheese;
  20:     }
  21:  
  22:     public double getPrice() {
  23:         return price;
  24:     }
  25:  
  26:     public void setPrice(double price) {
  27:         this.price = price;
  28:     }
  29:  
  30:     public int getSize() {
  31:         return size;
  32:     }
  33:  
  34:     public void setSize(int size) {
  35:         this.size = size;
  36:     }
  37:  
  38:     /**
  39:      * @org.apache.xbean.Property alias="myTopping"
  40:      */
  41:     public String getTopping() {
  42:         return topping;
  43:     }
  44:  
  45:     public void setTopping(String topping) {
  46:         this.topping = topping;
  47:     }
  48:  
  49: }


Trackback URL


Sorry, comments for this entry are closed at this time.