|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jdtaus.core.container.ModelObject
org.jdtaus.core.container.Specification
public class Specification
Specification meta-data.
A specification consists of the properties identifier,
vendor, description and version. Property
identifier holds an identifier uniquely identifying the specification
in a set of specifications. Property vendor holds vendor information
for the vendor providing the specification. Property description
holds a textual description and property version holds a textual
version of the specification. The stateless flag indicates that state
does not need to be retained across operations for instances to operate as
specified. Property multiplicity specifies the number of
implementations allowed to exist among a set of modules. A specification with
MULTIPLICITY_ONE specifies that exactly one implementation of the
specification must exist among a set of modules. A specification with
MULTIPLICITY_MANY specifies that multiple implementations of the
specification are allowed to exist among a set of modules (including none).
Property scope specifies the scope the specification applies to.
In multiton scope, a new instance is created whenever requested. In context
scope, instances are bound to a system's context. An instance is only created
if not already available in context. In singleton scope, instances are bound
to a system's single instance store. An instance is only created if not
already available in that single instance store.
| Field Summary | |
|---|---|
static int |
MULTIPLICITY_MANY
Constant for property multiplicity. |
static int |
MULTIPLICITY_ONE
Constant for property multiplicity. |
static int |
SCOPE_CONTEXT
Constant for property scope. |
static int |
SCOPE_MULTITON
Constant for property scope. |
static int |
SCOPE_SINGLETON
Constant for property scope. |
| Constructor Summary | |
|---|---|
Specification()
|
|
| Method Summary | |
|---|---|
Object |
clone()
Creates and returns a copy of this object. |
boolean |
equals(Object o)
Indicates whether some other object is equal to this one by comparing properties identifier and version. |
String |
getIdentifier()
Gets the identifier of the specification. |
Implementation |
getImplementation(String name)
Gets an implementation for a name. |
Implementations |
getImplementations()
Gets all available implementations of the specification. |
String |
getModuleName()
Gets the name of the module holding the specification. |
int |
getMultiplicity()
Gets the implementation multiplicity of the specification. |
Properties |
getProperties()
Gets the properties of the specification. |
int |
getScope()
Gets the scope the specification applies to. |
String |
getVendor()
Gets the vendor of the specification. |
String |
getVersion()
Gets the version of the specification. |
int |
hashCode()
Returns a hash code value for this object. |
boolean |
isStateless()
Gets the flag indicating if state need not be retained across method invocations for implementations to operate as specified. |
void |
setIdentifier(String value)
Setter for property identifier. |
void |
setImplementations(Implementations value)
Setter for property implementations. |
void |
setModuleName(String value)
Setter for property moduleName. |
void |
setMultiplicity(int value)
Setter for property multiplicity. |
void |
setProperties(Properties value)
Setter for property properties. |
void |
setScope(int value)
Setter for property scope. |
void |
setStateless(boolean value)
Setter for property stateless. |
void |
setVendor(String value)
Setter for property vendor. |
void |
setVersion(String value)
Setter for property version. |
String |
toString()
Returns a string representation of the object. |
| Methods inherited from class org.jdtaus.core.container.ModelObject |
|---|
getDocumentation, getModelVersion, setDocumentation, setModelVersion |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MULTIPLICITY_MANY
multiplicity.
A specification with MULTIPLICITY_MANY specifies that multiple
implementations of the specification are allowed to exist among a set of
modules (including none).
public static final int MULTIPLICITY_ONE
multiplicity.
A specification with MULTIPLICITY_ONE specifies that exactly
one implementation of the specification must exist among a set of
modules.
public static final int SCOPE_CONTEXT
scope.
In context scope, instances are bound to a system's context. An instance is only created if not already available in context.
public static final int SCOPE_MULTITON
scope.
In multiton scope, a new instance is created whenever requested.
public static final int SCOPE_SINGLETON
scope.
In singleton scope, instances are bound to a system's single instance store. An instance is only created if not already available in that single instance store.
| Constructor Detail |
|---|
public Specification()
| Method Detail |
|---|
public Object clone()
clone in class Objectpublic final boolean equals(Object o)
identifier and version.
equals in class Objecto - the reference object with which to compare.
true if this object is the same as o;
false otherwise.public String getIdentifier()
public Implementation getImplementation(String name)
name - the name of the implementation to return.
name.
NullPointerException - if name is null.
MissingImplementationException - if no implementation matching
name exists.public Implementations getImplementations()
public String getModuleName()
public int getMultiplicity()
MULTIPLICITY_ONE or
MULTIPLICITY_MANY.MULTIPLICITY_ONE,
MULTIPLICITY_MANY,
MultiplicityConstraintExceptionpublic Properties getProperties()
public int getScope()
SCOPE_MULTITON,
SCOPE_CONTEXT,
SCOPE_SINGLETON,
PropertyOverwriteConstraintExceptionpublic String getVendor()
public String getVersion()
null.public final int hashCode()
hashCode in class Objectpublic boolean isStateless()
true if state need not be retained across method
invocations for implementations to operate as specified; false if
state must be retained across method invocations for implementations
to operate as specified.public void setIdentifier(String value)
identifier.
value - the new identifier of the specification.public void setImplementations(Implementations value)
implementations.
value - the new implementations of the specification.
DuplicateImplementationException - if value contains
duplicate implementations.
MultiplicityConstraintException - if the specification's
multiplicity equals MULTIPLICITY_ONE and value contains
no or more than one implementation.public void setModuleName(String value)
moduleName.
value - the new name of the module holding the specification.public void setMultiplicity(int value)
multiplicity.
value - the new implementation multiplicity of the specification.
IllegalArgumentException - if value is not equal to one of
the constants MULTIPLICITY_ONE or MULTIPLICITY_MANY.
MultiplicityConstraintException - if value equals
MULTIPLICITY_ONE and the specification currently has more than
one implementation defined.MULTIPLICITY_ONE,
MULTIPLICITY_MANYpublic void setProperties(Properties value)
properties.
value - new properties of the specification.public void setScope(int value)
scope.
value - new scope the specification applies to.
IllegalArgumentException - if value is not equal to one of
the constants SCOPE_MULTITON, SCOPE_CONTEXT or
SCOPE_SINGLETON.SCOPE_MULTITON,
SCOPE_CONTEXT,
SCOPE_SINGLETON,
PropertyOverwriteConstraintExceptionpublic void setStateless(boolean value)
stateless.
value - true if state need not be retained across method
invocations for implementations to operate as specified; false if
state must be retained across method invocations for implementations to
operate as specified.public void setVendor(String value)
vendor.
value - the new vendor of the specification.public void setVersion(String value)
version.
value - the new version of the specification.public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||