Example usage for com.amazonaws.services.ec2.model RunInstancesRequest setGeneralProgressListener

List of usage examples for com.amazonaws.services.ec2.model RunInstancesRequest setGeneralProgressListener

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model RunInstancesRequest setGeneralProgressListener.

Prototype

public void setGeneralProgressListener(ProgressListener progressListener) 

Source Link

Document

Sets the optional progress listener for receiving updates about the progress of the request.

Usage

From source file:net.maxgigapop.www.rains.experiment.AwsTest1.java

public static void main(String[] args) {
    try {/*from www  . j a  v a 2 s .co  m*/
        // marshall contractXml
        RunInstancesRequest runInstance = new RunInstancesRequest();
        runInstance.withImageId("ami-146e2a7c").withInstanceType("t2.micro").withMaxCount(1).withMinCount(1);
        List<InstanceNetworkInterfaceSpecification> networkInterfaceSpecifications = new ArrayList();
        runInstance.withNetworkInterfaces(networkInterfaceSpecifications);
        runInstance.setGeneralProgressListener(null);
        runInstance.setRequestCredentials(null);
        String xml = new JAXBHelper<RunInstancesRequest>(RunInstancesRequest.class).partialMarshal(runInstance,
                new QName("http://maxgigapop.net/versastack/aws/api/", "RunInstancesRequest"));
        System.out.println("RunInstancesRequest mashaled:\n" + xml);
    } catch (JAXBException ex) {
        System.err.println(ex.toString());
    }
}