org.apache.tuscany.samples.sdo.internal
Class SampleInfrastructure

java.lang.Object
  extended by org.apache.tuscany.samples.sdo.internal.SampleInfrastructure
Direct Known Subclasses:
SampleBase

public abstract class SampleInfrastructure
extends Object

One of a pair of base classes for samples. This one contains all the infrastructure code that a person wanting to learn SDO would not want to look at.


Nested Class Summary
static class SampleInfrastructure.SDOFacets
           
 
Field Summary
protected static Integer COMMENTARY_ALWAYS
           
protected static Integer COMMENTARY_FOR_ADVANCED
           
protected static Integer COMMENTARY_FOR_INTERMEDIATE
           
protected static Integer COMMENTARY_FOR_NOVICE
           
protected  int commentaryLevel
           
static String COMPANY_DATAGRAPH_XML
           
static String COMPANY_DATAOBJECT_XML
           
static String COMPANY_NAMESPACE
           
static String COMPANY_XSD
           
static String PO_NAMESPACE
           
static String PO_XML_GENERATED
           
static String PO_XML_RESOURCE
           
static String PO_XSD_RESOURCE
           
protected static Integer SAMPLE_LEVEL_ADVANCED
           
protected static Integer SAMPLE_LEVEL_BASIC
           
protected static Integer SAMPLE_LEVEL_INTERMEDIATE
           
static Class[] sampleClasses
          Here's the list of sample programs
protected  int sampleComplexityLevel
           
protected static String[] userLevels
           
 
Constructor Summary
SampleInfrastructure(Integer commentaryLevel)
           
SampleInfrastructure(Integer commentaryLevel, Integer sampLevel)
           
 
Method Summary
 void banner(char borderChar, String text)
           
 void banner(String text)
           
protected  void commentary(Integer commentLevel, String text)
           
protected  void commentary(Integer commentLevel, String text, String repeatText)
           
protected  void commentary(String text)
           
protected  void commentary(String text, String repeatText)
           
 int getSampleComplexityLevel()
           
 void run()
           
abstract  void runSample()
           
 void setSampleComplexityLevel(Integer sampleComplexityLevel)
           
 void somethingUnexpectedHasHappened(Exception e)
           
protected  boolean yesOrNoFromUser(String question)
          Utility method to obtain information from the user about whether or not they would like to use a DataGraph or simply use a DataObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sampleComplexityLevel

protected int sampleComplexityLevel

commentaryLevel

protected int commentaryLevel

sampleClasses

public static final Class[] sampleClasses
Here's the list of sample programs


SAMPLE_LEVEL_BASIC

protected static final Integer SAMPLE_LEVEL_BASIC

SAMPLE_LEVEL_INTERMEDIATE

protected static final Integer SAMPLE_LEVEL_INTERMEDIATE

SAMPLE_LEVEL_ADVANCED

protected static final Integer SAMPLE_LEVEL_ADVANCED

COMMENTARY_FOR_NOVICE

protected static final Integer COMMENTARY_FOR_NOVICE

COMMENTARY_FOR_INTERMEDIATE

protected static final Integer COMMENTARY_FOR_INTERMEDIATE

COMMENTARY_FOR_ADVANCED

protected static final Integer COMMENTARY_FOR_ADVANCED

COMMENTARY_ALWAYS

protected static final Integer COMMENTARY_ALWAYS

userLevels

protected static final String[] userLevels

COMPANY_DATAOBJECT_XML

public static final String COMPANY_DATAOBJECT_XML
See Also:
Constant Field Values

COMPANY_DATAGRAPH_XML

public static final String COMPANY_DATAGRAPH_XML
See Also:
Constant Field Values

COMPANY_XSD

public static final String COMPANY_XSD
See Also:
Constant Field Values

COMPANY_NAMESPACE

public static final String COMPANY_NAMESPACE
See Also:
Constant Field Values

PO_NAMESPACE

public static final String PO_NAMESPACE
See Also:
Constant Field Values

PO_XML_GENERATED

public static final String PO_XML_GENERATED
See Also:
Constant Field Values

PO_XML_RESOURCE

public static final String PO_XML_RESOURCE
See Also:
Constant Field Values

PO_XSD_RESOURCE

public static final String PO_XSD_RESOURCE
See Also:
Constant Field Values
Constructor Detail

SampleInfrastructure

public SampleInfrastructure(Integer commentaryLevel)

SampleInfrastructure

public SampleInfrastructure(Integer commentaryLevel,
                            Integer sampLevel)
Method Detail

banner

public void banner(char borderChar,
                   String text)

banner

public void banner(String text)

commentary

protected void commentary(String text,
                          String repeatText)

commentary

protected void commentary(Integer commentLevel,
                          String text,
                          String repeatText)

commentary

protected void commentary(Integer commentLevel,
                          String text)

commentary

protected void commentary(String text)

somethingUnexpectedHasHappened

public void somethingUnexpectedHasHappened(Exception e)

yesOrNoFromUser

protected boolean yesOrNoFromUser(String question)
                           throws Exception
Utility method to obtain information from the user about whether or not they would like to use a DataGraph or simply use a DataObject

Returns:
whether or not a DataGraph should be used
Throws:
Exception

run

public void run()

runSample

public abstract void runSample()
                        throws Exception
Throws:
Exception

getSampleComplexityLevel

public int getSampleComplexityLevel()

setSampleComplexityLevel

public void setSampleComplexityLevel(Integer sampleComplexityLevel)


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.