org.ops4j.pax.exam.options
Class AbstractDelegateProvisionOption<T extends AbstractDelegateProvisionOption>

java.lang.Object
  extended by org.ops4j.pax.exam.options.AbstractDelegateProvisionOption<T>
All Implemented Interfaces:
Option, ProvisionControl<T>, ProvisionOption<T>, UrlReference
Direct Known Subclasses:
EasyMockBundlesOption, JMockBundlesOption, JUnitBundlesOption, MockitoBundlesOption

public abstract class AbstractDelegateProvisionOption<T extends AbstractDelegateProvisionOption>
extends java.lang.Object
implements ProvisionOption<T>

Abstract ProvisionOption that delegates to another provision option.

Since:
0.3.0, December 08, 2008
Author:
Alin Dreghiciu (adreghiciu@gmail.com)

Constructor Summary
protected AbstractDelegateProvisionOption(ProvisionOption delegate)
          Constructor.
 
Method Summary
 ProvisionOption getDelegate()
          Getter.
 java.lang.Integer getStartLevel()
          The start level for the provisioned bundle(s).
 java.lang.String getURL()
          Getter.
protected abstract  T itself()
          Implemented by sub classes in order to return itself (this) for fluent api usage
 T noStart()
          Setter.
 T noUpdate()
          Setter.
 boolean shouldStart()
          If the provisioned bundle(s) should be started.
 boolean shouldUpdate()
          If the provisioned bundle(s) should be updated (re-downloaded).
 T start()
          Setter.
 T start(java.lang.Boolean shouldStart)
          Setter.
 T startLevel(java.lang.Integer startLevel)
          Setter.
 T update()
          Setter.
 T update(java.lang.Boolean shouldUpdate)
          Setter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDelegateProvisionOption

protected AbstractDelegateProvisionOption(ProvisionOption delegate)
Constructor.

Parameters:
delegate - wrapped provision option (cannot be null)
Throws:
java.lang.IllegalArgumentException - - If delegate is null
Method Detail

getURL

public java.lang.String getURL()
Getter.

Specified by:
getURL in interface UrlReference
Returns:
url (cannot be null)

shouldUpdate

public boolean shouldUpdate()
If the provisioned bundle(s) should be updated (re-downloaded). By default bundles should be updated.

Specified by:
shouldUpdate in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Returns:
true if the bundle(s) should be updated, false otherwise.

shouldStart

public boolean shouldStart()
If the provisioned bundle(s) should be started. By default bundles should be started.

Specified by:
shouldStart in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Returns:
true if the bundle(s) should be started, false otherwise.

getStartLevel

public java.lang.Integer getStartLevel()
The start level for the provisioned bundle(s).

Specified by:
getStartLevel in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Returns:
start level. If the returned value is null, default behavior will be used

update

public T update(java.lang.Boolean shouldUpdate)
Setter.

Specified by:
update in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Parameters:
shouldUpdate - true if the provisioned bundle(s) should be updated, false otherwise
Returns:
itself, for fluent api usage

update

public T update()
Setter. Specifyies that the provisioned bundle(s) should be updated.

Specified by:
update in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Returns:
itself, for fluent api usage

noUpdate

public T noUpdate()
Setter. Specifyies that the provisioned bundle(s) should not be updated.

Specified by:
noUpdate in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Returns:
itself, for fluent api usage

start

public T start(java.lang.Boolean shouldStart)
Setter.

Specified by:
start in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Parameters:
shouldStart - true if the provisioned bundle(s) should be started, false otherwise
Returns:
itself, for fluent api usage

start

public T start()
Setter. Specifyies that the provisioned bundle(s) should be started.

Specified by:
start in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Returns:
itself, for fluent api usage

noStart

public T noStart()
Setter. Specifyies that the provisioned bundle(s) should not be started.

Specified by:
noStart in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Returns:
itself, for fluent api usage

startLevel

public T startLevel(java.lang.Integer startLevel)
Setter.

Specified by:
startLevel in interface ProvisionControl<T extends AbstractDelegateProvisionOption>
Parameters:
startLevel - start level of the provisioned bundle(s)
Returns:
itself, for fluent api usage

getDelegate

public ProvisionOption getDelegate()
Getter.

Returns:
wrapped provision option (cannot be null)

itself

protected abstract T itself()
Implemented by sub classes in order to return itself (this) for fluent api usage

Returns:
itself


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.