improved javadoc including where to look for alternative syntax

This commit is contained in:
Adrian Cole 2012-11-07 12:02:52 -03:00
parent a0b50ca5a9
commit 5f6c3e992a
4 changed files with 66 additions and 11 deletions

View File

@ -31,9 +31,17 @@ import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
* This class is deprecated in favor of {@link ContextBuilder}. Please view
* sample usage below:
*
* <pre>
* context = ContextBuilder.newBuilder("aws-s3")
* .credentials(apikey, secret)
* .buildView(BlobStoreContext.class);
* </pre>
*
* @see ContextBuilder
* @see BlobStoreContextBuilder
* @deprecated As of version 1.5, replaced by {@link ContextBuilder}
* @author Adrian Cole
*/
@Deprecated

View File

@ -31,9 +31,19 @@ import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
* This class is deprecated in favor of {@link ContextBuilder}. Please view
* sample usage below:
*
* <pre>
* context = ContextBuilder.newBuilder("openstack-nova")
* .endpoint("http://10.10.10.10:5000/v2.0")
* .credentials(user, pass)
* .modules(singleton(new SshjSshClientModule()))
* .buildView(ComputeServiceContext.class);
* </pre>
*
* @see ContextBuilder
* @see ComputeServiceContextBuilder
* @deprecated As of version 1.5, replaced by {@link ContextBuilder}
* @author Adrian Cole
*/
@Deprecated

View File

@ -93,17 +93,46 @@ import com.google.inject.Stage;
import com.google.inject.TypeLiteral;
/**
* Creates {@link RestContext} or {@link Injector} instances based on the most commonly requested
* arguments.
* Creates {@link Context} or {@link Injector} configured to an api and
* endpoint. Alternatively, this can be used to make a portable {@link View} of
* that api.
*
* <br/>
* ex. to build a {@link RestContext} on a particular endpoint using the typed
* interface
*
* <pre>
* context = ContextBuilder.newBuilder(new NovaApiMetadata())
* .endpoint("http://10.10.10.10:5000/v2.0")
* .credentials(user, pass)
* .build(NovaApiMetadata.CONTEXT_TOKEN)
* </pre>
*
* <br/>
* ex. to build a {@link View} of a particular backend context, looked up by
* key.
*
* <pre>
* context = ContextBuilder.newBuilder("aws-s3")
* .credentials(apikey, secret)
* .buildView(BlobStoreContext.class);
* </pre>
*
* <h4>Assumptions</h4>
*
* Threadsafe objects will be bound as singletons to the Injector or Context
* provided.
* <p/>
* Note that Threadsafe objects will be bound as singletons to the Injector or Context provided.
* <p/>
* <p/>
* If no <code>Module</code>s are specified, the default {@link JDKLoggingModule logging} and
* {@link JavaUrlHttpCommandExecutorServiceModule http transports} will be installed.
* If no <code>Module</code>s are specified, the default
* {@link JDKLoggingModule logging} and
* {@link JavaUrlHttpCommandExecutorServiceModule http transports} will be
* installed.
*
* @author Adrian Cole, Andrew Newdigate
* @see RestContext
* @see Context
* @see View
* @see ApiMetadata
* @see ProviderMetadata
*/
public class ContextBuilder {

View File

@ -31,9 +31,17 @@ import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
* This class is deprecated in favor of {@link ContextBuilder}. Please view
* sample usage below:
*
* <pre>
* context = ContextBuilder.newBuilder("aws-elb")
* .credentials(apikey, secret)
* .buildView(LoadBalancerServiceContext.class);
* </pre>
*
* @see ContextBuilder
* @see LoadBalancerServiceContextBuilder
* @deprecated As of version 1.5, replaced by {@link ContextBuilder}
* @author Adrian Cole
*/
@Deprecated