1 package net.walend.somnifugi; 2 3 import java.util.Hashtable ; 4 import javax.naming.Context ; 5 import javax.naming.spi.InitialContextFactory ; 6 7 32 33 public class SomniTopicContextFactory 34 implements InitialContextFactory 35 { 36 public SomniTopicContextFactory() 37 { 38 } 39 40 @SuppressWarnings ("unchecked") 41 public Context getInitialContext(Hashtable <?,?> environment) 42 { 43 String contextName = (String )environment.get(SomniProperties.TOPICCONTEXTNAMEKEY); 44 45 if(contextName==null) 46 { 47 contextName = SomniProperties.TOPICDEFAULTCONTEXTNAME; 48 } 49 50 return new SomniTopicContext(contextName,(Hashtable <Object ,Object >)environment); 51 } 52 } 53 54 76 | Popular Tags |