Source code: org/mobicents/slee/resource/ResourceAdaptorType.java
1 /*
2 * Created on Oct 21, 2004
3 *
4 * The Open SLEE Project
5 *
6 * A SLEE for the People
7 *
8 * The source code contained in this file is in in the public domain.
9 * It can be used in any project or product without prior permission,
10 * license or royalty payments. There is no claim of correctness and
11 * NO WARRANTY OF ANY KIND provided with this code.
12 */
13 package org.mobicents.slee.resource;
14
15 import org.jboss.naming.NonSerializableFactory;
16 import org.mobicents.slee.container.SleeContainer;
17 import org.mobicents.slee.container.management.ComponentKey;
18 import org.mobicents.slee.container.management.ResourceAdaptorIDImpl;
19 import org.mobicents.slee.resource.sip.SipActivityContextInterfaceFactoryImpl;
20
21 import java.io.Serializable;
22 import java.util.Collection;
23 import java.util.HashMap;
24 import java.util.HashSet;
25
26 import javax.naming.Context;
27 import javax.naming.InitialContext;
28 import javax.naming.NamingException;
29 import javax.naming.Reference;
30 import javax.naming.StringRefAddr;
31 import javax.sip.SipProvider;
32
33 /**
34 *
35 * An object that tracks all the resource adaptors for a given resource
36 * adaptor type id. There can be multiple resource adaptors given a resource
37 * adaptor type. There can be multiple resource adaptor entities for a given
38 * resource adaptor. This structure maps a given resource adaptor type to
39 * multiple resource adaptor IDs.
40 *
41 *
42 * @author F.Moggia
43 * @author M. Ranganathan ( hacks )
44 */
45 public class ResourceAdaptorType implements Serializable{
46 private ResourceAdaptorTypeIDImpl resourceAdaptorTypeID;
47 // Every resource adaptor type can have multiple Resource Adaptor Implementation
48 private HashSet resourceAdaptorIDs;
49 private ResourceAdaptorTypeDescriptorImpl raTypeDescr;
50 private String activityContextInterfaceJNDIName;
51
52 public ResourceAdaptorType(ResourceAdaptorTypeDescriptorImpl ratDescr) {
53 this.resourceAdaptorIDs = new HashSet();
54 this.raTypeDescr = ratDescr;
55 this.resourceAdaptorTypeID = new ResourceAdaptorTypeIDImpl
56 (new ComponentKey(ratDescr.getName(), ratDescr.getVendor(), ratDescr.getVersion()));
57
58 }
59
60 /**
61 * @return Returns the key.
62 */
63 public ResourceAdaptorTypeIDImpl getResourceAdaptorTypeID() {
64 return this.resourceAdaptorTypeID;
65 }
66
67 /**
68 * @return Returns the raTypeDescr.
69 */
70 public ResourceAdaptorTypeDescriptorImpl getRaTypeDescr() {
71 return raTypeDescr;
72 }
73
74 /**
75 * @return Returns the resourceAdaptors.
76 */
77 public HashSet getResourceAdaptorIDs() {
78 return this.resourceAdaptorIDs;
79 }
80
81
82
83 public void addResourceAdaptor ( ResourceAdaptorIDImpl resourceAdaptorID) {
84 this.resourceAdaptorIDs.add(resourceAdaptorID);
85 }
86
87
88
89 public String getActivityContextInterfaceFactoryJNDIName() {
90 return this.activityContextInterfaceJNDIName;
91
92 }
93
94 public void setActivityContextInterfaceJNDIName(String name) {
95 this.activityContextInterfaceJNDIName = name;
96 }
97
98 }