Rio Project 4.2 API Documentation



org.rioproject.opstring
Class OpStringLoader

java.lang.Object
  extended by org.rioproject.opstring.OpStringLoader

public class OpStringLoader
extends Object

The OpStringLoader utility is a helper class used to parse, validate and return an OperationalString.
This class searches in the given classloader for a resource named /org/rioproject/opstring/OpStringParserSelectionStrategy in the classpath. If found the content of that resource is supposed to indicate the name of the class to use as an OpStringParserSelectionStrategy.

Author:
Dennis Reedy, Jerome Bernard

Nested Class Summary
static class OpStringLoader.XMLErrorHandler
          An ErrorHandler for parsing
 
Field Summary
static String DEFAULT_FDH
          Default FaultDetectionHandler
 
Constructor Summary
OpStringLoader()
          Simple constructor which instantiates an OpStringLoader object that validates XML documents as they are parsed
OpStringLoader(boolean verify, ClassLoader loader)
          Create a new OpStringLoader
OpStringLoader(ClassLoader loader)
          Create a new OpStringLoader, validating documents as they are parsed.
 
Method Summary
static void main(String[] args)
           
static ServiceElement makeServiceElement(ParsedService parsedSvc, Map<String,Map<String,AssociationDescriptor[]>> associationTable)
          Create a ServiceElement object from a ParsedService
 OperationalString[] parseOperationalString(File file)
          Parse on OperationalString from a File
 OperationalString[] parseOperationalString(URL url)
          Parse on OperationalString from a URL location.
 void setDefaultExportJars(String[] jars)
          Set an array of jar names to be always included in a service's declaration
 void setDefaultGroups(String[] groups)
          Set the default groups to add into the parsed OperationalString.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FDH

public static final String DEFAULT_FDH
Default FaultDetectionHandler

See Also:
Constant Field Values
Constructor Detail

OpStringLoader

public OpStringLoader()
               throws Exception
Simple constructor which instantiates an OpStringLoader object that validates XML documents as they are parsed

Throws:
Exception - if there are errors creating the utility

OpStringLoader

public OpStringLoader(ClassLoader loader)
               throws Exception
Create a new OpStringLoader, validating documents as they are parsed.

Parameters:
loader - The parent ClassLoader to use for delegation
Throws:
Exception - if there are errors creating the utility

OpStringLoader

public OpStringLoader(boolean verify,
                      ClassLoader loader)
               throws Exception
Create a new OpStringLoader

Parameters:
verify - If true specifies that the parser produced by this code will validate documents as they are parsed.
loader - The parent ClassLoader to use for delegation
Throws:
Exception - if there are errors creating the utility
Method Detail

setDefaultExportJars

public void setDefaultExportJars(String[] jars)
Set an array of jar names to be always included in a service's declaration

Parameters:
jars - An array of jar names which will be verified as part of the services interface resources

setDefaultGroups

public void setDefaultGroups(String[] groups)
Set the default groups to add into the parsed OperationalString.

Parameters:
groups - The groups to set, must not be null
Throws:
IllegalArgumentException - if the groups parameter is null or if the groups parameter is a zero-length array

parseOperationalString

public OperationalString[] parseOperationalString(File file)
                                           throws Exception
Parse on OperationalString from a File

Parameters:
file - A File object for an XML or groovy file
Returns:
An array of OperationalString objects parsed from the file.
Throws:
Exception - if any errors occur parsing the document

parseOperationalString

public OperationalString[] parseOperationalString(URL url)
                                           throws Exception
Parse on OperationalString from a URL location.

Parameters:
url - URL location of the OperationalString
Returns:
An array of OperationalString objects parsed from the document loaded from the URL.
Throws:
Exception - if any errors occur parsing the document

makeServiceElement

public static ServiceElement makeServiceElement(ParsedService parsedSvc,
                                                Map<String,Map<String,AssociationDescriptor[]>> associationTable)
                                         throws Exception
Create a ServiceElement object from a ParsedService

Parameters:
parsedSvc - A ParsedService object, typically from loading and parsing an OperationalString document
associationTable - A table of named associations and descriptors
Returns:
The ServiceElement object
Throws:
Exception - if errors occur parsing the service element

main

public static void main(String[] args)

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.