1 23 24 package com.sun.enterprise.deployment.backend; 25 26 import java.util.Map ; 27 import java.util.Hashtable ; 28 import java.util.logging.Level ; 29 30 import com.sun.enterprise.util.i18n.StringManager; 31 32 41 public class ClientJarMakerRegistry { 42 43 private static ClientJarMakerRegistry theRegistry; 45 46 Map registeredThreads=null; 48 49 50 protected ClientJarMakerRegistry() { 51 registeredThreads = new Hashtable (); 53 } 54 55 58 public static ClientJarMakerRegistry getInstance() { 59 60 if (theRegistry==null) { 61 synchronized(ClientJarMakerRegistry.class) { 62 if (theRegistry==null) { 63 theRegistry = new ClientJarMakerRegistry(); 64 } 65 } 66 } 67 return theRegistry; 68 } 69 70 71 77 public void register(String moduleID, Thread clientJarMaker) { 78 79 registeredThreads.put(moduleID, clientJarMaker); 80 } 81 82 85 public boolean isRegistered(String moduleID) { 86 87 return registeredThreads.containsKey(moduleID); 88 } 89 90 96 public void unregister(String moduleID) { 97 98 registeredThreads.remove(moduleID); 99 } 100 101 105 public void waitForCompletion(String moduleID) { 106 107 Thread maker = (Thread ) registeredThreads.get(moduleID); 108 if (maker==null) 109 return; 110 111 try { 112 maker.join(); 113 } catch(InterruptedException e) { 114 StringManager localStrings = StringManager.getManager( ClientJarMakerRegistry.class ); 115 DeploymentLogger.get().log(Level.SEVERE, 116 localStrings.getString("enterprise.deployment.error_creating_client_jar", 117 e.getLocalizedMessage()) ,e); 118 } 119 120 return; 121 } 122 123 } 124 | Popular Tags |