com.codemonster.surinam.core.model
Class ContractBlueprint

java.lang.Object
  extended by com.codemonster.surinam.core.model.BlueprintBase
      extended by com.codemonster.surinam.core.model.ContractBlueprint
All Implemented Interfaces:
Blueprint
Direct Known Subclasses:
ImplementationBlueprint

public class ContractBlueprint
extends BlueprintBase

This is the standard Blueprint for all Service Contracts. A Contract is a formal Service definition in code and meta-data. Note that Contracts themselves can be unique, can be defined by anyone and implemented by anyone (not necessarily the same entity). Here, is where we begin implementing the type-safe Contract-specific API.

Author:
Samuel Provencher

Constructor Summary
ContractBlueprint()
           
ContractBlueprint(String deploymentRoot, String implementingClass, String description, String organization, String publicationDate)
          Full constructor for constructor injection.
 
Method Summary
 void addClasspathSegment(String pathsegment)
          Adds a new path segment to the classpath if there is no segment that matches the given segment.
 List<URL> getClasspath()
           
 URL[] getClasspathAsArray()
          This accessor will deliver the class path as an array of URLs.
 List<String> getPathSegments()
          Primarily for regenerating the original path segments, we will deliver the original strings.
 void setDefiningClass(String className)
          Some syntactic sugar to allow for a more intuitive invocation to 'define' the contract as opposed to providing the 'implementing' class.
 void setPathSegments(List<String> pathSegments)
          This is a setter method for bulk addition of classpath segments.
 
Methods inherited from class com.codemonster.surinam.core.model.BlueprintBase
getAuthor, getDeploymentRoot, getDescription, getImplementingClass, getOrganization, getPublicationDate, setAuthor, setDeploymentRoot, setDescription, setImplementingClass, setOrganization, setPublicationDate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContractBlueprint

public ContractBlueprint()

ContractBlueprint

public ContractBlueprint(String deploymentRoot,
                         String implementingClass,
                         String description,
                         String organization,
                         String publicationDate)
                  throws MalformedURLException
Full constructor for constructor injection.

Parameters:
deploymentRoot - The root to be used as part of the classpath.
implementingClass - The FQ name of the implementation class
description - A simple text description taken from the annotation.
organization - The name of the publishing organization.
publicationDate - The date of the publication.
Throws:
MalformedURLException
Method Detail

setDefiningClass

public void setDefiningClass(String className)
Some syntactic sugar to allow for a more intuitive invocation to 'define' the contract as opposed to providing the 'implementing' class.

Parameters:
className - The interface Class name that defines the service contract.

setPathSegments

public void setPathSegments(List<String> pathSegments)
                     throws MalformedURLException
This is a setter method for bulk addition of classpath segments.

Parameters:
pathSegments - A list of strings making up the relative paths to jar files that make up a path segment.
Throws:
MalformedURLException

getPathSegments

public List<String> getPathSegments()
Primarily for regenerating the original path segments, we will deliver the original strings.

Returns:
Returns the original string values in the ActionDocument.

addClasspathSegment

public void addClasspathSegment(String pathsegment)
                         throws MalformedURLException
Adds a new path segment to the classpath if there is no segment that matches the given segment.

Parameters:
pathsegment - The string to be converted into a URL and included as part of the classpath.
Throws:
MalformedURLException

getClasspath

public List<URL> getClasspath()

getClasspathAsArray

public URL[] getClasspathAsArray()
This accessor will deliver the class path as an array of URLs.

Returns:
returns the classpath as an array of URLs.


Copyright © 2010. All Rights Reserved.