本文整理汇总了Java中com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient类的典型用法代码示例。如果您正苦于以下问题:Java AmazonSimpleWorkflowClient类的具体用法?Java AmazonSimpleWorkflowClient怎么用?Java AmazonSimpleWorkflowClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AmazonSimpleWorkflowClient类属于com.amazonaws.services.simpleworkflow包,在下文中一共展示了AmazonSimpleWorkflowClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
AmazonSimpleWorkflow service = new AmazonSimpleWorkflowClient();
service.setEndpoint("https://swf.us-east-1.amazonaws.com");
String domain = "helloWorldWalkthrough";
String taskListToPoll = "HelloWorldAsyncList";
WorkflowWorker wfw = new WorkflowWorker(service, domain, taskListToPoll);
wfw.setRegisterDomain(true);
wfw.setDomainRetentionPeriodInDays(1);
wfw.addWorkflowImplementationType(GreeterWorkflowImpl.class);
wfw.start();
ActivityWorker aw = new ActivityWorker(service, domain, taskListToPoll);
aw.addActivitiesImplementation(new GreeterActivitiesImpl());
aw.start();
GreeterWorkflowClientExternalFactory clientFactory = new GreeterWorkflowClientExternalFactoryImpl(service, domain);
GreeterWorkflowClientExternal client = clientFactory.getClient();
client.greet();
}
示例2: setUp
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
configuration = new SWFConfiguration();
configuration.setDomainName("testDomain");
swClient = mock(AmazonSimpleWorkflowClient.class);
configuration.setAmazonSWClient(swClient);
configuration.setStartWorkflowOptionsParameters(Collections.<String, Object>emptyMap());
endpoint = new SWFEndpoint();
endpoint.setConfiguration(configuration);
clientExternal = mock(DynamicWorkflowClientExternalImpl.class);
camelSWFWorkflowClient = new CamelSWFWorkflowClient(endpoint, configuration) {
@Override
DynamicWorkflowClientExternal getDynamicWorkflowClient(String workflowId, String runId) {
return clientExternal;
}
};
}
示例3: swf
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
@Value.Default
public AmazonSimpleWorkflow swf() {
//SWF holds the connection for 60 seconds to see if a decision is available
final Duration DEFAULT_CONNECTION_TIMEOUT = Duration.ofSeconds(60);
final Duration DEFAULT_SOCKET_TIMEOUT = DEFAULT_CONNECTION_TIMEOUT.plusSeconds(10);
return new AmazonSimpleWorkflowClient(new DefaultAWSCredentialsProviderChain(),
new ClientConfiguration().withConnectionTimeout((int) DEFAULT_CONNECTION_TIMEOUT.toMillis())
.withSocketTimeout((int) DEFAULT_SOCKET_TIMEOUT.toMillis()));
}
示例4: createSWFClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
/**
* Create a new SWF client given the current configuration.
*
* @return an AmazonSimpleWorkflow client
*/
AmazonSimpleWorkflow createSWFClient() {
AWSCredentials credentials = new DefaultAWSCredentialsProviderChain().getCredentials();
AmazonSimpleWorkflow service =
new AmazonSimpleWorkflowClient(credentials, new ClientConfiguration().withSocketTimeout(SOCKET_TIMEOUT));
service.setEndpoint(swfServiceUrl);
return service;
}
示例5: createSWClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
private AmazonSimpleWorkflowClient createSWClient() throws Exception {
AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
ClientConfiguration clientConfiguration = new ClientConfiguration();
if (!configuration.getClientConfigurationParameters().isEmpty()) {
setProperties(clientConfiguration, configuration.getClientConfigurationParameters());
}
AmazonSimpleWorkflowClient client = new AmazonSimpleWorkflowClient(credentials, clientConfiguration);
if (!configuration.getSWClientParameters().isEmpty()) {
setProperties(client, configuration.getSWClientParameters());
}
return client;
}
示例6: createRegistry
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry registry = super.createRegistry();
amazonSWClient = mock(AmazonSimpleWorkflowClient.class);
registry.bind("amazonSWClient", amazonSWClient);
return registry;
}
示例7: getClientProvider
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
@Produces
@Singleton
public SWFClientProvider getClientProvider() throws Exception {
AmazonSimpleWorkflowClient client = SWFUtils.createWorkflowClient();
if (client != null) {
SWFUtils.registerDomain(client);
}
return new SWFClientProvider(client);
}
示例8: createWorkflowClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
public static AmazonSimpleWorkflowClient createWorkflowClient() {
BasicCredentialsProvider credentials = BasicCredentialsProvider.standard();
AmazonSimpleWorkflowClient client = !credentials.isValid() ? null : (AmazonSimpleWorkflowClient)
AmazonSimpleWorkflowClientBuilder.standard()
.withCredentials(credentials)
.withRegion("eu-west-1")
.build();
return client;
}
示例9: getSWClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
public AmazonSimpleWorkflowClient getSWClient() {
return configuration.getAmazonSWClient() != null ? configuration.getAmazonSWClient() : amazonSWClient;
}
示例10: getAmazonSWClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
public AmazonSimpleWorkflowClient getAmazonSWClient() {
return amazonSWClient;
}
示例11: setAmazonSWClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
/**
* To use the given AmazonSimpleWorkflowClient as client
*/
public void setAmazonSWClient(AmazonSimpleWorkflowClient amazonSWClient) {
this.amazonSWClient = amazonSWClient;
}
示例12: createSWFClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
static AmazonSimpleWorkflow createSWFClient() {
AWSCredentials awsCredentials = new BasicAWSCredentials("{swfAccessId}", "{swfSecretKey}");
AmazonSimpleWorkflow client = new AmazonSimpleWorkflowClient(awsCredentials);
client.setEndpoint("{swfServiceUrl}");
return client;
}
示例13: createSWFClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
public AmazonSimpleWorkflow createSWFClient() {
AWSCredentials awsCredentials = new BasicAWSCredentials(this.swfAccessId, this.swfSecretKey);
AmazonSimpleWorkflow client = new AmazonSimpleWorkflowClient(awsCredentials);
client.setEndpoint(this.swfServiceUrl);
return client;
}
示例14: SWFClientProvider
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
SWFClientProvider(AmazonSimpleWorkflowClient client) {
this.client = client;
}
示例15: getClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient; //导入依赖的package包/类
public AmazonSimpleWorkflowClient getClient() {
return client;
}