KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > client > jvm > JVMImplementationFactory


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

7 package org.jboss.jms.client.jvm;
8
9 import java.util.Hashtable JavaDoc;
10
11 import javax.naming.Context JavaDoc;
12 import javax.naming.Name JavaDoc;
13 import javax.naming.Reference JavaDoc;
14 import javax.naming.spi.ObjectFactory JavaDoc;
15
16 import org.jboss.jms.client.JBossConnectionFactory;
17
18 /**
19  * A factory for in jvm implementations
20  *
21  * @author <a HREF="mailto:adrian@jboss.org>Adrian Brock</a>
22  * @version $Revision: 1.2 $
23  */

24 public class JVMImplementationFactory
25    implements ObjectFactory JavaDoc
26 {
27    // Constants -----------------------------------------------------
28

29    // Attributes ----------------------------------------------------
30

31    // Static --------------------------------------------------------
32

33    // Constructors --------------------------------------------------
34

35    // Public --------------------------------------------------------
36

37    // ObjectFactory implementation ----------------------------------
38

39    public Object JavaDoc getObjectInstance(Object JavaDoc obj, Name JavaDoc name, Context JavaDoc nameCtx, Hashtable JavaDoc environment) throws Exception JavaDoc
40    {
41       try
42       {
43          Reference JavaDoc reference = (Reference JavaDoc) obj;
44          String JavaDoc className = reference.getClassName();
45          if (className.equals(JBossConnectionFactory.class.getName()))
46             return new JBossConnectionFactory(getImplementation(reference));
47       }
48       catch (Exception JavaDoc ignored)
49       {
50       }
51       return null;
52    }
53
54    // Protected ------------------------------------------------------
55

56    /**
57     * Get the implementation from the reference
58     *
59     * @param reference the reference
60     * @return the implementation
61     */

62    protected JVMImplementation getImplementation(Reference JavaDoc reference)
63       throws Exception JavaDoc
64    {
65       // TODO getImplementation
66
return null;
67    }
68    
69    // Package Private ------------------------------------------------
70

71    // Private --------------------------------------------------------
72

73    // Inner Classes --------------------------------------------------
74

75 }
76
Popular Tags