org.systinet.wasp.dd
Class Builder

java.lang.Object
  extended byorg.systinet.wasp.dd.Builder

public abstract class Builder
extends java.lang.Object

This abstract class is used for reading building of a DeploymentDescriptor from XML representation.

Since:
4.0
Component:
Core

Nested Class Summary
protected static interface Builder.BuilderFactory
           
 
Field Summary
static java.lang.String BUILDER_FACTORY
          Use this constant in getInstance to obtain DD builder factory from Context.
static int RESOLVE_ACCESSIBLE
          Recursively resolve all dependencies.
static int RESOLVE_ALL
          Recursively resolve all dependencies.
static int RESOLVE_NODEPS
          Do not try to resolve depends-on packages.
 
Constructor Summary
Builder()
           
 
Method Summary
abstract  DeploymentDescriptor create(java.lang.String name, java.lang.String targetNamespace, java.lang.String version)
          Creates a new, empty deployment descriptor.
static Builder createBuilder()
          Creates a new builder.
abstract  int getResolvingMode()
          Returns resolving mode.
abstract  DeploymentDescriptor read(QName ddName)
          Reads a deployment descriptor when a name is known.
abstract  DeploymentDescriptor read(java.lang.String ddUri)
          Reads a deployment descriptor when its URI is known.
abstract  DeploymentDescriptor read(java.lang.String ddUri, java.io.InputStream stream)
          Reads a deployment descriptor from a stream without loader.
abstract  void registerLoader(Loader loader)
          Registers a loader.
abstract  void setResolvingMode(int mode)
          Sets the resolving mode.
abstract  void unregisterLoader(Loader loader)
          Unregisters a loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILDER_FACTORY

public static final java.lang.String BUILDER_FACTORY
Use this constant in getInstance to obtain DD builder factory from Context.

See Also:
Constant Field Values

RESOLVE_NODEPS

public static final int RESOLVE_NODEPS
Do not try to resolve depends-on packages. In this case, loaders are not called and the references are not resolved. It is possible to resolve the dependencies later by setting the mode to RESOLVE_ALL and re-reading the deployment descriptor (which was cached when read last time).

See Also:
getResolvingMode(), setResolvingMode(int), Constant Field Values

RESOLVE_ALL

public static final int RESOLVE_ALL
Recursively resolve all dependencies. If a dependence can not be resolved, DeploymentException is thrown

See Also:
getResolvingMode(), setResolvingMode(int), Constant Field Values

RESOLVE_ACCESSIBLE

public static final int RESOLVE_ACCESSIBLE
Recursively resolve all dependencies. If a dependence can not be resolved, references are left unresolved.

See Also:
getResolvingMode(), setResolvingMode(int), Constant Field Values
Constructor Detail

Builder

public Builder()
Method Detail

createBuilder

public static Builder createBuilder()
                             throws DeploymentException
Creates a new builder.

Returns:
the builder just created
Throws:
DeploymentException - if something goes wrong

create

public abstract DeploymentDescriptor create(java.lang.String name,
                                            java.lang.String targetNamespace,
                                            java.lang.String version)
Creates a new, empty deployment descriptor.

Parameters:
name - the name of the newly created deployment descriptor
targetNamespace - the target namespace of the deployment descriptor
version - the version of the deployment descriptor, not null
Returns:
the newly created deployment descriptor

read

public abstract DeploymentDescriptor read(java.lang.String ddUri)
                                   throws DeploymentException
Reads a deployment descriptor when its URI is known.

Parameters:
ddUri - the URI of the deployment descriptor
Returns:
the read deployment descriptor or null if URI can't be resolved
Throws:
DeploymentException - if something wents wrong

read

public abstract DeploymentDescriptor read(QName ddName)
                                   throws DeploymentException
Reads a deployment descriptor when a name is known.

Parameters:
ddName - the name of the deployment descriptor to be read
Returns:
the read deployment descriptor or null if package with given QName can't be resolved
Throws:
DeploymentException - if something went wrong

read

public abstract DeploymentDescriptor read(java.lang.String ddUri,
                                          java.io.InputStream stream)
                                   throws DeploymentException
Reads a deployment descriptor from a stream without loader.

Parameters:
ddUri - the URI that is set as the location of DD for resolving dependencies
stream - the input stream containing the deployment descriptor
Returns:
the read deployment descriptor
Throws:
DeploymentException - if something went wrong

registerLoader

public abstract void registerLoader(Loader loader)
Registers a loader.

Parameters:
loader - the new loader

unregisterLoader

public abstract void unregisterLoader(Loader loader)
Unregisters a loader.

Parameters:
loader - the loader to be unregistered

getResolvingMode

public abstract int getResolvingMode()
Returns resolving mode. See RESOLVE_XXX constants for details.

Returns:
resolving mode

setResolvingMode

public abstract void setResolvingMode(int mode)
Sets the resolving mode. See RESOLVE_XXX constants for details. The default resolving mode is RESOLVE_NODEPS.

Parameters:
mode - the resolving mode