Listing 4: The ChartServerImpl class

/**
* ChartServerImpl: This class is the entry and exit 
* point for ChartServer component
*/

// imports
............

public class ChartServerImpl extends if_ChartServerPOA
{
   //private variables
   private barProperties bProp = null;
   private int orient = 0;
   private String Scale  = null;
   private String Columns  = null;

   //Constructor
   public ChartServerImpl()
   {
   //initialize variables
   }


   //Returns number of columns, scale and orientation. 
   //This could be read from a file or retrieved from 
   //a database.
   public void getCommonProperties(StringHolder scale, 
                                   StringHolder columns,
                                   IntHolder orientation)
   {
   scale.value = Scale;
   columns.value = Columns;
   orientation.value = orient;
   }


   //...........The out parameter barPropertiesHolder is 
   //used for marshaling back the bar chart values which 
   //are set here........... 
   public void getBarProperties (int column,  
                                 barPropertiesHolder barProp)
   {
   //store some arbitrary values for each column.
   if (column ==1)
   {
      bProp.value = 10;
      bProp.color = "blue";
      bProp.label = "Q1";
      bProp.barStyle = Style.Striped;
   }
   ................

   //set the value field of the holder in the Holder class
   barProp.value = bProp;
   }

}
— End of Listing —