KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > media > engine > MediaRegistry


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8
9 package org.jboss.media.engine;
10
11 import java.util.HashMap JavaDoc;
12 import java.util.Iterator JavaDoc;
13
14 import org.jboss.system.ServiceMBeanSupport;
15
16 /**
17  * @version <tt>$Revision: 1.1 $</tt>
18  * @author <a HREF="mailto:spyridon_samothrakis@yahoo.com">Spyridon Samothrakis</a>
19  * @jmx.mbean extends="org.jboss.system.ServiceMBean"
20  * @jmx.mbean description="The media registry"
21  */

22 public class MediaRegistry
23    extends ServiceMBeanSupport
24       implements MediaRegistryMBean
25 {
26
27    private HashMap JavaDoc m_media = new HashMap JavaDoc();
28    
29    /**
30     * @jmx.managed-operation description="add a media object"
31     */

32    public void addMedia(String JavaDoc name , Media object)
33    {
34       m_media.put(name,object);
35    }
36    
37    /**
38     * @jmx.managed-operation description="remove a media object"
39     */

40    public void removeMedia(String JavaDoc name)
41    {
42       m_media.remove(name);
43    }
44    
45    /**
46     * @jmx.managed-operation description="get the list of transcoder"
47     */

48    public Iterator JavaDoc getMediaNames()
49    {
50       return ((HashMap JavaDoc)m_media.clone()).keySet().iterator();
51    }
52    
53    
54    /**
55     * @jmx.managed-operation description="acquire a transcoder"
56     */

57    public Media getMedia(String JavaDoc name)
58    {
59       return (Media)m_media.get(name);
60    }
61
62 }
63
Popular Tags