1 7 8 package org.jboss.media.registry; 9 10 import java.util.Iterator ; 11 import java.util.Map ; 12 13 import javax.emb.FormatAlreadyBoundException; 14 import javax.emb.FormatNotFoundException; 15 import javax.emb.MediaFormat; 16 17 import org.jboss.system.ServiceMBeanSupport; 18 19 27 public class ManagedMediaFormatRegistry 28 extends ServiceMBeanSupport 29 implements ManagedMediaFormatRegistryMBean 30 { 31 private SimpleMediaFormatRegistry mediaFormatRegistry; 32 33 36 public ManagedMediaFormatRegistry() 37 { 38 } 39 40 43 public void bind(String fileExtension, MediaFormat mediaFormat) 44 throws FormatAlreadyBoundException 45 { 46 mediaFormatRegistry.bind(fileExtension, mediaFormat); 47 } 48 49 52 public void rebind(String fileExtension, MediaFormat mediaFormat) 53 { 54 mediaFormatRegistry.rebind(fileExtension, mediaFormat); 55 } 56 57 60 public void unbind(String fileExtension) throws FormatNotFoundException 61 { 62 mediaFormatRegistry.unbind(fileExtension); 63 } 64 65 68 public MediaFormat lookup(String fileExtension) 69 throws FormatNotFoundException 70 { 71 return mediaFormatRegistry.lookup(fileExtension); 72 } 73 74 77 public Iterator fileExtensions() 78 { 79 return mediaFormatRegistry.fileExtensions(); 80 } 81 82 85 protected void createService() throws Exception 86 { 87 Map mediaFormats = JBossMediaFormatRegistry.createMediaFormats(); 88 mediaFormatRegistry = new SimpleMediaFormatRegistry(mediaFormats); 89 } 90 91 94 protected void destroyService() throws Exception 95 { 96 } 97 98 101 protected void startService() throws Exception 102 { 103 } 104 105 108 protected void stopService() throws Exception 109 { 110 } 111 } 112 | Popular Tags |