001 /*
002 * File: $HeadURL: https://jvoicexml.svn.sourceforge.net/svnroot/jvoicexml/core/trunk/org.jvoicexml.implementation.jsapi10/src/org/jvoicexml/implementation/jsapi10/Jsapi10TelephonyFactory.java $
003 * Version: $LastChangedRevision: 2355 $
004 * Date: $LastChangedDate: 2010-10-07 20:28:03 +0200 (Do, 07 Okt 2010) $
005 * Author: $LastChangedBy: schnelle $
006 *
007 * JVoiceXML - A free VoiceXML implementation.
008 *
009 * Copyright (C) 2008 JVoiceXML group - http://jvoicexml.sourceforge.net
010 *
011 * This library is free software; you can redistribute it and/or
012 * modify it under the terms of the GNU Library General Public
013 * License as published by the Free Software Foundation; either
014 * version 2 of the License, or (at your option) any later version.
015 *
016 * This library is distributed in the hope that it will be useful,
017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019 * Library General Public License for more details.
020 *
021 * You should have received a copy of the GNU Library General Public
022 * License along with this library; if not, write to the Free Software
023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024 *
025 */
026
027 package org.jvoicexml.implementation.jsapi10;
028
029 import org.jvoicexml.event.error.NoresourceError;
030 import org.jvoicexml.implementation.ResourceFactory;
031 import org.jvoicexml.implementation.Telephony;
032
033 /**
034 * Demo implementation of a
035 * {@link org.jvoicexml.implementation.ResourceFactory} for the
036 * {@link Telephony} based on JSAPI 1.0.
037 *
038 * <p>
039 * This implementation uses the mcrophone and the speaker for audio support.
040 * </p>
041 *
042 * @author Dirk Schnelle
043 * @version $Revision: 2355 $
044 *
045 * <p>
046 * Copyright © 2008 JVoiceXML group -
047 * <a href="http://jvoicexml.sourceforge.net">
048 * http://jvoicexml.sourceforge.net/</a>
049 * </p>
050 *
051 * @since 0.6
052 */
053 public final class Jsapi10TelephonyFactory
054 implements ResourceFactory<Telephony> {
055 /** Number of instances that this factory will create. */
056 private int instances;
057
058 /**
059 * Constructs a new object.
060 */
061 public Jsapi10TelephonyFactory() {
062 }
063
064 /**
065 * {@inheritDoc}
066 */
067 public Telephony createResource()
068 throws NoresourceError {
069
070 return new Jsapi10TelephonySupport();
071 }
072
073 /**
074 * Sets the number of instances that this factory will create.
075 * @param number Number of instances to create.
076 */
077 public void setInstances(final int number) {
078 instances = number;
079 }
080
081 /**
082 * {@inheritDoc}
083 */
084 public int getInstances() {
085 return instances;
086 }
087
088 /**
089 * {@inheritDoc}
090 */
091 public String getType() {
092 return "jsapi10";
093 }
094
095 /**
096 * {@inheritDoc}
097 */
098 public Class<Telephony> getResourceType() {
099 return Telephony.class;
100 }
101 }