Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / taskqueue / QueueFactory.java
blob00ccfe2d0ac544fa256e3120e83bdd52ac3f0cf8
1 // Copyright 2010 Google Inc. All rights reserved.
2 package com.google.appengine.api.taskqueue;
4 import com.google.appengine.spi.ServiceFactoryFactory;
6 /**
7 * Creates {@link Queue} objects.
8 * {@link QueueFactory} is thread safe.
11 public final class QueueFactory {
13 /**
14 * Returns the default {@code QueueService}.
16 public static Queue getDefaultQueue() {
17 return getQueue(Queue.DEFAULT_QUEUE);
20 /**
21 * Returns the {@link Queue} by name.
22 * <p>The returned {@link Queue} object may not necessarily refer
23 * to an existing queue. Queues must be configured before
24 * they may be used. Attempting to use a non-existing queue name
25 * may result in errors at the point of use of the {@link Queue} object
26 * and not when calling {@link #getQueue(String)}.
28 public static Queue getQueue(String queueName) {
29 return getFactory().getQueue(queueName);
32 private QueueFactory() {
35 private static IQueueFactory getFactory() {
36 return ServiceFactoryFactory.getFactory(IQueueFactory.class);