1 22 23 package org.objectweb.petals.component.common.su; 24 25 import java.util.HashMap ; 26 import java.util.Map ; 27 28 import javax.jbi.servicedesc.ServiceEndpoint; 29 30 import org.objectweb.petals.tools.jbicommon.descriptor.Consumes; 31 import org.objectweb.petals.tools.jbicommon.descriptor.JBIDescriptor; 32 import org.objectweb.petals.tools.jbicommon.descriptor.Provides; 33 import org.w3c.dom.Document ; 34 35 46 public class ServiceUnitDataHandler { 47 48 private JBIDescriptor descriptor; 49 50 private Map <ServiceEndpoint, Provides> epJBIDesc; 51 52 private Map <ServiceEndpoint, Document > epServiceDesc; 53 54 private Map <String , Consumes> addressToConsumes; 55 56 private String installRoot; 57 58 private String name; 59 60 public ServiceUnitDataHandler() { 61 super(); 62 addressToConsumes = new HashMap <String , Consumes>(); 63 epServiceDesc = new HashMap <ServiceEndpoint, Document >(); 64 epJBIDesc = new HashMap <ServiceEndpoint, Provides>(); 65 } 66 67 public void addEndpointDescription(final ServiceEndpoint endpoint, 68 final Document description) { 69 epServiceDesc.put(endpoint, description); 70 } 71 72 public void addJBIDescription(final ServiceEndpoint endpoint, 73 final Provides provides) { 74 epJBIDesc.put(endpoint, provides); 75 } 76 77 public JBIDescriptor getDescriptor() { 78 return descriptor; 79 } 80 81 public Map <ServiceEndpoint, Provides> getEpJBIDesc() { 82 return epJBIDesc; 83 } 84 85 public Map <ServiceEndpoint, Document > getEpServiceDesc() { 86 return epServiceDesc; 87 } 88 89 public String getInstallRoot() { 90 return installRoot; 91 } 92 93 public String getName() { 94 return name; 95 } 96 97 public void setName(String name) { 98 this.name = name; 99 } 100 101 public void removeEndpoint(final ServiceEndpoint endpoint) { 102 epServiceDesc.remove(endpoint); 103 epJBIDesc.remove(endpoint); 104 } 105 106 public void setDescriptor(final JBIDescriptor descriptor) { 107 this.descriptor = descriptor; 108 } 109 110 public void setEpJBIDesc(final Map <ServiceEndpoint, Provides> epJBIDesc) { 111 this.epJBIDesc = epJBIDesc; 112 } 113 114 public void setEpServiceDesc( 115 final Map <ServiceEndpoint, Document > epServiceDesc) { 116 this.epServiceDesc = epServiceDesc; 117 } 118 119 public void setInstallRoot(final String installRoot) { 120 this.installRoot = installRoot; 121 } 122 123 public Map <String , Consumes> getAddressToConsumes() { 124 return addressToConsumes; 125 } 126 127 public void setAddressToConsumes( 128 final Map <String , Consumes> addressToConsumes) { 129 this.addressToConsumes = addressToConsumes; 130 } 131 132 public void addAddressToConsumes(final String address, 133 final Consumes consumes) { 134 addressToConsumes.put(address, consumes); 135 } 136 137 } 138 | Popular Tags |