1 package net.walend.somnifugi; 2 3 import java.util.Set ; 4 5 10 11 public class SomniJNDIBypass 12 { 13 private static final String SOMNIJNDIBYPASSQUEUECONTEXTNAME = "SomniJNDIBypassQueue"; 14 private static final String SOMNIJNDIBYPASSTOPICCONTEXTNAME = "SomniJNDIBypassTopic"; 15 16 public static final SomniJNDIBypass IT = new SomniJNDIBypass(); 17 18 private final SomniQueueContext queueContext = new SomniQueueContext(SOMNIJNDIBYPASSQUEUECONTEXTNAME,System.getProperties()); 19 private final SomniQueueConnectionFactory queueConnectionFactory = new SomniQueueConnectionFactory(); 20 21 private final SomniTopicContext topicContext = new SomniTopicContext(SOMNIJNDIBYPASSTOPICCONTEXTNAME,System.getProperties()); 22 private final SomniTopicConnectionFactory topicConnectionFactory = new SomniTopicConnectionFactory(); 23 24 private SomniJNDIBypass() 25 { 26 } 27 28 public SomniQueueContext getQueueContext() 29 { 30 return queueContext; 31 } 32 33 public SomniTopicContext getTopicContext() 34 { 35 return topicContext; 36 } 37 38 public SomniQueueConnectionFactory getQueueConnectionFactory() 39 { 40 return queueConnectionFactory; 41 } 42 43 public SomniTopicConnectionFactory getTopicConnectionFactory() 44 { 45 return topicConnectionFactory; 46 } 47 48 public SomniQueue getQueue(String key) 49 throws SomniNamingException 50 { 51 return SomniQueueCache.IT.getQueue(key,queueContext); 52 } 53 54 public boolean containsQueue(String key) 55 { 56 return SomniQueueCache.IT.containsQueue(key); 57 } 58 59 public Set <String > getQueueNames() 60 { 61 return SomniQueueCache.IT.getNames(); 62 } 63 64 public SomniTopic getTopic(String key) 65 throws SomniNamingException 66 { 67 return SomniTopicCache.IT.getTopic(key,topicContext); 68 } 69 70 public boolean containsTopic(String key) 71 { 72 return SomniTopicCache.IT.containsTopic(key); 73 } 74 75 public Set <String > getTopicNames() 76 { 77 return SomniTopicCache.IT.getNames(); 78 } 79 80 } 81 82 102 | Popular Tags |