1 25 package org.objectweb.petals.jbi.component.context; 26 27 import java.util.List ; 28 29 import javax.jbi.component.ComponentContext; 30 import javax.jbi.component.InstallationContext; 31 32 import org.objectweb.petals.tools.jbicommon.descriptor.ComponentDescription; 33 import org.w3c.dom.DocumentFragment ; 34 35 41 public class InstallationContextImpl implements InstallationContext { 42 43 private List classPathElements; 44 45 private String componentClassName; 46 47 private String componentName; 48 49 private ComponentContext context; 50 51 private boolean install; 52 53 private DocumentFragment installationDescriptorExtension; 54 55 private String installRoot; 56 57 public InstallationContextImpl(ComponentDescription component, 58 ComponentContext context, boolean install) { 59 super(); 60 61 this.context = new ComponentContextForInstallation(context); 62 this.componentClassName = component.getComponentClassName(); 63 this.componentName = component.getIdentification().getName(); 64 this.install = install; 65 this.classPathElements = component.getComponentClassPath(); 66 this.installRoot = context.getInstallRoot(); 67 this.installationDescriptorExtension = component.getExtensions() 68 .getDocumentFragment(); 69 } 70 71 76 public List getClassPathElements() { 77 return classPathElements; 78 } 79 80 85 public String getComponentClassName() { 86 return componentClassName; 87 } 88 89 94 public String getComponentName() { 95 return componentName; 96 } 97 98 104 public ComponentContext getContext() { 105 return context; 106 } 107 108 113 public DocumentFragment getInstallationDescriptorExtension() { 114 return installationDescriptorExtension; 115 } 116 117 122 public String getInstallRoot() { 123 return installRoot; 124 } 125 126 131 public boolean isInstall() { 132 return install; 133 } 134 135 142 public void setClassPathElements(List classPathElements) { 143 if (classPathElements == null) { 144 throw new IllegalArgumentException ( 145 "classPathElements must not be null"); 146 } 147 if (classPathElements.isEmpty()) { 148 throw new IllegalArgumentException ( 149 "classPathElements must not be empty"); 150 } 151 this.classPathElements = classPathElements; 152 } 153 154 } 155 | Popular Tags |